From 7ac6b9761440062ac86b1fc86b6955c5c5f3cc56 Mon Sep 17 00:00:00 2001 From: Pirata Date: Wed, 11 Dec 2024 01:51:54 -0300 Subject: [PATCH] displaySomething function and brightness settings rf.cpp will come in the next commit --- src/core/display.cpp | 17 +++++++++++++++-- src/core/display.h | 10 +++++----- src/core/wifi_common.cpp | 2 +- src/modules/ble/bad_ble.cpp | 14 +++++--------- src/modules/ble/ble_common.cpp | 2 +- src/modules/ble/ble_spam.cpp | 10 +++++----- src/modules/fm/fm.cpp | 15 ++++++--------- src/modules/gps/gps_tracker.cpp | 2 +- src/modules/gps/wardriving.cpp | 2 +- src/modules/ir/TV-B-Gone.cpp | 6 +++--- src/modules/ir/custom_ir.cpp | 20 ++++++++++---------- src/modules/others/bad_usb.cpp | 11 ++++------- src/modules/pwnagotchi/spam.cpp | 2 +- src/modules/wifi/ap_info.cpp | 2 +- src/modules/wifi/clients.cpp | 2 +- src/modules/wifi/evil_portal.cpp | 2 +- src/modules/wifi/scan_hosts.cpp | 2 +- src/modules/wifi/sniffer.cpp | 2 +- src/modules/wifi/wifi_atks.cpp | 10 +++++----- 19 files changed, 68 insertions(+), 65 deletions(-) diff --git a/src/core/display.cpp b/src/core/display.cpp index 28c6102e5..a3b97f573 100644 --- a/src/core/display.cpp +++ b/src/core/display.cpp @@ -150,6 +150,18 @@ void displaySuccess(String txt, bool waitKeyPress) { while(waitKeyPress && !checkAnyKeyPress()) delay(100); } +void displaySomething(String txt, bool waitKeyPress) { + #ifndef HAS_SCREEN + Serial.println("MESSAGE: " + txt); + return; + #endif + // todo: add newlines to txt if too long + displayRedStripe(txt, getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + delay(200); + while(waitKeyPress && !checkAnyKeyPress()) delay(100); +} + + void setPadCursor(int16_t padx, int16_t pady) { for (int y=0; y& options, bool bright, bool submenu, String if(submenu) drawSubmenu(index, options, subText); else coord=drawOptions(index, options, bruceConfig.priColor, bruceConfig.bgColor); if(bright){ - if(index!=5) setBrightness(String(options[index].label.c_str()).toInt(),false); - else setBrightness(bruceConfig.bright,false); + uint8_t bv = String(options[index].label.c_str()).toInt(); // Grabs the int value from menu option + if(bv>0) setBrightness(bv,false); // If valid, apply brightnes + else setBrightness(bruceConfig.bright,false); // if "Main Menu", bv==0, return brightness to default } redraw=false; delay(REDRAW_DELAY); diff --git a/src/core/display.h b/src/core/display.h index 90766d386..6d94e82a5 100644 --- a/src/core/display.h +++ b/src/core/display.h @@ -32,11 +32,11 @@ void setTftDisplay(int x = 0, int y = 0, uint16_t fc = tft.textcolor, int size = void displayRedStripe(String text, uint16_t fgcolor = TFT_WHITE, uint16_t bgcolor = TFT_RED); -void displayError(String txt, bool waitKeyPress = false); // Faixa vermelha -void displayWarning(String txt, bool waitKeyPress = false);// Faixa amarela -void displayInfo(String txt, bool waitKeyPress = false); // Faixa Azul -void displaySuccess(String txt, bool waitKeyPress = false);// Faixa Verde - +void displayError(String txt, bool waitKeyPress = false); // Red Stripe +void displayWarning(String txt, bool waitKeyPress = false); // Yellow Stripe +void displayInfo(String txt, bool waitKeyPress = false); // Blue Stripe +void displaySuccess(String txt, bool waitKeyPress = false); // Green Strupe +void displaySomething(String txt, bool waitKeyPress = false); // UI Colored stripe void setPadCursor(int16_t padx=1, int16_t pady=0); void padprintf(int16_t padx, const char *format, ...); diff --git a/src/core/wifi_common.cpp b/src/core/wifi_common.cpp index 4d7431fc8..48ff78954 100644 --- a/src/core/wifi_common.cpp +++ b/src/core/wifi_common.cpp @@ -107,7 +107,7 @@ bool wifiConnectMenu(wifi_mode_t mode) case WIFI_STA: // station mode int nets; WiFi.mode(WIFI_MODE_STA); - displayRedStripe("Scanning..", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Scanning.."); nets = WiFi.scanNetworks(); options = {}; for (int i = 0; i < nets; i++) { diff --git a/src/modules/ble/bad_ble.cpp b/src/modules/ble/bad_ble.cpp index 9492c9c31..88c62c731 100644 --- a/src/modules/ble/bad_ble.cpp +++ b/src/modules/ble/bad_ble.cpp @@ -284,23 +284,19 @@ void ble_setup() { if (!kbChosen_ble) Kble.begin(); // starts the KeyboardLayout_en_US as default if nothing had beed chosen (cancel selection) Ask_for_restart=1; // arm the flag first_time=false; - displayRedStripe("Waiting Victim",getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Waiting Victim"); } while (!Kble.isConnected() && !checkEscPress()); if(Kble.isConnected()) { BLEConnected=true; - displayRedStripe("Preparing",getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Preparing"); delay(1000); displayWarning(String(BTN_ALIAS) + " to deploy", true); delay(200); key_input_ble(*fs, bad_script); - displayRedStripe("Payload Sent",getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); - checkSelPress(); - while (!checkSelPress()) { - // nothing here, just to hold the screen press Ok of M5. - } + displaySomething("Payload Sent",true); if(returnToMenu) goto End; // when cancel the run in the middle, go to End to turn off BLE services // Try to run a new script on the same device @@ -321,7 +317,7 @@ void ble_MediaCommands() { if(!Kble.isConnected()) Kble.begin(); - displayRedStripe("Pairing...",getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Pairing..."); while (!Kble.isConnected() && !checkEscPress()); @@ -380,7 +376,7 @@ void ble_keyboard() { if (!kbChosen_ble) Kble.begin(); // starts the KeyboardLayout_en_US as default if nothing had beed chosen (cancel selection) Ask_for_restart=1; Reconnect: - displayRedStripe("Pair to start",getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Pair to start"); while (!Kble.isConnected() && !checkEscPress()); // loop to wait for the connection callback or ESC diff --git a/src/modules/ble/ble_common.cpp b/src/modules/ble/ble_common.cpp index e2ff0c531..2b754f685 100644 --- a/src/modules/ble/ble_common.cpp +++ b/src/modules/ble/ble_common.cpp @@ -107,7 +107,7 @@ void ble_scan_setup() void ble_scan() { - displayRedStripe("Scanning..", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Scanning.."); options = { }; ble_scan_setup(); diff --git a/src/modules/ble/ble_spam.cpp b/src/modules/ble/ble_spam.cpp index 2bf589723..582f43db0 100644 --- a/src/modules/ble/ble_spam.cpp +++ b/src/modules/ble/ble_spam.cpp @@ -451,23 +451,23 @@ void aj_adv(int ble_choice){ switch(ble_choice){ case 0: // Applejuice - displayRedStripe("iOS Spam (" + String(count) + ")",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("iOS Spam (" + String(count) + ")"); executeSpam(Apple); break; case 1: // SwiftPair - displayRedStripe("SwiftPair (" + String(count) + ")",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("SwiftPair (" + String(count) + ")"); executeSpam(Microsoft); break; case 2: // Samsung - displayRedStripe("Samsung (" + String(count) + ")",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Samsung (" + String(count) + ")"); executeSpam(Samsung); break; case 3: // Android - displayRedStripe("Android (" + String(count) + ")",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Android (" + String(count) + ")"); executeSpam(Google); break; case 4: // Tutti-frutti - displayRedStripe("Spam All (" + String(count) + ")",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Spam All (" + String(count) + ")"); if(mael == 0) executeSpam(Google); if(mael == 1) executeSpam(Samsung); if(mael == 2) executeSpam(Microsoft); diff --git a/src/modules/fm/fm.cpp b/src/modules/fm/fm.cpp index 722ef45e3..3e7286c89 100644 --- a/src/modules/fm/fm.cpp +++ b/src/modules/fm/fm.cpp @@ -35,7 +35,7 @@ uint16_t fm_scan() { min_noise = radio.currNoiseLevel; tft.fillScreen(bruceConfig.bgColor); - displayRedStripe("Scanning...", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Scanning..."); for (f=8750; f<10800; f+=10) { Serial.print("Measuring "); Serial.print(f); Serial.print("..."); radio.readTuneMeasure(f); @@ -51,7 +51,7 @@ uint16_t fm_scan() { sprintf(display_freq, "Found %d MHz", freq_candidate); tft.fillScreen(bruceConfig.bgColor); - displayRedStripe(display_freq, getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething(display_freq); while(!checkEscPress() && !checkSelPress()) { delay(100); } @@ -64,7 +64,7 @@ void fm_options_frq(uint16_t f_min, bool reserved) { char f_str[5]; uint16_t f_max; // Choose between scan for best freq or select freq - displayRedStripe("Choose frequency", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Choose frequency"); delay(1000); // Handle min / max frequency @@ -96,7 +96,7 @@ void fm_options_digit(uint16_t f_min, bool reserved) { char f_str[5]; uint16_t f_max; // Choose between scan for best freq or select freq - displayRedStripe("Choose digit", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Choose digit"); delay(1000); // Handle min / max frequency @@ -133,7 +133,7 @@ void fm_options_digit(uint16_t f_min, bool reserved) { void fm_options(uint16_t f_min, uint16_t f_max, bool reserved) { char f_str[5]; // Choose between scan for best freq or select freq - displayRedStripe("Choose tens", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Choose tens"); delay(1000); options = { }; @@ -229,10 +229,7 @@ bool fm_begin() { if (!radio.begin()) { // begin with address 0x63 (CS high default) tft.fillScreen(bruceConfig.bgColor); Serial.println("Cannot find radio"); - displayRedStripe("Cannot find radio", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); - while(!checkEscPress() && !checkSelPress()) { - delay(100); - } + displaySomething("Cannot find radio",true); return false; } diff --git a/src/modules/gps/gps_tracker.cpp b/src/modules/gps/gps_tracker.cpp index 8a0f8e6ad..20f12844b 100644 --- a/src/modules/gps/gps_tracker.cpp +++ b/src/modules/gps/gps_tracker.cpp @@ -45,7 +45,7 @@ bool GPSTracker::begin_gps() { end(); return false; } - displayRedStripe("Waiting GPS: " + String(count)+ "s", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Waiting GPS: " + String(count)+ "s"); count++; delay(1000); } diff --git a/src/modules/gps/wardriving.cpp b/src/modules/gps/wardriving.cpp index a3baa9365..d82a6bdde 100644 --- a/src/modules/gps/wardriving.cpp +++ b/src/modules/gps/wardriving.cpp @@ -51,7 +51,7 @@ bool Wardriving::begin_gps() { end(); return false; } - displayRedStripe("Waiting GPS: " + String(count)+ "s", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Waiting GPS: " + String(count)+ "s"); count++; delay(1000); } diff --git a/src/modules/ir/TV-B-Gone.cpp b/src/modules/ir/TV-B-Gone.cpp index 857dcdbbf..8b0eb57fe 100644 --- a/src/modules/ir/TV-B-Gone.cpp +++ b/src/modules/ir/TV-B-Gone.cpp @@ -169,7 +169,7 @@ void StartTvBGone() { if (checkSelPress()) // Pause TV-B-Gone { while (checkSelPress()) yield(); - displayRedStripe("Paused", getComplementaryColor2(bruceConfig.priColor), bruceConfig.bgColor); + displaySomething("Paused"); while (!checkSelPress()){ // If Presses Select again, continues if(checkEscPress()) { @@ -181,7 +181,7 @@ void StartTvBGone() { yield(); } if (endingEarly) break; // Cancels TV-B-Gone - displayRedStripe("Running, Wait", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Running, Wait"); } } //end of POWER code for loop @@ -189,7 +189,7 @@ void StartTvBGone() { if (endingEarly==false) { - displayRedStripe("All codes sent!", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("All codes sent!"); //pause for ~1.3 sec, then flash the visible LED 8 times to indicate that we're done delay_ten_us(MAX_WAIT_TIME); // wait 655.350ms delay_ten_us(MAX_WAIT_TIME); // wait 655.350ms diff --git a/src/modules/ir/custom_ir.cpp b/src/modules/ir/custom_ir.cpp index cc720fef1..56dd6f4bf 100644 --- a/src/modules/ir/custom_ir.cpp +++ b/src/modules/ir/custom_ir.cpp @@ -199,7 +199,7 @@ bool txIrFile(FS *fs, String filepath) { if (checkSelPress()) // Pause TV-B-Gone { while (checkSelPress()) yield(); - displayRedStripe("Paused", getComplementaryColor2(bruceConfig.priColor), bruceConfig.bgColor); + displaySomething("Paused"); while (!checkSelPress()){ // If Presses Select again, continues if(checkEscPress()) { @@ -211,7 +211,7 @@ bool txIrFile(FS *fs, String filepath) { yield(); } if (endingEarly) break; // Cancels custom IR Spam - displayRedStripe("Running, Wait", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Running, Wait"); } } // end while file has lines to process databaseFile.close(); @@ -350,7 +350,7 @@ void otherIRcodes() { void sendNECCommand(String address, String command) { IRsend irsend(bruceConfig.irTx); // Set the GPIO to be used to sending the message. irsend.begin(); - displayRedStripe("Sending..",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Sending.."); uint8_t first_zero_byte_pos = address.indexOf("00", 2); if(first_zero_byte_pos!=-1) address = address.substring(0, first_zero_byte_pos); first_zero_byte_pos = command.indexOf("00", 2); @@ -367,7 +367,7 @@ void sendNECCommand(String address, String command) { void sendRC5Command(String address, String command) { IRsend irsend(bruceConfig.irTx,true); // Set the GPIO to be used to sending the message. irsend.begin(); - displayRedStripe("Sending..",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Sending.."); uint8_t addressValue = strtoul(address.substring(0,2).c_str(), nullptr, 16); uint8_t commandValue = strtoul(command.substring(0,2).c_str(), nullptr, 16); uint16_t data = irsend.encodeRC5(addressValue, commandValue); @@ -379,7 +379,7 @@ void sendRC5Command(String address, String command) { void sendRC6Command(String address, String command) { IRsend irsend(bruceConfig.irTx,true); // Set the GPIO to be used to sending the message. irsend.begin(); - displayRedStripe("Sending..",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Sending.."); uint32_t addressValue = strtoul(address.c_str(), nullptr, 16); uint32_t commandValue = strtoul(command.c_str(), nullptr, 16); uint64_t data = irsend.encodeRC6(addressValue, commandValue); @@ -391,7 +391,7 @@ void sendRC6Command(String address, String command) { void sendSamsungCommand(String address, String command) { IRsend irsend(bruceConfig.irTx); // Set the GPIO to be used to sending the message. irsend.begin(); - displayRedStripe("Sending..",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Sending.."); //uint64_t data = ((uint64_t)strtoul(address.c_str(), nullptr, 16) << 32) | strtoul(command.c_str(), nullptr, 16); uint32_t addressValue = strtoul(address.c_str(), nullptr, 16); uint32_t commandValue = strtoul(command.c_str(), nullptr, 16); @@ -406,7 +406,7 @@ void sendSamsungCommand(String address, String command) { void sendSonyCommand(String address, String command) { IRsend irsend(bruceConfig.irTx); // Set the GPIO to be used to sending the message. irsend.begin(); - displayRedStripe("Sending..",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Sending.."); uint16_t commandValue = strtoul(command.substring(0,2).c_str(), nullptr, 16); uint16_t addressValue = strtoul(address.substring(0,2).c_str(), nullptr, 16); uint16_t addressValue2 = strtoul(address.substring(3,6).c_str(), nullptr, 16); @@ -422,7 +422,7 @@ void sendSonyCommand(String address, String command) { void sendPanasonicCommand(String address, String command) { IRsend irsend(bruceConfig.irTx); // Set the GPIO to be used to sending the message. irsend.begin(); - displayRedStripe("Sending..",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Sending.."); uint8_t first_zero_byte_pos = address.indexOf("00", 2); if(first_zero_byte_pos!=-1) address = address.substring(0, first_zero_byte_pos); // needs to invert endianess @@ -455,7 +455,7 @@ bool sendDecodedCommand(String protocol, String value, String bits) { IRsend irsend(bruceConfig.irTx); // Set the GPIO to be used to sending the message. irsend.begin(); bool success = false; - displayRedStripe("Sending..",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Sending.."); if(hasACState(type)) { // need to send the state (still passed from value) @@ -488,7 +488,7 @@ bool sendDecodedCommand(String protocol, String value, String bits) { void sendRawCommand(uint16_t frequency, String rawData) { IRsend irsend(bruceConfig.irTx); // Set the GPIO to be used to sending the message. irsend.begin(); - displayRedStripe("Sending..",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Sending.."); uint16_t dataBuffer[SAFE_STACK_BUFFER_SIZE/2]; // MEMO: stack overflow with full buffer size uint16_t count = 0; diff --git a/src/modules/others/bad_usb.cpp b/src/modules/others/bad_usb.cpp index 989e685c4..a73e28abb 100644 --- a/src/modules/others/bad_usb.cpp +++ b/src/modules/others/bad_usb.cpp @@ -298,7 +298,7 @@ void usb_setup() { mySerial.write(0x00); while(mySerial.available()<=0) { if(mySerial.available()<=0) { - displayRedStripe("CH9329 -> USB",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("CH9329 -> USB"); delay(200); mySerial.write(0x00); } else break; @@ -309,7 +309,7 @@ void usb_setup() { } #endif - displayRedStripe("Preparing",getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); // Time to Computer or device recognize the USB HID + displaySomething("Preparing"); // Time to Computer or device recognize the USB HID delay(2000); first_time=false; } @@ -317,11 +317,8 @@ void usb_setup() { delay(200); key_input(*fs, bad_script); - displayRedStripe("Payload Sent",getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); - checkSelPress(); - while (!checkSelPress()) { - // nothing here, just to hold the screen press Ok of M5. - } + displaySomething("Payload Sent",true); + if(returnToMenu) return; // Try to run a new script on the same device goto NewScript; diff --git a/src/modules/pwnagotchi/spam.cpp b/src/modules/pwnagotchi/spam.cpp index 46e150bd6..e77f47a6b 100644 --- a/src/modules/pwnagotchi/spam.cpp +++ b/src/modules/pwnagotchi/spam.cpp @@ -347,7 +347,7 @@ void send_pwnagotchi_beacon_main() { // Check if file was loaded if (num_faces == 0 or num_names == 0) { - displayRedStripe("No config file", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("No config file"); delay(1000); return; } diff --git a/src/modules/wifi/ap_info.cpp b/src/modules/wifi/ap_info.cpp index 6ebbd76c5..13249d24f 100644 --- a/src/modules/wifi/ap_info.cpp +++ b/src/modules/wifi/ap_info.cpp @@ -126,7 +126,7 @@ void fillInfo(ScrollableTextArea& area){ const auto mac = MAC(ap_info.bssid); - displayRedStripe("Gathering...",getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething("Gathering..."); // in promiscius mode also Rx/Tx can be gathered // organized in the most to least usable diff --git a/src/modules/wifi/clients.cpp b/src/modules/wifi/clients.cpp index ce4f5cc91..d5c202e3f 100644 --- a/src/modules/wifi/clients.cpp +++ b/src/modules/wifi/clients.cpp @@ -348,7 +348,7 @@ void telnet_loop() { Serial.println("Connected to TELNET server"); tft.setTextColor(TFT_GREEN, bruceConfig.bgColor); - displayRedStripe("Connected to TELNET server", getComplementaryColor2(bruceConfig.priColor), TFT_DARKGREEN ); + displaySomething("Connected to TELNET server"); tft.setTextColor(bruceConfig.priColor, bruceConfig.bgColor); delay(2000); tft.fillScreen(bruceConfig.bgColor); diff --git a/src/modules/wifi/evil_portal.cpp b/src/modules/wifi/evil_portal.cpp index 9adee5176..a5fda5a4b 100644 --- a/src/modules/wifi/evil_portal.cpp +++ b/src/modules/wifi/evil_portal.cpp @@ -59,7 +59,7 @@ bool EvilPortal::setup() { void EvilPortal::beginAP() { drawMainBorderWithTitle("EVIL PORTAL"); - displayRedStripe("Starting...", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Starting..."); WiFi.mode(WIFI_MODE_AP); WiFi.softAPConfig(apGateway, apGateway, IPAddress(255, 255, 255, 0)); diff --git a/src/modules/wifi/scan_hosts.cpp b/src/modules/wifi/scan_hosts.cpp index 331d7f430..64446e2c0 100644 --- a/src/modules/wifi/scan_hosts.cpp +++ b/src/modules/wifi/scan_hosts.cpp @@ -46,7 +46,7 @@ void local_scan_setup() { struct netif *net_iface = (struct netif *)netif; etharp_cleanup_netif(net_iface); // to avoid gateway duplication - displayRedStripe("Probing " + String(broadcast - networkAddress - 1) + " hosts",getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); // minus broadcast and subnet mask + displaySomething("Probing " + String(broadcast - networkAddress - 1) + " hosts"); // minus broadcast and subnet mask // send arp requests, read table each ARP_TABLE_SIZE requests uint16_t tableReadCounter = 0; diff --git a/src/modules/wifi/sniffer.cpp b/src/modules/wifi/sniffer.cpp index 3a76b05de..6687c5f1c 100644 --- a/src/modules/wifi/sniffer.cpp +++ b/src/modules/wifi/sniffer.cpp @@ -339,7 +339,7 @@ void sniffer_setup() { else Fs = &LittleFS; // if not, use the internal memory. openFile(*Fs); - displayRedStripe("Sniffing Started", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor ); + displaySomething("Sniffing Started"); tft.setTextSize(FP); tft.setCursor(80, 100); int redraw = true; diff --git a/src/modules/wifi/wifi_atks.cpp b/src/modules/wifi/wifi_atks.cpp index b21713b74..90c9f39cf 100644 --- a/src/modules/wifi/wifi_atks.cpp +++ b/src/modules/wifi/wifi_atks.cpp @@ -119,7 +119,7 @@ void wifi_atk_menu() { int nets; WiFi.mode(WIFI_MODE_STA); - displayRedStripe("Scanning..", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Scanning.."); nets = WiFi.scanNetworks(); ap_records.clear(); options = {}; @@ -163,7 +163,7 @@ void deauthFloodAttack() int nets; WiFi.mode(WIFI_AP); ScanNets: - displayRedStripe("Scanning..", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Scanning.."); nets = WiFi.scanNetworks(); ap_records.clear(); for (int i = 0; i < nets; i++) @@ -301,7 +301,7 @@ void target_atk(String tssid, String mac, uint8_t channel) // Pause attack if (checkSelPress()) { - displayRedStripe("Deauth Paused", getComplementaryColor2(bruceConfig.priColor), bruceConfig.priColor); + displaySomething("Deauth Paused"); while (checkSelPress()) { delay(50); @@ -572,10 +572,10 @@ void beaconAttack() wifiConnected = true; // display wifi icon // drawMainMenu(0); - displayRedStripe(txt, getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething(txt); while (1) { - displayRedStripe(String(txt), getComplementaryColor2(bruceConfig.priColor),bruceConfig.priColor); + displaySomething(String(txt)); delay(200); if (BeaconMode == 0) {