From bea3b6687054f545979b9aa6e987ba4f13294416 Mon Sep 17 00:00:00 2001 From: steven-matos Date: Sun, 21 Jun 2026 14:46:45 -0400 Subject: [PATCH 1/2] fix: keep v6 ip5306 battery driver selection --- esp32_marauder/configs.h | 5 ++ tools/check_battery_driver_macros.ps1 | 73 +++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 tools/check_battery_driver_macros.ps1 diff --git a/esp32_marauder/configs.h b/esp32_marauder/configs.h index 97a6908..311ad7d 100644 --- a/esp32_marauder/configs.h +++ b/esp32_marauder/configs.h @@ -2711,6 +2711,11 @@ #undef HAS_MAX1704X #undef HAS_AXP192 + #elif defined(HAS_IP5306) + #undef HAS_AXP2101 + #undef HAS_MAX1704X + #undef HAS_AXP192 + #elif defined(HAS_AXP192) #undef HAS_AXP2101 #undef HAS_IP5306 diff --git a/tools/check_battery_driver_macros.ps1 b/tools/check_battery_driver_macros.ps1 new file mode 100644 index 0000000..97fa7dd --- /dev/null +++ b/tools/check_battery_driver_macros.ps1 @@ -0,0 +1,73 @@ +$ErrorActionPreference = "Stop" + +$repoRoot = Split-Path -Parent $PSScriptRoot +$configsPath = Join-Path $repoRoot "esp32_marauder/configs.h" +$configs = Get-Content -LiteralPath $configsPath -Raw + +function Assert-Match { + param( + [string]$Text, + [string]$Pattern, + [string]$Message + ) + + if ($Text -notmatch $Pattern) { + throw $Message + } +} + +function Get-MatchOrFail { + param( + [string]$Text, + [string]$Pattern, + [string]$Message + ) + + $match = [regex]::Match($Text, $Pattern, [System.Text.RegularExpressions.RegexOptions]::Singleline) + + if (-not $match.Success) { + throw $Message + } + + return $match +} + +Assert-Match ` + -Text $configs ` + -Pattern "(?s)#if defined\(MARAUDER_V6\) \|\| defined\(MARAUDER_V6_1\).*?#define HAS_BATTERY.*?#define HAS_IP5306" ` + -Message "MARAUDER_V6/MARAUDER_V6_1 must keep IP5306 battery support enabled." + +$cleanupMatch = Get-MatchOrFail ` + -Text $configs ` + -Pattern "(?s)// If we know what we have, we can delete what we're not using(?.*?)#endif\s+// HAS_BATTERY" ` + -Message "Could not find battery driver cleanup section." + +$cleanup = $cleanupMatch.Groups["cleanup"].Value + +$ip5306Match = Get-MatchOrFail ` + -Text $cleanup ` + -Pattern "(?s)#elif defined\(HAS_IP5306\)(?.*?)(?=\r?\n\s*#elif|\r?\n\s*#else|\r?\n\s*#endif)" ` + -Message "HAS_IP5306 must have an explicit cleanup branch before the generic fallback." + +$ip5306Branch = $ip5306Match.Groups["ip5306Branch"].Value + +Assert-Match ` + -Text $ip5306Branch ` + -Pattern "#undef HAS_AXP2101" ` + -Message "HAS_IP5306 cleanup must disable HAS_AXP2101." + +Assert-Match ` + -Text $ip5306Branch ` + -Pattern "#undef HAS_MAX1704X" ` + -Message "HAS_IP5306 cleanup must disable HAS_MAX1704X." + +Assert-Match ` + -Text $ip5306Branch ` + -Pattern "#undef HAS_AXP192" ` + -Message "HAS_IP5306 cleanup must disable HAS_AXP192." + +if ($ip5306Branch -match "#undef HAS_IP5306") { + throw "HAS_IP5306 cleanup must preserve HAS_IP5306 for v6/v6.1 battery support." +} + +Write-Host "Battery driver macro checks passed." From aaa72037363886ca98dbc7b7d2e35eb86df99318 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Mon, 22 Jun 2026 10:25:57 -0400 Subject: [PATCH 2/2] Add commented code for wardriving upload --- esp32_marauder/MenuFunctions.cpp | 377 +++++++++++++++---------------- esp32_marauder/MenuFunctions.h | 2 +- esp32_marauder/WiFiScan.cpp | 276 ++++++++++++++++++++++ esp32_marauder/WiFiScan.h | 8 + esp32_marauder/settings.h | 2 + esp32_marauder/utils.h | 9 + 6 files changed, 484 insertions(+), 190 deletions(-) diff --git a/esp32_marauder/MenuFunctions.cpp b/esp32_marauder/MenuFunctions.cpp index 77ad943..e7366b6 100644 --- a/esp32_marauder/MenuFunctions.cpp +++ b/esp32_marauder/MenuFunctions.cpp @@ -1632,37 +1632,37 @@ void MenuFunctions::RunSetup() // Build Main Menu mainMenu.parentMenu = NULL; - this->addNodes(&mainMenu, text_table1[7], TFTGREEN, NULL, WIFI, [this]() { + this->addNodes(&mainMenu, text_table1[7], TFTGREEN, WIFI, [this]() { this->changeMenu(&wifiMenu, true); }); #ifdef HAS_BT - this->addNodes(&mainMenu, text_table1[19], TFTCYAN, NULL, BLUETOOTH, [this]() { + this->addNodes(&mainMenu, text_table1[19], TFTCYAN, BLUETOOTH, [this]() { this->changeMenu(&bluetoothMenu, true); }); #endif #ifdef HAS_GPS if (gps_obj.getGpsModuleStatus()) { - this->addNodes(&mainMenu, text1_66, TFTRED, NULL, GPS_MENU, [this]() { + this->addNodes(&mainMenu, text1_66, TFTRED, GPS_MENU, [this]() { this->changeMenu(&gpsMenu, true); }); } #endif - this->addNodes(&mainMenu, text_table1[9], TFTBLUE, NULL, DEVICE, [this]() { + this->addNodes(&mainMenu, text_table1[9], TFTBLUE, DEVICE, [this]() { this->changeMenu(&deviceMenu, true); }); - this->addNodes(&mainMenu, text_table1[30], TFTLIGHTGREY, NULL, REBOOT, []() { + this->addNodes(&mainMenu, text_table1[30], TFTLIGHTGREY, REBOOT, []() { ESP.restart(); }); // Build WiFi Menu wifiMenu.parentMenu = &mainMenu; // Main Menu is second menu parent - this->addNodes(&wifiMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiMenu.parentMenu, true); }); - this->addNodes(&wifiMenu, text_table1[31], TFTYELLOW, NULL, SNIFFERS, [this]() { + this->addNodes(&wifiMenu, text_table1[31], TFTYELLOW, SNIFFERS, [this]() { this->changeMenu(&wifiSnifferMenu, true); }); - this->addNodes(&wifiMenu, "Scanners", TFTORANGE, NULL, SCANNERS, [this]() { + this->addNodes(&wifiMenu, "Scanners", TFTORANGE, SCANNERS, [this]() { this->changeMenu(&wifiScannerMenu, true); }); /*#ifdef HAS_GPS @@ -1670,41 +1670,41 @@ void MenuFunctions::RunSetup() this->changeMenu(&wardrivingMenu, true); }); #endif*/ - this->addNodes(&wifiMenu, text_table1[32], TFTRED, NULL, ATTACKS, [this]() { + this->addNodes(&wifiMenu, text_table1[32], TFTRED, ATTACKS, [this]() { this->changeMenu(&wifiAttackMenu, true); }); - this->addNodes(&wifiMenu, text_table1[33], TFTPURPLE, NULL, GENERAL_APPS, [this]() { + this->addNodes(&wifiMenu, text_table1[33], TFTPURPLE, GENERAL_APPS, [this]() { this->changeMenu(&wifiGeneralMenu, true); }); // Build WiFi scanner Menu wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent - this->addNodes(&wifiScannerMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiScannerMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiScannerMenu.parentMenu, true); }); - this->addNodes(&wifiScannerMenu, "Ping Scan", TFTGREEN, NULL, SCANNERS, [this]() { + this->addNodes(&wifiScannerMenu, "Ping Scan", TFTGREEN, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_PING_SCAN, TFT_CYAN); }); #ifndef HAS_DUAL_BAND - this->addNodes(&wifiScannerMenu, "ARP Scan", TFTCYAN, NULL, SCANNERS, [this]() { + this->addNodes(&wifiScannerMenu, "ARP Scan", TFTCYAN, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ARP_SCAN, TFT_CYAN); }); #endif - this->addNodes(&wifiScannerMenu, "Port Scan All", TFTMAGENTA, NULL, BEACON_LIST, [this](){ + this->addNodes(&wifiScannerMenu, "Port Scan All", TFTMAGENTA, BEACON_LIST, [this](){ // Add the back button wifiIPMenu.list->clear(); - this->addNodes(&wifiIPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiIPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiIPMenu.parentMenu, true); }); // Populate the menu with buttons for (int i = 0; i < ipList->size(); i++) { // This is the menu node - this->addNodes(&wifiIPMenu, ipList->get(i).toString().c_str(), TFTBLUE, NULL, 255, [this, i](){ + this->addNodes(&wifiIPMenu, ipList->get(i).toString().c_str(), TFTBLUE, 255, [this, i](){ Serial.println("Selected: " + ipList->get(i).toString()); wifi_scan_obj.current_scan_ip = ipList->get(i); display_obj.clearScreen(); @@ -1714,37 +1714,37 @@ void MenuFunctions::RunSetup() } this->changeMenu(&wifiIPMenu, true); }); - this->addNodes(&wifiScannerMenu, "SSH Scan", TFTORANGE, NULL, SCANNERS, [this]() { + this->addNodes(&wifiScannerMenu, "SSH Scan", TFTORANGE, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_SSH, TFT_CYAN); }); - this->addNodes(&wifiScannerMenu, "Telnet Scan", TFTRED, NULL, SCANNERS, [this]() { + this->addNodes(&wifiScannerMenu, "Telnet Scan", TFTRED, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_TELNET, TFT_CYAN); }); - this->addNodes(&wifiScannerMenu, "SMTP Scan", TFTWHITE, NULL, SCANNERS, [this]() { + this->addNodes(&wifiScannerMenu, "SMTP Scan", TFTWHITE, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_SMTP, TFT_CYAN); }); - this->addNodes(&wifiScannerMenu, "DNS Scan", TFTLIME, NULL, SCANNERS, [this]() { + this->addNodes(&wifiScannerMenu, "DNS Scan", TFTLIME, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_DNS, TFT_CYAN); }); - this->addNodes(&wifiScannerMenu, "HTTP Scan", TFTSKYBLUE, NULL, SCANNERS, [this]() { + this->addNodes(&wifiScannerMenu, "HTTP Scan", TFTSKYBLUE, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_HTTP, TFT_CYAN); }); - this->addNodes(&wifiScannerMenu, "HTTPS Scan", TFTYELLOW, NULL, SCANNERS, [this]() { + this->addNodes(&wifiScannerMenu, "HTTPS Scan", TFTYELLOW, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_HTTPS, TFT_CYAN); }); - this->addNodes(&wifiScannerMenu, "RDP Scan", TFTPURPLE, NULL, SCANNERS, [this]() { + this->addNodes(&wifiScannerMenu, "RDP Scan", TFTPURPLE, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_RDP, TFT_CYAN); @@ -1752,103 +1752,103 @@ void MenuFunctions::RunSetup() // Build WiFi sniffer Menu wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent - this->addNodes(&wifiSnifferMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiSnifferMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiSnifferMenu.parentMenu, true); }); - this->addNodes(&wifiSnifferMenu, text_table1[42], TFTCYAN, NULL, PROBE_SNIFF, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[42], TFTCYAN, PROBE_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN); }); - this->addNodes(&wifiSnifferMenu, text_table1[43], TFTMAGENTA, NULL, BEACON_SNIFF, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[43], TFTMAGENTA, BEACON_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA); }); - this->addNodes(&wifiSnifferMenu, text_table1[44], TFTRED, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[44], TFTRED, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED); }); - this->addNodes(&wifiSnifferMenu, "Packet Count", TFTORANGE, NULL, PACKET_MONITOR, [this]() { + this->addNodes(&wifiSnifferMenu, "Packet Count", TFTORANGE, PACKET_MONITOR, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_PACKET_RATE, TFT_ORANGE); wifi_scan_obj.renderPacketRate(); }); #ifdef HAS_ILI9341 - this->addNodes(&wifiSnifferMenu, text_table1[46], TFTVIOLET, NULL, EAPOL, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[46], TFTVIOLET, EAPOL, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET); }); - this->addNodes(&wifiSnifferMenu, text_table1[45], TFTBLUE, NULL, PACKET_MONITOR, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[45], TFTBLUE, PACKET_MONITOR, [this]() { wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE); }); #else // No touch - this->addNodes(&wifiSnifferMenu, text_table1[46], TFTVIOLET, NULL, EAPOL, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[46], TFTVIOLET, EAPOL, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET); }); - this->addNodes(&wifiSnifferMenu, text_table1[45], TFTBLUE, NULL, PACKET_MONITOR, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[45], TFTBLUE, PACKET_MONITOR, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE); }); #endif - this->addNodes(&wifiSnifferMenu, "Channel Analyzer", TFTCYAN, NULL, PACKET_MONITOR, [this]() { + this->addNodes(&wifiSnifferMenu, "Channel Analyzer", TFTCYAN, PACKET_MONITOR, [this]() { display_obj.clearScreen(); this->drawStatusBar(); this->renderGraphUI(WIFI_SCAN_CHAN_ANALYZER); wifi_scan_obj.StartScan(WIFI_SCAN_CHAN_ANALYZER, TFT_CYAN); }); - this->addNodes(&wifiSnifferMenu, "Channel Summary", TFTORANGE, NULL, PACKET_MONITOR, [this]() { + this->addNodes(&wifiSnifferMenu, "Channel Summary", TFTORANGE, PACKET_MONITOR, [this]() { display_obj.clearScreen(); this->drawStatusBar(); this->renderGraphUI(WIFI_SCAN_CHAN_ACT); wifi_scan_obj.StartScan(WIFI_SCAN_CHAN_ACT, TFT_CYAN); }); - this->addNodes(&wifiSnifferMenu, text_table1[58], TFTWHITE, NULL, PACKET_MONITOR, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[58], TFTWHITE, PACKET_MONITOR, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_RAW_CAPTURE, TFT_WHITE); }); - this->addNodes(&wifiSnifferMenu, text_table1[47], TFTRED, NULL, PWNAGOTCHI, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[47], TFTRED, PWNAGOTCHI, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_RED); }); - this->addNodes(&wifiSnifferMenu, text_table1[63], TFTYELLOW, NULL, PINESCAN_SNIFF, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[63], TFTYELLOW, PINESCAN_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_PINESCAN, TFT_YELLOW); }); - this->addNodes(&wifiSnifferMenu, text_table1[64], TFTORANGE, NULL, MULTISSID_SNIFF, [this]() { + this->addNodes(&wifiSnifferMenu, text_table1[64], TFTORANGE, MULTISSID_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_MULTISSID, TFT_ORANGE); }); - this->addNodes(&wifiSnifferMenu, "Scan AP/STA", TFTLIME, NULL, BEACON_SNIFF, [this]() { + this->addNodes(&wifiSnifferMenu, "Scan AP/STA", TFTLIME, BEACON_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_AP_STA, 0x97e0); }); - this->addNodes(&wifiSnifferMenu, "Fox Hunt", TFTCYAN, NULL, PACKET_MONITOR, [this]() { + this->addNodes(&wifiSnifferMenu, "Fox Hunt", TFTCYAN, PACKET_MONITOR, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_CYAN); }); - this->addNodes(&wifiSnifferMenu, "MAC Monitor", TFTMAGENTA, NULL, SCANNERS, [this]() { + this->addNodes(&wifiSnifferMenu, "MAC Monitor", TFTMAGENTA, SCANNERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_DETECT_FOLLOW, TFT_MAGENTA); }); - this->addNodes(&wifiSnifferMenu, "SAE Commit", TFTLIME, NULL, EAPOL, [this]() { + this->addNodes(&wifiSnifferMenu, "SAE Commit", TFTLIME, EAPOL, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_SAE_COMMIT, TFT_GREEN); @@ -1861,7 +1861,7 @@ void MenuFunctions::RunSetup() this->changeMenu(wardrivingMenu.parentMenu, true); });*/ if (gps_obj.getGpsModuleStatus()) { - this->addNodes(&wifiSnifferMenu, "Wardrive", TFTGREEN, NULL, BEACON_SNIFF, [this]() { + this->addNodes(&wifiSnifferMenu, "Wardrive", TFTGREEN, BEACON_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_WAR_DRIVE, TFT_GREEN); @@ -1880,35 +1880,35 @@ void MenuFunctions::RunSetup() // Build WiFi attack menu wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent - this->addNodes(&wifiAttackMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAttackMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAttackMenu.parentMenu, true); }); - this->addNodes(&wifiAttackMenu, text_table1[50], TFTRED, NULL, BEACON_LIST, [this]() { + this->addNodes(&wifiAttackMenu, text_table1[50], TFTRED, BEACON_LIST, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_LIST, TFT_RED); }); - this->addNodes(&wifiAttackMenu, text_table1[51], TFTORANGE, NULL, BEACON_SPAM, [this]() { + this->addNodes(&wifiAttackMenu, text_table1[51], TFTORANGE, BEACON_SPAM, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE); }); - this->addNodes(&wifiAttackMenu, text1_67, TFTCYAN, NULL, FUNNY_BEACON, [this]() { + this->addNodes(&wifiAttackMenu, text1_67, TFTCYAN, FUNNY_BEACON, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_FUNNY_BEACON, TFT_CYAN); }); - this->addNodes(&wifiAttackMenu, text_table1[52], TFTYELLOW, NULL, RICK_ROLL, [this]() { + this->addNodes(&wifiAttackMenu, text_table1[52], TFTYELLOW, RICK_ROLL, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW); }); - this->addNodes(&wifiAttackMenu, text_table1[53], TFTRED, NULL, PROBE_SNIFF, [this]() { + this->addNodes(&wifiAttackMenu, text_table1[53], TFTRED, PROBE_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_AUTH, TFT_RED); }); - this->addNodes(&wifiAttackMenu, "Evil Portal", TFTORANGE, NULL, BEACON_SNIFF, [this]() { + this->addNodes(&wifiAttackMenu, "Evil Portal", TFTORANGE, BEACON_SNIFF, [this]() { wifiAPMenu.list->clear(); ssidsMenu.list->clear(); @@ -1916,17 +1916,17 @@ void MenuFunctions::RunSetup() wifiAPMenu.parentMenu = &evilPortalMenu; ssidsMenu.parentMenu = &evilPortalMenu; - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); - this->addNodes(&ssidsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&ssidsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(ssidsMenu.parentMenu, true); }); // Get AP list ready for (int i = 0; i < access_points->size(); i++) { // This is the menu node - this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, 255, [this, i](){ if (evil_portal_obj.setAP(access_points->get(i).essid)) { AccessPoint new_ap = access_points->get(i); new_ap.selected = true; @@ -1946,7 +1946,7 @@ void MenuFunctions::RunSetup() for (int i = 0; i < ssids->size(); i++) { // This is the menu node - this->addNodes(&ssidsMenu, ssids->get(i).essid.c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&ssidsMenu, ssids->get(i).essid.c_str(), TFTCYAN, 255, [this, i](){ if (evil_portal_obj.setAP(ssids->get(i).essid)) { display_obj.clearScreen(); this->drawStatusBar(); @@ -1959,33 +1959,33 @@ void MenuFunctions::RunSetup() } this->changeMenu(&evilPortalMenu, true); }); - this->addNodes(&wifiAttackMenu, text_table1[54], TFTRED, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&wifiAttackMenu, text_table1[54], TFTRED, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_DEAUTH, TFT_RED); }); - this->addNodes(&wifiAttackMenu, text_table1[57], TFTMAGENTA, NULL, BEACON_LIST, [this]() { + this->addNodes(&wifiAttackMenu, text_table1[57], TFTMAGENTA, BEACON_LIST, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_AP_SPAM, TFT_MAGENTA); }); - this->addNodes(&wifiAttackMenu, text_table1[62], TFTRED, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&wifiAttackMenu, text_table1[62], TFTRED, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_DEAUTH_TARGETED, TFT_ORANGE); }); - this->addNodes(&wifiAttackMenu, "Karma", TFTORANGE, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiAttackMenu, "Karma", TFTORANGE, KEYBOARD_ICO, [this](){ // Add the back button selectProbeSSIDsMenu.list->clear(); - this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(&wifiAttackMenu, true); }); // Populate the menu with buttons for (int i = 0; i < probe_req_ssids->size(); i++) { // This is the menu node - this->addNodes(&selectProbeSSIDsMenu, probe_req_ssids->get(i).essid.c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&selectProbeSSIDsMenu, probe_req_ssids->get(i).essid.c_str(), TFTCYAN, 255, [this, i](){ if (evil_portal_obj.setAP(probe_req_ssids->get(i).essid)) { display_obj.clearScreen(); this->drawStatusBar(); @@ -1999,69 +1999,69 @@ void MenuFunctions::RunSetup() this->changeMenu(&selectProbeSSIDsMenu, true); }); - this->addNodes(&wifiAttackMenu, "Bad Msg", TFTRED, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&wifiAttackMenu, "Bad Msg", TFTRED, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_BAD_MSG, TFT_RED); }); - this->addNodes(&wifiAttackMenu, "Bad Msg Targeted", TFTYELLOW, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&wifiAttackMenu, "Bad Msg Targeted", TFTYELLOW, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_BAD_MSG_TARGETED, TFT_YELLOW); }); - this->addNodes(&wifiAttackMenu, "Assoc Sleep", TFTRED, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&wifiAttackMenu, "Assoc Sleep", TFTRED, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_SLEEP, TFT_RED); }); - this->addNodes(&wifiAttackMenu, "Assoc Sleep Targ", TFTMAGENTA, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&wifiAttackMenu, "Assoc Sleep Targ", TFTMAGENTA, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_SLEEP_TARGETED, TFT_MAGENTA); }); - this->addNodes(&wifiAttackMenu, "SAE Commit Flood", TFTLIME, NULL, EAPOL, [this]() { + this->addNodes(&wifiAttackMenu, "SAE Commit Flood", TFTLIME, EAPOL, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_SAE_COMMIT, TFT_GREEN); }); - this->addNodes(&wifiAttackMenu, "Channel Switch", TFTORANGE, NULL, BEACON_LIST, [this]() { + this->addNodes(&wifiAttackMenu, "Channel Switch", TFTORANGE, BEACON_LIST, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_CSA, TFT_GREEN); }); - this->addNodes(&wifiAttackMenu, "Quiet Time", TFTRED, NULL, BEACON_LIST, [this]() { + this->addNodes(&wifiAttackMenu, "Quiet Time", TFTRED, BEACON_LIST, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_QUIET, TFT_GREEN); }); evilPortalMenu.parentMenu = &wifiAttackMenu; - this->addNodes(&evilPortalMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&evilPortalMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(evilPortalMenu.parentMenu, true); }); - this->addNodes(&evilPortalMenu, "Access Points", TFTGREEN, NULL, BEACON_SNIFF, [this]() { + this->addNodes(&evilPortalMenu, "Access Points", TFTGREEN, BEACON_SNIFF, [this]() { this->changeMenu(&wifiAPMenu, true); }); - this->addNodes(&evilPortalMenu, "User SSIDs", TFTCYAN, NULL, PROBE_SNIFF, [this]() { + this->addNodes(&evilPortalMenu, "User SSIDs", TFTCYAN, PROBE_SNIFF, [this]() { this->changeMenu(&ssidsMenu, true); }); // Build WiFi General menu wifiGeneralMenu.parentMenu = &wifiMenu; - this->addNodes(&wifiGeneralMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiGeneralMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiGeneralMenu.parentMenu, true); }); - this->addNodes(&wifiGeneralMenu, text_table1[27], TFTSKYBLUE, NULL, GENERATE, [this]() { + this->addNodes(&wifiGeneralMenu, text_table1[27], TFTSKYBLUE, GENERATE, [this]() { this->changeMenu(&generateSSIDsMenu, true); wifi_scan_obj.RunGenerateSSIDs(); }); //Add Select probe ssid - this->addNodes(&wifiGeneralMenu, text_table1[65], TFTCYAN, NULL, KEYBOARD_ICO, [this]() { + this->addNodes(&wifiGeneralMenu, text_table1[65], TFTCYAN, KEYBOARD_ICO, [this]() { selectProbeSSIDsMenu.list->clear(); // Add the back button - this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&selectProbeSSIDsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(&wifiGeneralMenu, true); // TODO: TBD - Should probe_req_ssids have it´s own life and override ap.config and/or ssids -list for EP? @@ -2099,7 +2099,6 @@ void MenuFunctions::RunSetup() &selectProbeSSIDsMenu, button_name.c_str(), TFTCYAN, - NULL, 255, [this, i]() { ProbeReqSsid new_ssid = probe_req_ssids->get(i); @@ -2120,7 +2119,7 @@ void MenuFunctions::RunSetup() clearSSIDsMenu.parentMenu = &wifiGeneralMenu; #ifdef HAS_ILI9341 - this->addNodes(&wifiGeneralMenu, text_table1[1], TFTNAVY, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, text_table1[1], TFTNAVY, KEYBOARD_ICO, [this](){ char ssidBuf[64] = {0}; bool keep_going = true; while (keep_going) { @@ -2139,37 +2138,37 @@ void MenuFunctions::RunSetup() }); #endif #if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS)) - this->addNodes(&wifiGeneralMenu, text_table1[1], TFTNAVY, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, text_table1[1], TFTNAVY, KEYBOARD_ICO, [this](){ this->changeMenu(&miniKbMenu, true); #ifdef HAS_MINI_KB this->miniKeyboard(&miniKbMenu); #endif }); #endif - this->addNodes(&wifiGeneralMenu, text_table1[28], TFTSILVER, NULL, CLEAR_ICO, [this]() { + this->addNodes(&wifiGeneralMenu, text_table1[28], TFTSILVER, CLEAR_ICO, [this]() { this->changeMenu(&clearSSIDsMenu, true); wifi_scan_obj.RunClearSSIDs(); }); - this->addNodes(&wifiGeneralMenu, text_table1[29], TFTDARKGREY, NULL, CLEAR_ICO, [this]() { + this->addNodes(&wifiGeneralMenu, text_table1[29], TFTDARKGREY, CLEAR_ICO, [this]() { this->changeMenu(&clearAPsMenu, true); wifi_scan_obj.RunClearAPs(); }); - this->addNodes(&wifiGeneralMenu, text_table1[60], TFTBLUE, NULL, CLEAR_ICO, [this]() { + this->addNodes(&wifiGeneralMenu, text_table1[60], TFTBLUE, CLEAR_ICO, [this]() { this->changeMenu(&clearAPsMenu, true); wifi_scan_obj.RunClearStations(); }); //#else // Mini EP HTML select - this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFTCYAN, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFTCYAN, KEYBOARD_ICO, [this](){ // Add the back button htmlMenu.list->clear(); - this->addNodes(&htmlMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&htmlMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(htmlMenu.parentMenu, true); }); // Populate the menu with buttons for (int i = 0; i < evil_portal_obj.html_files->size(); i++) { // This is the menu node - this->addNodes(&htmlMenu, evil_portal_obj.html_files->get(i).c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&htmlMenu, evil_portal_obj.html_files->get(i).c_str(), TFTCYAN, 255, [this, i](){ evil_portal_obj.selected_html_index = i; evil_portal_obj.target_html_name = evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index); Serial.println("Set Evil Portal HTML as " + evil_portal_obj.target_html_name); @@ -2184,27 +2183,27 @@ void MenuFunctions::RunSetup() //#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS)) miniKbMenu.parentMenu = &wifiGeneralMenu; #if !defined(MARAUDER_CARDPUTER) && !defined(MARAUDER_CARDPUTER_ADV) - this->addNodes(&miniKbMenu, "a", TFTCYAN, NULL, 0, [this]() { + this->addNodes(&miniKbMenu, "a", TFTCYAN, 0, [this]() { this->changeMenu(miniKbMenu.parentMenu, true); }); #endif //#endif htmlMenu.parentMenu = &wifiGeneralMenu; - this->addNodes(&htmlMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&htmlMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(htmlMenu.parentMenu, true); }); // Select APs on Mini - this->addNodes(&wifiGeneralMenu, "Select APs", TFTNAVY, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, "Select APs", TFTNAVY, KEYBOARD_ICO, [this](){ wifiAPMenu.parentMenu = &wifiGeneralMenu; // Add the back button wifiAPMenu.list->clear(); - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); - this->addNodes(&wifiAPMenu, "Select ALL", TFTGREEN, NULL, 255, [this](){ + this->addNodes(&wifiAPMenu, "Select ALL", TFTGREEN, 255, [this](){ for (int x = 0; x < access_points->size(); x++) { AccessPoint new_ap = access_points->get(x); @@ -2223,7 +2222,7 @@ void MenuFunctions::RunSetup() // Populate the menu with buttons for (int i = 0; i < access_points->size(); i++) { // This is the menu node - this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, 255, [this, i](){ AccessPoint new_ap = access_points->get(i); new_ap.selected = !access_points->get(i).selected; @@ -2238,19 +2237,19 @@ void MenuFunctions::RunSetup() this->changeMenu(&wifiAPMenu, true); }); - this->addNodes(&wifiGeneralMenu, "View AP Info", TFTCYAN, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, "View AP Info", TFTCYAN, KEYBOARD_ICO, [this](){ wifiAPMenu.parentMenu = &wifiGeneralMenu; // Add the back button wifiAPMenu.list->clear(); - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); // Populate the menu with buttons for (int i = 0; i < access_points->size(); i++) { // This is the menu node - this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, 255, [this, i](){ this->changeMenu(&apInfoMenu, true); wifi_scan_obj.RunAPInfo(i); }); @@ -2259,27 +2258,27 @@ void MenuFunctions::RunSetup() }); apInfoMenu.parentMenu = &wifiAPMenu; - this->addNodes(&apInfoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&apInfoMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(apInfoMenu.parentMenu, true); }); wifiAPMenu.parentMenu = &wifiGeneralMenu; - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); wifiIPMenu.parentMenu = &wifiScannerMenu; - this->addNodes(&wifiIPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiIPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiIPMenu.parentMenu, true); }); // Select Stations on Mini v2 - this->addNodes(&wifiGeneralMenu, "Select Stations", TFTCYAN, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, "Select Stations", TFTCYAN, KEYBOARD_ICO, [this](){ wifiAPMenu.parentMenu = &wifiGeneralMenu; wifiAPMenu.list->clear(); - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); @@ -2288,18 +2287,18 @@ void MenuFunctions::RunSetup() for (int i = 0; i < menu_limit; i++) { wifiStationMenu.list->clear(); - this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, 255, [this, i](){ wifiStationMenu.list->clear(); wifiStationMenu.parentMenu = &wifiAPMenu; // Add back button to the APs - this->addNodes(&wifiStationMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiStationMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiStationMenu.parentMenu, true); }); - this->addNodes(&wifiStationMenu, "Select ALL", TFTGREEN, NULL, 255, [this, i](){ + this->addNodes(&wifiStationMenu, "Select ALL", TFTGREEN, 255, [this, i](){ for (int y = 0; y < access_points->get(i).stations->size(); y++) { int cur_ap_sta_inx = access_points->get(i).stations->get(y); @@ -2322,7 +2321,7 @@ void MenuFunctions::RunSetup() for (int x = 0; x < access_points->get(i).stations->size(); x++) { int cur_ap_sta = access_points->get(i).stations->get(x); - this->addNodes(&wifiStationMenu, macToString(stations->get(cur_ap_sta)).c_str(), TFTCYAN, NULL, 255, [this, i, cur_ap_sta, x](){ + this->addNodes(&wifiStationMenu, macToString(stations->get(cur_ap_sta)).c_str(), TFTCYAN, 255, [this, i, cur_ap_sta, x](){ Station new_sta = stations->get(cur_ap_sta); new_sta.selected = !stations->get(cur_ap_sta).selected; @@ -2343,20 +2342,20 @@ void MenuFunctions::RunSetup() this->changeMenu(&wifiAPMenu, true); }); - this->addNodes(&wifiGeneralMenu, "Join WiFi", TFTWHITE, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, "Join WiFi", TFTWHITE, KEYBOARD_ICO, [this](){ wifiAPMenu.parentMenu = &wifiGeneralMenu; // Add the back button wifiAPMenu.list->clear(); - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); // Populate the menu with buttons for (int i = 0; i < access_points->size(); i++) { // This is the menu node - this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, 255, [this, i](){ // Join WiFi using mini keyboard #ifdef HAS_MINI_KB this->changeMenu(&miniKbMenu, true); @@ -2384,7 +2383,7 @@ void MenuFunctions::RunSetup() this->changeMenu(&wifiAPMenu, true); }); - this->addNodes(&wifiGeneralMenu, "Join Saved WiFi", TFTWHITE, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, "Join Saved WiFi", TFTWHITE, KEYBOARD_ICO, [this](){ String ssid = settings_obj.loadSetting("ClientSSID"); String pw = settings_obj.loadSetting("ClientPW"); @@ -2397,14 +2396,14 @@ void MenuFunctions::RunSetup() // Add the back button wifiAPMenu.list->clear(); - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); // Populate the menu with buttons for (int i = 0; i < access_points->size(); i++) { // This is the menu node - this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTCYAN, 255, [this, i](){ // Join WiFi using mini keyboard #ifdef HAS_MINI_KB this->changeMenu(&miniKbMenu, true); @@ -2433,19 +2432,19 @@ void MenuFunctions::RunSetup() } }); - this->addNodes(&wifiGeneralMenu, "Start AP", TFTGREEN, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, "Start AP", TFTGREEN, KEYBOARD_ICO, [this](){ ssidsMenu.parentMenu = &wifiGeneralMenu; // Add the back button ssidsMenu.list->clear(); - this->addNodes(&ssidsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&ssidsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(ssidsMenu.parentMenu, true); }); // Populate the menu with buttons for (int i = 0; i < ssids->size(); i++) { // This is the menu node - this->addNodes(&ssidsMenu, ssids->get(i).essid.c_str(), TFTCYAN, NULL, 255, [this, i](){ + this->addNodes(&ssidsMenu, ssids->get(i).essid.c_str(), TFTCYAN, 255, [this, i](){ // Join WiFi using mini keyboard #ifdef HAS_MINI_KB this->changeMenu(&miniKbMenu, true); @@ -2474,22 +2473,22 @@ void MenuFunctions::RunSetup() this->changeMenu(&ssidsMenu, true); }); - this->addNodes(&wifiGeneralMenu, "Host AP Info", TFTGREEN, NULL, BEACON_SNIFF, [this]() { + this->addNodes(&wifiGeneralMenu, "Host AP Info", TFTGREEN, BEACON_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_DISPLAY_AP_INFO, TFT_GREEN); }); wifiStationMenu.parentMenu = &ssidsMenu; - this->addNodes(&wifiStationMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiStationMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiStationMenu.parentMenu, true); }); - this->addNodes(&wifiGeneralMenu, "Set MACs", TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiGeneralMenu, "Set MACs", TFTLIGHTGREY, 0, [this]() { this->changeMenu(&setMacMenu, true); }); - this->addNodes(&wifiGeneralMenu, "Shutdown WiFi", TFTRED, NULL, 0, [this]() { + this->addNodes(&wifiGeneralMenu, "Shutdown WiFi", TFTRED, 0, [this]() { WiFi.disconnect(true); delay(100); wifi_scan_obj.StartScan(WIFI_SCAN_OFF, TFT_RED); @@ -2499,37 +2498,37 @@ void MenuFunctions::RunSetup() // Menu for generating and setting MAC addrs for AP and STA setMacMenu.parentMenu = &wifiGeneralMenu; - this->addNodes(&setMacMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&setMacMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(setMacMenu.parentMenu, true); }); // Generate random MAC for AP - this->addNodes(&setMacMenu, "Generate AP MAC", TFTLIME, NULL, 0, [this]() { + this->addNodes(&setMacMenu, "Generate AP MAC", TFTLIME, 0, [this]() { this->changeMenu(&genAPMacMenu, true); wifi_scan_obj.RunGenerateRandomMac(true); }); // Generate random MAC for AP - this->addNodes(&setMacMenu, "Generate STA MAC", TFTCYAN, NULL, 0, [this]() { + this->addNodes(&setMacMenu, "Generate STA MAC", TFTCYAN, 0, [this]() { this->changeMenu(&genAPMacMenu, true); wifi_scan_obj.RunGenerateRandomMac(false); }); // Clone AP MAC to ESP32 for button folks //#ifndef HAS_ILI9341 - this->addNodes(&setMacMenu, "Clone AP MAC", TFTRED, NULL, CLEAR_ICO, [this](){ + this->addNodes(&setMacMenu, "Clone AP MAC", TFTRED, CLEAR_ICO, [this](){ wifiAPMenu.parentMenu = &wifiGeneralMenu; // Add the back button wifiAPMenu.list->clear(); - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); // Populate the menu with buttons for (int i = 0; i < access_points->size(); i++) { // This is the menu node - this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTLIME, NULL, 255, [this, i](){ + this->addNodes(&wifiAPMenu, access_points->get(i).essid.c_str(), TFTLIME, 255, [this, i](){ this->changeMenu(&genAPMacMenu, true); wifi_scan_obj.RunSetMac(access_points->get(i).bssid, true); }); @@ -2537,19 +2536,19 @@ void MenuFunctions::RunSetup() this->changeMenu(&wifiAPMenu, true); }); - this->addNodes(&setMacMenu, "Clone STA MAC", TFTMAGENTA, NULL, CLEAR_ICO, [this](){ + this->addNodes(&setMacMenu, "Clone STA MAC", TFTMAGENTA, CLEAR_ICO, [this](){ wifiAPMenu.parentMenu = &wifiGeneralMenu; // Add the back button wifiAPMenu.list->clear(); - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); // Populate the menu with buttons for (int i = 0; i < stations->size(); i++) { // This is the menu node - this->addNodes(&wifiAPMenu, macToString(stations->get(i).mac).c_str(), TFTMAGENTA, NULL, 255, [this, i](){ + this->addNodes(&wifiAPMenu, macToString(stations->get(i).mac).c_str(), TFTMAGENTA, 255, [this, i](){ this->changeMenu(&genAPMacMenu, true); wifi_scan_obj.RunSetMac(stations->get(i).mac, false); }); @@ -2560,81 +2559,81 @@ void MenuFunctions::RunSetup() // Menu for generating and setting access point MAC (just goes bacK) genAPMacMenu.parentMenu = &wifiGeneralMenu; - this->addNodes(&genAPMacMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&genAPMacMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(genAPMacMenu.parentMenu, true); }); // Build generate ssids menu generateSSIDsMenu.parentMenu = &wifiGeneralMenu; - this->addNodes(&generateSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&generateSSIDsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(generateSSIDsMenu.parentMenu, true); }); // Build clear ssids menu - this->addNodes(&clearSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&clearSSIDsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(clearSSIDsMenu.parentMenu, true); }); clearAPsMenu.parentMenu = &wifiGeneralMenu; - this->addNodes(&clearAPsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&clearAPsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(clearAPsMenu.parentMenu, true); }); #ifdef HAS_BT // Build Bluetooth Menu bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent - this->addNodes(&bluetoothMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&bluetoothMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(bluetoothMenu.parentMenu, true); }); - this->addNodes(&bluetoothMenu, text_table1[31], TFTYELLOW, NULL, SNIFFERS, [this]() { + this->addNodes(&bluetoothMenu, text_table1[31], TFTYELLOW, SNIFFERS, [this]() { this->changeMenu(&bluetoothSnifferMenu, true); }); - this->addNodes(&bluetoothMenu, "Bluetooth Attacks", TFTRED, NULL, ATTACKS, [this]() { + this->addNodes(&bluetoothMenu, "Bluetooth Attacks", TFTRED, ATTACKS, [this]() { this->changeMenu(&bluetoothAttackMenu, true); }); // Build bluetooth sniffer Menu bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent - this->addNodes(&bluetoothSnifferMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&bluetoothSnifferMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(bluetoothSnifferMenu.parentMenu, true); }); - this->addNodes(&bluetoothSnifferMenu, text_table1[34], TFTGREEN, NULL, BLUETOOTH_SNIFF, [this]() { + this->addNodes(&bluetoothSnifferMenu, text_table1[34], TFTGREEN, BLUETOOTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN); }); - this->addNodes(&bluetoothSnifferMenu, "Flipper Sniff", TFTORANGE, NULL, FLIPPER, [this]() { + this->addNodes(&bluetoothSnifferMenu, "Flipper Sniff", TFTORANGE, FLIPPER, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_FLIPPER, TFT_ORANGE); }); - this->addNodes(&bluetoothSnifferMenu, "Airtag Sniff", TFTWHITE, NULL, BLUETOOTH_SNIFF, [this]() { + this->addNodes(&bluetoothSnifferMenu, "Airtag Sniff", TFTWHITE, BLUETOOTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_AIRTAG, TFT_WHITE); }); - this->addNodes(&bluetoothSnifferMenu, "Airtag Monitor", TFTWHITE, NULL, BLUETOOTH_SNIFF, [this]() { + this->addNodes(&bluetoothSnifferMenu, "Airtag Monitor", TFTWHITE, BLUETOOTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_AIRTAG_MON, TFT_WHITE); }); - this->addNodes(&bluetoothSnifferMenu, text_table1[35], TFTMAGENTA, NULL, CC_SKIMMERS, [this]() { + this->addNodes(&bluetoothSnifferMenu, text_table1[35], TFTMAGENTA, CC_SKIMMERS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA); }); - this->addNodes(&bluetoothSnifferMenu, "Bluetooth Analyzer", TFTCYAN, NULL, PACKET_MONITOR, [this]() { + this->addNodes(&bluetoothSnifferMenu, "Bluetooth Analyzer", TFTCYAN, PACKET_MONITOR, [this]() { display_obj.clearScreen(); this->drawStatusBar(); this->renderGraphUI(BT_SCAN_ANALYZER); wifi_scan_obj.StartScan(BT_SCAN_ANALYZER, TFT_CYAN); }); - this->addNodes(&bluetoothSnifferMenu, "Flock Sniff", TFTORANGE, NULL, FLOCK, [this]() { + this->addNodes(&bluetoothSnifferMenu, "Flock Sniff", TFTORANGE, FLOCK, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_FLOCK, TFT_ORANGE); }); - this->addNodes(&bluetoothSnifferMenu, "Meta Detect", TFTWHITE, NULL, BLUETOOTH_SNIFF, [this]() { + this->addNodes(&bluetoothSnifferMenu, "Meta Detect", TFTWHITE, BLUETOOTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_RAYBAN, TFT_CYAN); @@ -2642,40 +2641,40 @@ void MenuFunctions::RunSetup() // Bluetooth Attack menu bluetoothAttackMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent - this->addNodes(&bluetoothAttackMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&bluetoothAttackMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(bluetoothAttackMenu.parentMenu, true); }); - this->addNodes(&bluetoothAttackMenu, "Sour Apple", TFTGREEN, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&bluetoothAttackMenu, "Sour Apple", TFTGREEN, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_ATTACK_SOUR_APPLE, TFT_GREEN); }); - this->addNodes(&bluetoothAttackMenu, "Apple Juice", TFTYELLOW, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&bluetoothAttackMenu, "Apple Juice", TFTYELLOW, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_ATTACK_APPLE_JUICE, TFT_YELLOW); }); - this->addNodes(&bluetoothAttackMenu, "Swiftpair Spam", TFTCYAN, NULL, KEYBOARD_ICO, [this]() { + this->addNodes(&bluetoothAttackMenu, "Swiftpair Spam", TFTCYAN, KEYBOARD_ICO, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_ATTACK_SWIFTPAIR_SPAM, TFT_CYAN); }); - this->addNodes(&bluetoothAttackMenu, "Samsung BLE Spam", TFTRED, NULL, GENERAL_APPS, [this]() { + this->addNodes(&bluetoothAttackMenu, "Samsung BLE Spam", TFTRED, GENERAL_APPS, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_ATTACK_SAMSUNG_SPAM, TFT_RED); }); - this->addNodes(&bluetoothAttackMenu, "Google BLE Spam", TFTPURPLE, NULL, LANGUAGE, [this]() { + this->addNodes(&bluetoothAttackMenu, "Google BLE Spam", TFTPURPLE, LANGUAGE, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_ATTACK_GOOGLE_SPAM, TFT_PURPLE); }); - this->addNodes(&bluetoothAttackMenu, "Flipper BLE Spam", TFTORANGE, NULL, FLIPPER, [this]() { + this->addNodes(&bluetoothAttackMenu, "Flipper BLE Spam", TFTORANGE, FLIPPER, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_ATTACK_FLIPPER_SPAM, TFT_ORANGE); }); - this->addNodes(&bluetoothAttackMenu, "BLE Spam All", TFTMAGENTA, NULL, DEAUTH_SNIFF, [this]() { + this->addNodes(&bluetoothAttackMenu, "BLE Spam All", TFTMAGENTA, DEAUTH_SNIFF, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_ATTACK_SPAM_ALL, TFT_MAGENTA); @@ -2685,12 +2684,12 @@ void MenuFunctions::RunSetup() //#ifndef HAS_ILI9341 #ifdef HAS_BT // Select Airtag on Mini - this->addNodes(&bluetoothAttackMenu, "Spoof Airtag", TFTWHITE, NULL, ATTACKS, [this](){ + this->addNodes(&bluetoothAttackMenu, "Spoof Airtag", TFTWHITE, ATTACKS, [this](){ wifiAPMenu.parentMenu = &bluetoothAttackMenu; // Clear nodes and add back button wifiAPMenu.list->clear(); - this->addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); @@ -2704,7 +2703,7 @@ void MenuFunctions::RunSetup() // Create the menu nodes for all of the list items for (int i = 0; i < menu_limit; i++) { - this->addNodes(&wifiAPMenu, airtags->get(i).mac.c_str(), TFTWHITE, NULL, BLUETOOTH, [this, i](){ + this->addNodes(&wifiAPMenu, airtags->get(i).mac.c_str(), TFTWHITE, BLUETOOTH, [this, i](){ AirTag new_at = airtags->get(i); new_at.selected = true; @@ -2730,7 +2729,7 @@ void MenuFunctions::RunSetup() }); wifiAPMenu.parentMenu = &bluetoothAttackMenu; - this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&wifiAPMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(wifiAPMenu.parentMenu, true); }); #endif @@ -2739,7 +2738,7 @@ void MenuFunctions::RunSetup() // Device menu deviceMenu.parentMenu = &mainMenu; - this->addNodes(&deviceMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&deviceMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(deviceMenu.parentMenu, true); }); @@ -2748,7 +2747,7 @@ void MenuFunctions::RunSetup() sdDeleteMenu.parentMenu = &deviceMenu; - this->addNodes(&deviceMenu, "Update Firmware", TFTORANGE, NULL, SD_UPDATE, [this]() { + this->addNodes(&deviceMenu, "Update Firmware", TFTORANGE, SD_UPDATE, [this]() { display_obj.clearScreen(); display_obj.tft.setTextWrap(false); display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3); @@ -2763,22 +2762,22 @@ void MenuFunctions::RunSetup() } #endif - this->addNodes(&deviceMenu, "Save/Load Files", TFTCYAN, NULL, SD_UPDATE, [this]() { + this->addNodes(&deviceMenu, "Save/Load Files", TFTCYAN, SD_UPDATE, [this]() { this->changeMenu(&saveFileMenu, true); }); #ifndef HAS_MINI_SCREEN - this->addNodes(&deviceMenu, "Brightness", TFTYELLOW, NULL, BRIGHTNESS, [this]() { + this->addNodes(&deviceMenu, "Brightness", TFTYELLOW, BRIGHTNESS, [this]() { this->brightnessMode(); }); #endif - this->addNodes(&deviceMenu, text_table1[17], TFTWHITE, NULL, DEVICE_INFO, [this]() { + this->addNodes(&deviceMenu, text_table1[17], TFTWHITE, DEVICE_INFO, [this]() { wifi_scan_obj.currentScanMode = SHOW_INFO; this->changeMenu(&infoMenu, true); wifi_scan_obj.RunInfo(); }); - this->addNodes(&deviceMenu, text08, TFTBLUE, NULL, SETTINGS, [this]() { + this->addNodes(&deviceMenu, text08, TFTBLUE, SETTINGS, [this]() { this->changeMenu(&settingsMenu, true); }); @@ -2787,7 +2786,7 @@ void MenuFunctions::RunSetup() sdDeleteMenu.parentMenu = &deviceMenu; - this->addNodes(&deviceMenu, "Delete SD Files", TFTCYAN, NULL, SD_UPDATE, [this]() { + this->addNodes(&deviceMenu, "Delete SD Files", TFTCYAN, SD_UPDATE, [this]() { display_obj.clearScreen(); display_obj.tft.setTextWrap(false); display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3); @@ -2804,61 +2803,61 @@ void MenuFunctions::RunSetup() // Save Files Menu saveFileMenu.parentMenu = &deviceMenu; - this->addNodes(&saveFileMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&saveFileMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(saveFileMenu.parentMenu, true); }); - this->addNodes(&saveFileMenu, "Save SSIDs", TFTCYAN, NULL, SD_UPDATE, [this]() { + this->addNodes(&saveFileMenu, "Save SSIDs", TFTCYAN, SD_UPDATE, [this]() { this->changeMenu(&saveSSIDsMenu, true); wifi_scan_obj.RunSaveSSIDList(true); }); - this->addNodes(&saveFileMenu, "Load SSIDs", TFTSKYBLUE, NULL, SD_UPDATE, [this]() { + this->addNodes(&saveFileMenu, "Load SSIDs", TFTSKYBLUE, SD_UPDATE, [this]() { this->changeMenu(&loadSSIDsMenu, true); wifi_scan_obj.RunLoadSSIDList(); }); - this->addNodes(&saveFileMenu, "Save APs", TFTNAVY, NULL, SD_UPDATE, [this]() { + this->addNodes(&saveFileMenu, "Save APs", TFTNAVY, SD_UPDATE, [this]() { this->changeMenu(&saveAPsMenu, true); wifi_scan_obj.RunSaveAPList(); }); - this->addNodes(&saveFileMenu, "Load APs", TFTBLUE, NULL, SD_UPDATE, [this]() { + this->addNodes(&saveFileMenu, "Load APs", TFTBLUE, SD_UPDATE, [this]() { this->changeMenu(&loadAPsMenu, true); wifi_scan_obj.RunLoadAPList(); }); - this->addNodes(&saveFileMenu, "Save Airtags", TFTWHITE, NULL, SD_UPDATE, [this]() { + this->addNodes(&saveFileMenu, "Save Airtags", TFTWHITE, SD_UPDATE, [this]() { this->changeMenu(&saveAPsMenu, true); wifi_scan_obj.RunSaveATList(); }); - this->addNodes(&saveFileMenu, "Load Airtags", TFTWHITE, NULL, SD_UPDATE, [this]() { + this->addNodes(&saveFileMenu, "Load Airtags", TFTWHITE, SD_UPDATE, [this]() { this->changeMenu(&loadAPsMenu, true); wifi_scan_obj.RunLoadATList(); }); saveSSIDsMenu.parentMenu = &saveFileMenu; - this->addNodes(&saveSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&saveSSIDsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(saveSSIDsMenu.parentMenu, true); }); loadSSIDsMenu.parentMenu = &saveFileMenu; - this->addNodes(&loadSSIDsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&loadSSIDsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(loadSSIDsMenu.parentMenu, true); }); saveAPsMenu.parentMenu = &saveFileMenu; - this->addNodes(&saveAPsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&saveAPsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(saveAPsMenu.parentMenu, true); }); loadAPsMenu.parentMenu = &saveFileMenu; - this->addNodes(&loadAPsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&loadAPsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(loadAPsMenu.parentMenu, true); }); saveATsMenu.parentMenu = &saveFileMenu; - this->addNodes(&saveATsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&saveATsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(saveATsMenu.parentMenu, true); }); loadATsMenu.parentMenu = &saveFileMenu; - this->addNodes(&loadATsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&loadATsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(loadATsMenu.parentMenu, true); }); @@ -2867,29 +2866,29 @@ void MenuFunctions::RunSetup() if (gps_obj.getGpsModuleStatus()) { gpsMenu.parentMenu = &mainMenu; // Main Menu is second menu parent - this->addNodes(&gpsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&gpsMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(gpsMenu.parentMenu, true); }); - this->addNodes(&gpsMenu, "GPS Data", TFTRED, NULL, GPS_MENU, [this]() { + this->addNodes(&gpsMenu, "GPS Data", TFTRED, GPS_MENU, [this]() { wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_DATA; this->changeMenu(&gpsInfoMenu, true); wifi_scan_obj.StartScan(WIFI_SCAN_GPS_DATA, TFT_CYAN); }); - this->addNodes(&gpsMenu, "NMEA Stream", TFTORANGE, NULL, GPS_MENU, [this]() { + this->addNodes(&gpsMenu, "NMEA Stream", TFTORANGE, GPS_MENU, [this]() { wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_NMEA; this->changeMenu(&gpsInfoMenu, true); wifi_scan_obj.StartScan(WIFI_SCAN_GPS_NMEA, TFT_ORANGE); }); - this->addNodes(&gpsMenu, "GPS Tracker", TFTGREEN, NULL, GPS_MENU, [this]() { + this->addNodes(&gpsMenu, "GPS Tracker", TFTGREEN, GPS_MENU, [this]() { wifi_scan_obj.currentScanMode = GPS_TRACKER; this->changeMenu(&gpsInfoMenu, true); wifi_scan_obj.StartScan(GPS_TRACKER, TFT_CYAN); }); - this->addNodes(&gpsMenu, "GPS POI", TFTCYAN, NULL, GPS_MENU, [this]() { + this->addNodes(&gpsMenu, "GPS POI", TFTCYAN, GPS_MENU, [this]() { wifi_scan_obj.StartScan(GPS_POI, TFT_CYAN); wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; this->changeMenu(&gpsPOIMenu, true); @@ -2897,12 +2896,12 @@ void MenuFunctions::RunSetup() // GPS POI Menu gpsPOIMenu.parentMenu = &gpsMenu; - this->addNodes(&gpsPOIMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&gpsPOIMenu, text09, TFTLIGHTGREY, 0, [this]() { wifi_scan_obj.currentScanMode = GPS_POI; wifi_scan_obj.StartScan(WIFI_SCAN_OFF); this->changeMenu(gpsPOIMenu.parentMenu, true); }); - this->addNodes(&gpsPOIMenu, "Mark POI", TFTCYAN, NULL, GPS_MENU, [this]() { + this->addNodes(&gpsPOIMenu, "Mark POI", TFTCYAN, GPS_MENU, [this]() { wifi_scan_obj.currentScanMode = GPS_POI; display_obj.tft.setCursor(0, TFT_HEIGHT / 2); display_obj.clearScreen(); @@ -2917,7 +2916,7 @@ void MenuFunctions::RunSetup() // GPS Info Menu gpsInfoMenu.parentMenu = &gpsMenu; - this->addNodes(&gpsInfoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&gpsInfoMenu, text09, TFTLIGHTGREY, 0, [this]() { if(wifi_scan_obj.currentScanMode != GPS_TRACKER) wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; wifi_scan_obj.StartScan(WIFI_SCAN_OFF); @@ -2929,14 +2928,14 @@ void MenuFunctions::RunSetup() // Settings menu // Device menu settingsMenu.parentMenu = &deviceMenu; - this->addNodes(&settingsMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&settingsMenu, text09, TFTLIGHTGREY, 0, [this]() { changeMenu(settingsMenu.parentMenu, true); }); for (int i = 0; i < settings_obj.getNumberSettings(); i++) { String settingName = settings_obj.setting_index_to_name(i); const char* type = this->callSetting(settingName.c_str()); if (type && strcmp(type, "bool") == 0) { - this->addNodes(&settingsMenu, settingName.c_str(), TFTLIGHTGREY, NULL, SETTINGS, [this, i, settingName]() { + this->addNodes(&settingsMenu, settingName.c_str(), TFTLIGHTGREY, SETTINGS, [this, i, settingName]() { settings_obj.toggleSetting(settingName.c_str()); this->callSetting(settingName.c_str()); this->changeMenu(&specSettingMenu, true); @@ -2954,7 +2953,7 @@ void MenuFunctions::RunSetup() // Specific setting menu specSettingMenu.parentMenu = &settingsMenu; - addNodes(&specSettingMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + addNodes(&specSettingMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(specSettingMenu.parentMenu, true); }); @@ -2963,14 +2962,14 @@ void MenuFunctions::RunSetup() // Failed update menu failedUpdateMenu.parentMenu = &deviceMenu; - this->addNodes(&failedUpdateMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&failedUpdateMenu, text09, TFTLIGHTGREY, 0, [this]() { wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; this->changeMenu(failedUpdateMenu.parentMenu, true); }); // Device info menu infoMenu.parentMenu = &deviceMenu; - this->addNodes(&infoMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&infoMenu, text09, TFTLIGHTGREY, 0, [this]() { wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; this->changeMenu(infoMenu.parentMenu, true); }); @@ -3415,12 +3414,12 @@ void MenuFunctions::buildSDFileMenu(bool update) { else sdDeleteMenu.name = "Bin Files"; - this->addNodes(&sdDeleteMenu, text09, TFTLIGHTGREY, NULL, 0, [this]() { + this->addNodes(&sdDeleteMenu, text09, TFTLIGHTGREY, 0, [this]() { this->changeMenu(sdDeleteMenu.parentMenu, true); }); if (!update) { - this->addNodes(&sdDeleteMenu, "Delete Selected", TFTORANGE, NULL, 0, [this]() { + this->addNodes(&sdDeleteMenu, "Delete Selected", TFTORANGE, 0, [this]() { for (int x = 0; x < sd_obj.sd_files->size(); x++) { if (current_menu->list->get(x + 2).selected) { if (sd_obj.removeFile("/" + sd_obj.sd_files->get(x))) { @@ -3440,7 +3439,7 @@ void MenuFunctions::buildSDFileMenu(bool update) { if (!update) { for (int x = 0; x < sd_obj.sd_files->size(); x++) { - this->addNodes(&sdDeleteMenu, sd_obj.sd_files->get(x).c_str(), TFTCYAN, NULL, SD_UPDATE, [this, x]() { + this->addNodes(&sdDeleteMenu, sd_obj.sd_files->get(x).c_str(), TFTCYAN, SD_UPDATE, [this, x]() { // Change selection status of menu node MenuNode new_node = current_menu->list->get(x + 2); new_node.selected = !current_menu->list->get(x + 2).selected; @@ -3450,7 +3449,7 @@ void MenuFunctions::buildSDFileMenu(bool update) { } else { for (int x = 0; x < sd_obj.sd_files->size(); x++) { - this->addNodes(&sdDeleteMenu, sd_obj.sd_files->get(x).c_str(), TFTCYAN, NULL, SD_UPDATE, [this, x]() { + this->addNodes(&sdDeleteMenu, sd_obj.sd_files->get(x).c_str(), TFTCYAN, SD_UPDATE, [this, x]() { wifi_scan_obj.currentScanMode = OTA_UPDATE; this->changeMenu(&failedUpdateMenu, true); sd_obj.runUpdate("/" + sd_obj.sd_files->get(x)); @@ -3461,7 +3460,7 @@ void MenuFunctions::buildSDFileMenu(bool update) { // Function to add MenuNodes to a menu -void MenuFunctions::addNodes(Menu * menu, const char* name, uint8_t color, Menu * child, int place, std::function callable, bool selected) +void MenuFunctions::addNodes(Menu * menu, const char* name, uint8_t color, int place, std::function callable, bool selected) { //Serial.println("Building node: " + name); menu->list->add(MenuNode{String(name), false, color, place, selected, callable}); diff --git a/esp32_marauder/MenuFunctions.h b/esp32_marauder/MenuFunctions.h index c614333..47d59de 100644 --- a/esp32_marauder/MenuFunctions.h +++ b/esp32_marauder/MenuFunctions.h @@ -218,7 +218,7 @@ class MenuFunctions void drawGraph(int16_t *values); void drawGraphSmall(uint8_t *values); void renderGraphUI(uint8_t scan_mode = 0); - void addNodes(Menu* menu, const char* name, uint8_t color, Menu* child, int place, std::function callable, bool selected = false); + void addNodes(Menu* menu, const char* name, uint8_t color, int place, std::function callable, bool selected = false); void battery(bool initial = false); void battery2(bool initial = false); const char* callSetting(const char* key); diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 87abb98..22c0b0b 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -9867,6 +9867,282 @@ uint16_t WiFiScan::rssiToColor(int8_t rssi) { return TFT_RED; } +// Upload one log file to WDG Wars. +// Mirrors backendUpload() but uses X-API-Key auth and wdgwars.pl endpoint. +/*bool WiFiScan::wdgwarsUpload(String filePath) { + //display.clearScreen(); + //display.drawCenteredText("WDG Upload...", true); + delay(100); + + if (!SD.exists(filePath)) { + //display.drawCenteredText(filePath + " not found", true); + Serial.println("[WDG] File not found: " + filePath); + return false; + } + + String apiKey = settings_obj.loadSetting(WDG_KEY_NAME); + if (apiKey.isEmpty()) { + //display.clearScreen(); + //display.drawCenteredText("No WDG API key", true); + Serial.println("[WDG] No WDG Wars API key configured"); + return false; + } + + File fileToUpload = SD.open(filePath); + if (!fileToUpload) { + //display.clearScreen(); + //display.drawCenteredText("Could not open file", true); + Serial.println("[WDG] Could not open: " + filePath); + return false; + } + + // Build multipart body + String boundary = "----ESP32BOUNDARY"; + String part1 = "--" + boundary + "\r\n"; + part1 += "Content-Disposition: form-data; name=\"file\"; filename=\"" + + filePath + "\"\r\n"; + part1 += "Content-Type: application/octet-stream\r\n\r\n"; + String part2 = "\r\n--" + boundary + "--\r\n"; + int totalLength = part1.length() + fileToUpload.size() + part2.length(); + + Serial.println("[WDG] File size: " + String(fileToUpload.size())); + Serial.println("[WDG] Total length: " + String(totalLength)); + + client->setInsecure(); + if (!client->connect("wdgwars.pl", 443)) { + fileToUpload.close(); + client->stop(); + //display.clearScreen(); + //display.drawCenteredText("WDG connect fail", true); + Serial.println("[WDG] Failed to connect to wdgwars.pl"); + return false; + } + + // HTTP request + client->println("POST /api/v2/upload-csv HTTP/1.1"); + client->println("Host: wdgwars.pl"); + client->println("User-Agent: ESP32Uploader/1.0"); + client->println("Accept: application/json"); + client->println("X-API-Key: " + apiKey); + client->println("Content-Type: multipart/form-data; boundary=" + boundary); + client->print("Content-Length: "); + client->println(totalLength); + client->println(); + + // Send body + client->print(part1); + + const size_t CHUNK = 4096; + uint8_t buf[CHUNK]; + size_t totalSent = 0; + uint8_t pct = 0; + String pctStr; + + while (fileToUpload.available()) { + size_t n = fileToUpload.read(buf, CHUNK); + totalSent += n; + client->write(buf, n); + pct = (totalSent * 100) / fileToUpload.size(); + //display.tft->drawRect(0, (TFT_HEIGHT / 3) * 2, TFT_WIDTH, TFT_HEIGHT - (TFT_HEIGHT / 3) * 2, ST77XX_BLACK); + //display.tft->setCursor(0, (TFT_HEIGHT / 3) * 2); + pctStr = String(pct) + "%"; + //display.drawCenteredText(pctStr, false); + } + + client->print(part2); + fileToUpload.close(); + + Serial.println("[WDG] Bytes sent: " + String(totalSent)); + + // Read response + String response; + unsigned long t = millis(); + while (millis() - t < 5000) { + while (client->available()) { + char c = client->read(); + response += c; + } + if (!client->connected() && !client->available()) + break; + } + client->stop(); + + // Capture first 200 chars of response for log viewer + String respTrunc = response.length() > 200 ? response.substring(0, 200) : response; + Serial.println("[WDG] Response: " + respTrunc); + + // WDG Wars returns 200 on success + bool ok = response.indexOf("202 Accepted") >= 0 || + response.indexOf("\"ok\":true") >= 0; + + //display.clearScreen(); + //display.drawCenteredText(ok ? "WDG OK" : "WDG Failed", true); + delay(1000); + + return ok; +}*/ + +// Upload one log file to Wigle +/*bool WiFiScan::wigleUpload(String filePath) { + //server.begin(); + + //display.clearScreen(); + //display.drawCenteredText("Wigle Upload...", true); + + delay(100); + + if (!SD.exists(filePath)) { + //display.clearScreen(); + //display.drawCenteredText(filePath + " not found", true); + Serial.println("File does not exist: " + filePath); + return false; + } + + File fileToUpload = SD.open(filePath); + if (!fileToUpload) { + //display.clearScreen(); + //display.drawCenteredText("Could not open file", true); + Serial.println("Could not open file: " + filePath); + return false; + } + + // Load credentials + String username = settings_obj.loadSetting("wu"); + String token = settings_obj.loadSetting("wt"); + if (username.isEmpty() || token.isEmpty()) { + fileToUpload.close(); + //display.clearScreen(); + //display.drawCenteredText("No wigle creds", true); + Serial.println("Missing wigle credentials"); + return false; + } + + Serial.println("Username: " + username); + Serial.println("Token: " + token); + + String boundary = "----ESP32BOUNDARY"; + String contentType = "multipart/form-data; boundary=" + boundary; + + // Build parts + String part1 = "--" + boundary + "\r\n"; + part1 += "Content-Disposition: form-data; name=\"file\"; filename=\"" + filePath + "\"\r\n"; + part1 += "Content-Type: application/octet-stream\r\n\r\n"; + + String part2 = "\r\n--" + boundary + "\r\n"; + part2 += "Content-Disposition: form-data; name=\"donate\"\r\n\r\non\r\n"; + + String part3 = "--" + boundary + "--\r\n"; + + int totalLength = part1.length() + fileToUpload.size() + part2.length() + part3.length(); + + Serial.println("part1.length(): " + String(part1.length())); + Serial.println("fileToUpload.size(): " + String(fileToUpload.size())); + Serial.println("part2.length(): " + String(part2.length())); + Serial.println("part3.length(): " + String(part3.length())); + Serial.println("Total Content-Length: " + String(totalLength)); + + Serial.print("File size: "); + Serial.println(fileToUpload.size()); + + // Connect manually via WiFiClientSecure + //WiFiClientSecure *client = new WiFiClientSecure(); + //client.stop(); + client->setInsecure(); + + if (!client->connect("api.wigle.net", 443)) { + fileToUpload.close(); + //delete client; + client->stop(); + //display.clearScreen(); + //display.drawCenteredText("Could not connect", true); + Serial.println("Failed to connected to api.wigle.net"); + return false; + } + + Serial.println("Connected"); + + // Compose headers + String auth = base64Encode(username + ":" + token); + + Serial.println("Finished encoding"); + + client->println("POST /api/v2/file/upload HTTP/1.1"); + client->println("Host: api.wigle.net"); + client->println("User-Agent: ESP32Uploader/1.0"); + client->println("Accept: application/json"); + client->println("Authorization: Basic " + auth); + client->println("Content-Type: " + contentType); + client->print("Content-Length: "); + client->println(totalLength); + client->println(); + delay(100); + + Serial.println("Finished sending header"); + + // Send body + client->print(part1); + const size_t BUFFER_SIZE = 4096; // 1KB at a time + uint8_t buffer[BUFFER_SIZE]; + + Serial.println("Finished sending part1"); + + uint8_t percent_sent = 0; + + String display_percent = ""; + + size_t totalBytesSent = 0; + while (fileToUpload.available()) { + size_t bytesRead = fileToUpload.read(buffer, BUFFER_SIZE); + totalBytesSent += bytesRead; + Serial.print("Writing "); + Serial.print(totalBytesSent); + Serial.println(" bytes..."); + percent_sent = (totalBytesSent * 100) / fileToUpload.size(); + //display.tft->drawRect(0, (TFT_HEIGHT / 3) * 2, TFT_WIDTH, TFT_HEIGHT, ST77XX_BLACK); + //display.tft->setCursor(0, (TFT_HEIGHT / 3) * 2); + display_percent = (String)percent_sent + "%"; + //display.drawCenteredText(display_percent, false); + client->write(buffer, bytesRead); + } + + Serial.println("Uploaded file bytes: " + String(totalBytesSent)); + + client->print(part2); + client->print(part3); + + Serial.println("Finished sending part2 and part3"); + + fileToUpload.close(); + + + // Read response + String response; + unsigned long timeout = millis(); + while (millis() - timeout < 5000) { + while (client->available()) { + char c = client->read(); + response += c; + } + } + + if (millis() - timeout > 5000) + Serial.println("Timeout reached"); + if (!client->connected()) + Serial.println("Client disconnected"); + + client->stop(); + + String respTrunc = response.length() > 200 ? response.substring(0, 200) : response; + Serial.println("[WIGLE] Response: " + respTrunc); + + bool ok = response.indexOf("200 OK") >= 0; + + //display.clearScreen(); + //display.drawCenteredText(ok ? "WIGLE OK" : "WIGLE Failed", true); + + return ok; +}*/ + // Function for updating scan status void WiFiScan::main(uint32_t currentTime) { diff --git a/esp32_marauder/WiFiScan.h b/esp32_marauder/WiFiScan.h index c501e5a..f60bcfb 100644 --- a/esp32_marauder/WiFiScan.h +++ b/esp32_marauder/WiFiScan.h @@ -68,6 +68,9 @@ #include "LedInterface.h" #endif +//#include +//#include "mbedtls/sha256.h" + #define bad_list_length 3 #define OTA_UPDATE 100 @@ -300,6 +303,8 @@ class WiFiScan // Settings uint mac_history_cursor = 0; uint8_t channel_hop_delay = 1; + + //WiFiClientSecure *client = new WiFiClientSecure(); int x_pos; //position along the graph x axis float y_pos_x; //current graph y axis position of X value @@ -585,6 +590,9 @@ class WiFiScan NimBLEAdvertisementData GetUniversalAdvertisementData(EBLEPayloadType type); #endif + bool wigleUpload(String filePath); + bool wdgwarsUpload(String filePath); + void throwThatShitInACircle(); void displayTargetFilter(); void displayTransmitRate(); diff --git a/esp32_marauder/settings.h b/esp32_marauder/settings.h index bbd7d81..6f3557d 100644 --- a/esp32_marauder/settings.h +++ b/esp32_marauder/settings.h @@ -17,6 +17,8 @@ extern Display display_obj; #endif +#define WDG_KEY_NAME "wdg_key" // WDG Wars API key (String) + class Settings { private: diff --git a/esp32_marauder/utils.h b/esp32_marauder/utils.h index e4f4bca..9265b41 100644 --- a/esp32_marauder/utils.h +++ b/esp32_marauder/utils.h @@ -9,6 +9,7 @@ #include "configs.h" #include "esp_heap_caps.h" +#include "mbedtls/base64.h" struct mac_addr { unsigned char bytes[6]; @@ -256,4 +257,12 @@ inline uint16_t getNextPort(uint16_t port) { return port + 1; } +String base64Encode(const String& input) { + size_t outputLen; + unsigned char output[256]; + mbedtls_base64_encode(output, sizeof(output), &outputLen, + (const unsigned char*)input.c_str(), input.length()); + return String((char*)output).substring(0, outputLen); +} + #endif \ No newline at end of file