Merge pull request #365 from justcallmekoko/develop

Develop
This commit is contained in:
Just Call Me Koko
2023-10-26 10:33:52 -04:00
committed by GitHub
9 changed files with 166 additions and 73 deletions
@@ -3,6 +3,7 @@
- Header Pin x8: [C2883805](https://www.lcsc.com/product-detail/Pin-Headers_XKB-Connectivity-X6511WVS-08H-C60D48R1_C2883805.html)
- Header Pin x10: [C2883807](https://www.lcsc.com/product-detail/Pin-Headers_XKB-Connectivity-X6511WVS-10H-C60D48R1_C2883807.html)
- Alternative Header: [M20-8771246](https://www.mouser.com/ProductDetail/Harwin/M20-8771246?qs=WS5Jv%252B%252Bx1qWzrNY%252Bb2U9JQ%3D%3D&countryCode=US&currencyCode=USD)
- or [M20-8771042](https://www.mouser.com/ProductDetail/Harwin/M20-8771042?qs=%252Bk6%2F5FB6qrlBSpg9%252Bi11Bg%3D%3D)
- Light Pipe: [PLP2-188](https://www.digikey.com/en/products/detail/bivar-inc/PLP2-188/5721973?utm_medium=email&utm_source=oce&utm_campaign=4251_OCE23RT&utm_content=productdetail_US&utm_cid=2955578&so=79456987&mkt_tok=MDI4LVNYSy01MDcAAAGJOBaFWa7m6RHsJZT6mWcYRd9LRyXmqis92EV7j5ftyM5NuNOSOPqUp292m0P5E3FKrEWCFuvb9fObSzuSvVMsopuOMPjO46ylCAR1IzCL)
- M2x6mm Round Top Screw: [97763A407](https://www.mcmaster.com/97763A407/)
- M2x8mm Countersunk Screw: [91294A005](https://www.mcmaster.com/91294A005/)
+1 -1
View File
@@ -25,7 +25,7 @@ void Display::RunSetup()
#endif
#ifdef MARAUDER_M5STICKC
tft.setRotation(3);
tft.setRotation(1);
#endif
tft.setCursor(0, 0);
+1
View File
@@ -68,6 +68,7 @@ class Display
bool tteBar = false;
bool draw_tft = false;
bool exit_draw = false;
bool headless_mode = false;
uint8_t TOP_FIXED_AREA_2 = 48;
uint8_t print_delay_1, print_delay_2 = 10;
+2 -2
View File
@@ -68,10 +68,10 @@ bool EvilPortal::setHtml() {
File html_file = sd_obj.getFile("/" + this->target_html_name);
if (!html_file) {
#ifdef HAS_SCREEN
this->sendToDisplay("Could not find /index.html.");
this->sendToDisplay("Could not find /" + this->target_html_name);
this->sendToDisplay("Touch to exit...");
#endif
Serial.println("Could not find /index.html. Use stopscan...");
Serial.println("Could not find /" + this->target_html_name + ". Use stopscan...");
return false;
}
else {
+93 -49
View File
@@ -18,6 +18,13 @@ MenuFunctions::MenuFunctions()
/* Interrupt driven periodic handler */
#ifdef HAS_ILI9341
uint8_t MenuFunctions::updateTouch(uint16_t *x, uint16_t *y, uint16_t threshold) {
if (!display_obj.headless_mode)
return display_obj.tft.getTouch(x, y, threshold);
else
return !display_obj.headless_mode;
}
void MenuFunctions::lv_tick_handler()
{
lv_tick_inc(LVGL_TICK_PERIOD);
@@ -386,14 +393,18 @@ MenuFunctions::MenuFunctions()
#endif
//// END LV_ARDUINO STUFF
void MenuFunctions::buttonNotSelected(uint8_t b) {
void MenuFunctions::buttonNotSelected(uint8_t b, int8_t x) {
if (x == -1)
x = b;
display_obj.tft.setFreeFont(NULL);
display_obj.key[b].drawButton(false, current_menu->list->get(b).name);
display_obj.key[b].drawButton(false, current_menu->list->get(x).name);
}
void MenuFunctions::buttonSelected(uint8_t b) {
void MenuFunctions::buttonSelected(uint8_t b, int8_t x) {
if (x == -1)
x = b;
display_obj.tft.setFreeFont(NULL);
display_obj.key[b].drawButton(true, current_menu->list->get(b).name);
display_obj.key[b].drawButton(true, current_menu->list->get(x).name);
}
// Function to check menu input
@@ -456,7 +467,7 @@ void MenuFunctions::main(uint32_t currentTime)
// getTouch causes a 10ms delay which makes beacon spam less effective
#ifdef HAS_ILI9341
pressed = display_obj.tft.getTouch(&t_x, &t_y);
pressed = this->updateTouch(&t_x, &t_y);
#endif
@@ -643,50 +654,77 @@ void MenuFunctions::main(uint32_t currentTime)
#endif
#ifdef HAS_BUTTONS
#ifndef MARAUDER_M5STICKC
if (u_btn.justPressed()){
#if !(defined(MARAUDER_V6) || defined(MARAUDER_V6_1))
#ifndef MARAUDER_M5STICKC
if (u_btn.justPressed()){
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
if (current_menu->selected > 0) {
current_menu->selected--;
// Page up
if (current_menu->selected < this->menu_start_index) {
this->buildButtons(current_menu, current_menu->selected);
this->displayCurrentMenu(current_menu->selected);
}
this->buttonSelected(current_menu->selected - this->menu_start_index, current_menu->selected);
if (!current_menu->list->get(current_menu->selected + 1).selected)
this->buttonNotSelected(current_menu->selected + 1 - this->menu_start_index, current_menu->selected + 1);
}
// Loop to end
else {
current_menu->selected = current_menu->list->size() - 1;
if (current_menu->selected >= BUTTON_SCREEN_LIMIT) {
this->buildButtons(current_menu, current_menu->selected + 1 - BUTTON_SCREEN_LIMIT);
this->displayCurrentMenu(current_menu->selected + 1 - BUTTON_SCREEN_LIMIT);
}
this->buttonSelected(current_menu->selected, current_menu->selected);
if (!current_menu->list->get(0).selected)
this->buttonNotSelected(0, this->menu_start_index);
}
}
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
if (wifi_scan_obj.set_channel < 14)
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
}
}
#endif
if (d_btn.justPressed()){
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
if (current_menu->selected > 0) {
current_menu->selected--;
if (current_menu->selected < current_menu->list->size() - 1) {
current_menu->selected++;
this->buttonSelected(current_menu->selected - this->menu_start_index, current_menu->selected);
if (!current_menu->list->get(current_menu->selected - 1).selected)
this->buttonNotSelected(current_menu->selected - 1 - this->menu_start_index, current_menu->selected - 1);
// Page down
if (current_menu->selected - this->menu_start_index >= BUTTON_SCREEN_LIMIT) {
this->buildButtons(current_menu, current_menu->selected + 1 - BUTTON_SCREEN_LIMIT);
this->displayCurrentMenu(current_menu->selected + 1 - BUTTON_SCREEN_LIMIT);
}
}
// Loop to beginning
else {
if (current_menu->selected >= BUTTON_SCREEN_LIMIT) {
this->buildButtons(current_menu);
this->displayCurrentMenu();
}
current_menu->selected = 0;
this->buttonSelected(current_menu->selected);
if (!current_menu->list->get(current_menu->selected + 1).selected)
this->buttonNotSelected(current_menu->selected + 1);
if (!current_menu->list->get(current_menu->list->size() - 1).selected)
this->buttonNotSelected(current_menu->list->size() - 1);
}
}
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
if (wifi_scan_obj.set_channel < 14)
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
if (wifi_scan_obj.set_channel > 1)
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
}
}
if(c_btn_press){
current_menu->list->get(current_menu->selected).callable();
}
#endif
if (d_btn.justPressed()){
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
if (current_menu->selected < current_menu->list->size() - 1) {
current_menu->selected++;
this->buttonSelected(current_menu->selected);
if (!current_menu->list->get(current_menu->selected - 1).selected)
this->buttonNotSelected(current_menu->selected - 1);
}
else {
current_menu->selected = 0;
this->buttonSelected(current_menu->selected);
if (!current_menu->list->get(current_menu->list->size() - 1).selected)
this->buttonNotSelected(current_menu->list->size() - 1);
}
}
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
if (wifi_scan_obj.set_channel > 1)
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel - 1);
}
}
if(c_btn_press){
current_menu->list->get(current_menu->selected).callable();
}
#endif
}
@@ -819,6 +857,9 @@ void MenuFunctions::updateStatusBar()
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
display_obj.tft.drawString(gps_obj.getNumSatsString(), 22, 0, 2);
#elif defined(HAS_SCREEN)
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
display_obj.tft.drawString("GPS", 0, 0, 1);
#endif
}
#endif
@@ -828,7 +869,7 @@ void MenuFunctions::updateStatusBar()
// WiFi Channel Stuff
if (wifi_scan_obj.set_channel != wifi_scan_obj.old_channel) {
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
display_obj.tft.fillRect(50, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
display_obj.tft.fillRect(50, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifdef HAS_ILI9341
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
#endif
@@ -1178,11 +1219,13 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);
});
#endif
/*this->addNodes(&wifiSnifferMenu, text_table1[47], TFT_RED, NULL, PWNAGOTCHI, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_RED);
});*/
#ifndef HAS_ILI9341
this->addNodes(&wifiSnifferMenu, text_table1[47], TFT_RED, NULL, PWNAGOTCHI, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_RED);
});
#endif
this->addNodes(&wifiSnifferMenu, text_table1[49], TFT_MAGENTA, NULL, BEACON_SNIFF, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
@@ -1581,6 +1624,7 @@ void MenuFunctions::buildButtons(Menu * menu, int starting_index)
{
if (menu->list != NULL)
{
this->menu_start_index = starting_index;
for (uint8_t i = 0; i < menu->list->size(); i++)
{
TFT_eSPI_Button new_button;
@@ -1603,7 +1647,7 @@ void MenuFunctions::buildButtons(Menu * menu, int starting_index)
}
void MenuFunctions::displayCurrentMenu()
void MenuFunctions::displayCurrentMenu(uint8_t start_index)
{
//Serial.println(F("Displaying current menu..."));
display_obj.clearScreen();
@@ -1621,7 +1665,7 @@ void MenuFunctions::displayCurrentMenu()
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setTextSize(1);
#endif
for (uint8_t i = 0; i < current_menu->list->size(); i++)
for (uint8_t i = start_index; i < current_menu->list->size(); i++)
{
#ifdef HAS_ILI9341
if (!current_menu->list->get(i).selected)
@@ -1642,9 +1686,9 @@ void MenuFunctions::displayCurrentMenu()
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
if ((current_menu->selected == i) || (current_menu->list->get(i).selected))
display_obj.key[i].drawButton(true, current_menu->list->get(i).name);
display_obj.key[i - start_index].drawButton(true, current_menu->list->get(i).name);
else
display_obj.key[i].drawButton(false, current_menu->list->get(i).name);
display_obj.key[i - start_index].drawButton(false, current_menu->list->get(i).name);
#endif
}
display_obj.tft.setFreeFont(NULL);
+6 -3
View File
@@ -116,6 +116,7 @@ class MenuFunctions
String u_result = "";
uint32_t initTime = 0;
uint8_t menu_start_index = 0;
// Main menu stuff
@@ -163,8 +164,10 @@ class MenuFunctions
String callSetting(String key);
void runBoolSetting(String ley);
void displaySetting(String key, Menu* menu, int index);
void buttonSelected(uint8_t b);
void buttonNotSelected(uint8_t b);
void buttonSelected(uint8_t b, int8_t x = -1);
void buttonNotSelected(uint8_t b, int8_t x = -1);
uint8_t updateTouch(uint16_t *x, uint16_t *y, uint16_t threshold = 600);
public:
MenuFunctions();
@@ -193,7 +196,7 @@ class MenuFunctions
void buildButtons(Menu* menu, int starting_index = 0);
void changeMenu(Menu* menu);
void drawStatusBar();
void displayCurrentMenu();
void displayCurrentMenu(uint8_t start_index = 0);
void main(uint32_t currentTime);
void RunSetup();
void orientDisplay();
+20 -10
View File
@@ -518,9 +518,11 @@ void WiFiScan::startWiFiAttacks(uint8_t scan_mode, uint16_t color, String title_
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_BLACK, color);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString((String)title_string,120,16,2);
display_obj.touchToExit();
#ifdef HAS_ILI9341
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString((String)title_string,120,16,2);
display_obj.touchToExit();
#endif
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
#endif
@@ -1461,7 +1463,11 @@ const char* WiFiScan::generateRandomName() {
}
void WiFiScan::generateRandomMac(uint8_t* mac) {
for (int i = 0; i < 6; i++) {
// Set the locally administered bit and unicast bit for the first byte
mac[0] = 0x02; // The locally administered bit is the second least significant bit
// Generate the rest of the MAC address
for (int i = 1; i < 6; i++) {
mac[i] = random(0, 255);
}
}
@@ -1853,9 +1859,11 @@ void WiFiScan::RunSourApple(uint8_t scan_mode, uint16_t color) {
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_BLACK, color);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString("Sour Apple",120,16,2);
display_obj.touchToExit();
#ifdef HAS_ILI9341
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString("Sour Apple",120,16,2);
display_obj.touchToExit();
#endif
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
#endif
@@ -1873,9 +1881,11 @@ void WiFiScan::RunSwiftpairSpam(uint8_t scan_mode, uint16_t color) {
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_BLACK, color);
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString("Swiftpair Spam",120,16,2);
display_obj.touchToExit();
#ifdef HAS_ILI9341
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString("Swiftpair Spam",120,16,2);
display_obj.touchToExit();
#endif
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
#endif
+30 -7
View File
@@ -10,24 +10,25 @@
//// BOARD TARGETS
//#define MARAUDER_M5STICKC
//#define MARAUDER_MINI
#define MARAUDER_MINI
//#define MARAUDER_V4
//#define MARAUDER_V6
//#define MARAUDER_V6_1
//#define MARAUDER_KIT
//#define GENERIC_ESP32
#define MARAUDER_FLIPPER
//#define MARAUDER_FLIPPER
//#define ESP32_LDDB
//#define MARAUDER_DEV_BOARD_PRO
//#define XIAO_ESP32_S3
//// END BOARD TARGETS
#define MARAUDER_VERSION "v0.13.2"
#define MARAUDER_VERSION "v0.13.3"
//// BOARD FEATURES
#ifdef MARAUDER_M5STICKC
//#define FLIPPER_ZERO_HAT
#define HAS_BATTERY
#define HAS_BT
#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
#define HAS_PWR_MGMT
@@ -70,7 +71,8 @@
//#define FLIPPER_ZERO_HAT
#define HAS_BATTERY
#define HAS_BT
//#define HAS_BUTTONS
#define HAS_BT_REMOTE
#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
#define HAS_SCREEN
@@ -126,7 +128,7 @@
#ifdef ESP32_LDDB
//#define FLIPPER_ZERO_HAT
//#define HAS_BATTERY
//#define HAS_BT
#define HAS_BT
//#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
@@ -204,6 +206,22 @@
#define U_BTN -1
#define R_BTN -1
#define D_BTN 39
#endif
#ifdef MARAUDER_V6
#define L_BTN -1
#define C_BTN 0
#define U_BTN -1
#define R_BTN -1
#define D_BTN -1
#endif
#ifdef MARAUDER_V6_1
#define L_BTN -1
#define C_BTN 0
#define U_BTN -1
#define R_BTN -1
#define D_BTN -1
#endif
#endif
@@ -254,7 +272,8 @@
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 12
#define BUTTON_SCREEN_LIMIT 12
#define BUTTON_ARRAY_LEN 13
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
@@ -309,6 +328,7 @@
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 12
#define BUTTON_ARRAY_LEN 12
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
@@ -366,6 +386,7 @@
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 12
#define BUTTON_ARRAY_LEN 12
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
@@ -424,6 +445,7 @@
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 12
#define BUTTON_ARRAY_LEN 12
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
@@ -492,7 +514,8 @@
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 12
#define BUTTON_SCREEN_LIMIT 10
#define BUTTON_ARRAY_LEN 13
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
+12 -1
View File
@@ -165,7 +165,7 @@ void setup()
axp192_obj.begin();
#endif
pinMode(FLASH_BUTTON, INPUT);
//pinMode(FLASH_BUTTON, INPUT);
#ifdef HAS_SCREEN
pinMode(TFT_BL, OUTPUT);
@@ -247,6 +247,17 @@ void setup()
#ifdef HAS_SCREEN
delay(2000);
// Do some stealth mode stuff
#ifdef HAS_BUTTONS
if (c_btn.justPressed()) {
display_obj.headless_mode = true;
backlightOff();
Serial.println("Headless Mode enabled");
}
#endif
display_obj.clearScreen();
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);