mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 07:40:58 -08:00
Remove title screen and add select stations for mini
This commit is contained in:
@@ -206,7 +206,7 @@ PROGMEM static const unsigned char menu_icons[][66] = {
|
||||
0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF}
|
||||
};
|
||||
|
||||
#ifndef MARAUDER_MINI
|
||||
/*#ifndef MARAUDER_MINI
|
||||
static const uint8_t MarauderTitle[] PROGMEM = {
|
||||
0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60,
|
||||
0x00, 0x60, 0x00, 0x00, 0xFF, 0xE1, 0x00, 0x22, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4D, 0x4D,
|
||||
@@ -1057,7 +1057,7 @@ PROGMEM static const unsigned char menu_icons[][66] = {
|
||||
0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A,
|
||||
0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x0A,
|
||||
0x28, 0xA2, 0x80, 0x0A, 0x28, 0xA2, 0x80, 0x3F, 0xFF, 0xD9};
|
||||
/*static const uint8_t MarauderTitle[] PROGMEM = {
|
||||
*//*static const uint8_t MarauderTitle[] PROGMEM = {
|
||||
0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60,
|
||||
0x00, 0x60, 0x00, 0x00, 0xff, 0xe1, 0x00, 0x66, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4d, 0x4d,
|
||||
0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01,
|
||||
@@ -1455,8 +1455,9 @@ PROGMEM static const unsigned char menu_icons[][66] = {
|
||||
0xc4, 0x8b, 0x1c, 0x7b, 0xe4, 0x66, 0x6d, 0xaa, 0xbc, 0x05, 0xce, 0x00, 0xe0, 0x50, 0x07, 0x96,
|
||||
0xd1, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x00, 0x51, 0x45, 0x14, 0x01, 0xff, 0xd9
|
||||
};*/
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
/*
|
||||
#ifdef MARAUDER_MINI
|
||||
const uint8_t MarauderTitle[] PROGMEM = {
|
||||
0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60,
|
||||
@@ -1832,5 +1833,6 @@ PROGMEM static const unsigned char menu_icons[][66] = {
|
||||
0x28, 0x00, 0xA2, 0x80, 0x0A, 0x28, 0x03, 0xFF, 0xD9};
|
||||
|
||||
#endif
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
@@ -422,6 +422,7 @@ void Display::scrollAddress(uint16_t vsp) {
|
||||
|
||||
|
||||
// JPEG_functions
|
||||
/*
|
||||
void Display::drawJpeg(const char *filename, int xpos, int ypos) {
|
||||
|
||||
// Open the named file (the Jpeg decoder library will close it after rendering image)
|
||||
@@ -452,6 +453,7 @@ void Display::drawJpeg(const char *filename, int xpos, int ypos) {
|
||||
// Serial.println(F("Jpeg file format not supported!"));
|
||||
//}
|
||||
}
|
||||
*/
|
||||
|
||||
/*void Display::setupDraw() {
|
||||
this->tft.drawLine(0, 0, 10, 0, TFT_MAGENTA);
|
||||
|
||||
@@ -110,7 +110,7 @@ class Display
|
||||
void buildBanner(String msg, int xpos);
|
||||
void clearScreen();
|
||||
void displayBuffer(bool do_clear = false);
|
||||
void drawJpeg(const char *filename, int xpos, int ypos);
|
||||
//void drawJpeg(const char *filename, int xpos, int ypos);
|
||||
void getTouchWhileFunction(bool pressed);
|
||||
void initScrollValues(bool tte = false);
|
||||
void jpegInfo();
|
||||
|
||||
@@ -1222,6 +1222,7 @@ void MenuFunctions::displaySetting(String key, Menu* menu, int index) {
|
||||
void MenuFunctions::RunSetup()
|
||||
{
|
||||
extern LinkedList<AccessPoint>* access_points;
|
||||
extern LinkedList<Station>* stations;
|
||||
|
||||
this->disable_touch = false;
|
||||
|
||||
@@ -1257,6 +1258,9 @@ void MenuFunctions::RunSetup()
|
||||
wifiAttackMenu.list = new LinkedList<MenuNode>();
|
||||
wifiGeneralMenu.list = new LinkedList<MenuNode>();
|
||||
wifiAPMenu.list = new LinkedList<MenuNode>();
|
||||
#ifndef HAS_ILI9341
|
||||
wifiStationMenu.list = new LinkedList<MenuNode>();
|
||||
#endif
|
||||
|
||||
// WiFi HTML menu stuff
|
||||
htmlMenu.list = new LinkedList<MenuNode>();
|
||||
@@ -1312,6 +1316,9 @@ void MenuFunctions::RunSetup()
|
||||
clearSSIDsMenu.name = text_table1[28];
|
||||
clearAPsMenu.name = text_table1[29];
|
||||
wifiAPMenu.name = "Access Points";
|
||||
#ifndef HAS_ILI9341
|
||||
wifiStationMenu.name = "Select Stations";
|
||||
#endif
|
||||
#ifdef HAS_GPS
|
||||
gpsInfoMenu.name = "GPS Data";
|
||||
#endif
|
||||
@@ -1533,12 +1540,14 @@ void MenuFunctions::RunSetup()
|
||||
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
|
||||
addAPGFX();
|
||||
});
|
||||
// Select Stations on OG
|
||||
this->addNodes(&wifiGeneralMenu, text_table1[61], TFT_LIGHTGREY, NULL, KEYBOARD_ICO, [this](){
|
||||
display_obj.clearScreen();
|
||||
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
||||
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
|
||||
addStationGFX();
|
||||
});
|
||||
// Select Evil Portal Files on OG
|
||||
this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){
|
||||
display_obj.clearScreen();
|
||||
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
||||
@@ -1621,11 +1630,11 @@ void MenuFunctions::RunSetup()
|
||||
current_menu->list->set(i + 1, new_node);
|
||||
|
||||
// Change selection status of button key
|
||||
if (new_ap.selected) {
|
||||
this->buttonSelected(i + 1);
|
||||
} else {
|
||||
this->buttonNotSelected(i + 1);
|
||||
}
|
||||
//if (new_ap.selected) {
|
||||
// this->buttonSelected(i + 1);
|
||||
//} else {
|
||||
// this->buttonNotSelected(i + 1);
|
||||
//}
|
||||
access_points->set(i, new_ap);
|
||||
}, access_points->get(i).selected);
|
||||
}
|
||||
@@ -1636,6 +1645,115 @@ void MenuFunctions::RunSetup()
|
||||
this->addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(wifiAPMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Select Stations on Mini v1
|
||||
/*
|
||||
this->addNodes(&wifiGeneralMenu, "Select Stations", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){
|
||||
wifiStationMenu.list->clear();
|
||||
this->addNodes(&wifiStationMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(wifiStationMenu.parentMenu);
|
||||
});
|
||||
int menu_limit;
|
||||
|
||||
// Find out how many buttons we will need
|
||||
if (stations->size() <= BUTTON_ARRAY_LEN)
|
||||
menu_limit = stations->size();
|
||||
else
|
||||
menu_limit = BUTTON_ARRAY_LEN;
|
||||
|
||||
// Load buttons with stations
|
||||
for (int i = 0; i < stations->size(); i++) {
|
||||
|
||||
// Check if there is even space left
|
||||
if (current_menu->list->size() >= menu_limit)
|
||||
break;
|
||||
|
||||
int cur_ap_sta = i;
|
||||
|
||||
this->addNodes(&wifiStationMenu, wifi_scan_obj.macToString(stations->get(cur_ap_sta)), TFT_CYAN, NULL, KEYBOARD_ICO, [this, i, cur_ap_sta](){
|
||||
Station new_sta = stations->get(cur_ap_sta);
|
||||
new_sta.selected = !stations->get(cur_ap_sta).selected;
|
||||
|
||||
// Change selection status of menu node
|
||||
MenuNode new_node = current_menu->list->get(i + 1);
|
||||
new_node.selected = !current_menu->list->get(i + 1).selected;
|
||||
current_menu->list->set(i + 1, new_node);
|
||||
|
||||
// Change selection status of button key
|
||||
//if (new_sta.selected) {
|
||||
// this->buttonSelected(i + 1);
|
||||
//} else {
|
||||
// this->buttonNotSelected(i + 1);
|
||||
//}
|
||||
|
||||
stations->set(cur_ap_sta, new_sta);
|
||||
}, stations->get(cur_ap_sta).selected);
|
||||
}
|
||||
this->changeMenu(&wifiStationMenu);
|
||||
});
|
||||
*/
|
||||
|
||||
// Select Stations on Mini v2
|
||||
this->addNodes(&wifiGeneralMenu, "Select Stations", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){
|
||||
wifiAPMenu.list->clear();
|
||||
this->addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(wifiAPMenu.parentMenu);
|
||||
});
|
||||
|
||||
int menu_limit;
|
||||
|
||||
if (access_points->size() <= BUTTON_ARRAY_LEN)
|
||||
menu_limit = access_points->size();
|
||||
else
|
||||
menu_limit = BUTTON_ARRAY_LEN;
|
||||
|
||||
for (int i = 0; i < menu_limit - 1; i++) {
|
||||
wifiStationMenu.list->clear();
|
||||
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFT_CYAN, NULL, KEYBOARD_ICO, [this, i](){
|
||||
|
||||
wifiStationMenu.list->clear();
|
||||
|
||||
// Add back button to the APs
|
||||
this->addNodes(&wifiStationMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(wifiStationMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Add the AP's stations to the specific AP menu
|
||||
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, wifi_scan_obj.macToString(stations->get(cur_ap_sta)), TFT_CYAN, NULL, KEYBOARD_ICO, [this, i, cur_ap_sta, x](){
|
||||
Station new_sta = stations->get(cur_ap_sta);
|
||||
new_sta.selected = !stations->get(cur_ap_sta).selected;
|
||||
|
||||
// Change selection status of menu node
|
||||
MenuNode new_node = current_menu->list->get(x + 1);
|
||||
new_node.selected = !current_menu->list->get(x + 1).selected;
|
||||
current_menu->list->set(x + 1, new_node);
|
||||
|
||||
// Change selection status of button key
|
||||
//if (new_sta.selected) {
|
||||
// this->buttonSelected(i + 1);
|
||||
//} else {
|
||||
// this->buttonNotSelected(i + 1);
|
||||
//}
|
||||
|
||||
stations->set(cur_ap_sta, new_sta);
|
||||
}, stations->get(cur_ap_sta).selected);
|
||||
}
|
||||
|
||||
// Final change menu to the menu of Stations
|
||||
this->changeMenu(&wifiStationMenu);
|
||||
|
||||
}, false);
|
||||
}
|
||||
this->changeMenu(&wifiAPMenu);
|
||||
});
|
||||
|
||||
wifiStationMenu.parentMenu = &wifiAPMenu;
|
||||
this->addNodes(&wifiStationMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(wifiStationMenu.parentMenu);
|
||||
});
|
||||
#endif
|
||||
|
||||
// Build generate ssids menu
|
||||
|
||||
@@ -148,6 +148,9 @@ class MenuFunctions
|
||||
Menu wifiAttackMenu;
|
||||
Menu wifiGeneralMenu;
|
||||
Menu wifiAPMenu;
|
||||
#ifndef HAS_ILI9341
|
||||
Menu wifiStationMenu;
|
||||
#endif
|
||||
|
||||
// WiFi General Menu
|
||||
Menu htmlMenu;
|
||||
|
||||
@@ -305,6 +305,14 @@ WiFiScan::WiFiScan()
|
||||
{
|
||||
}
|
||||
|
||||
String WiFiScan::macToString(const Station& station) {
|
||||
char macStr[18]; // 6 pairs of hex digits + 5 colons + null terminator
|
||||
snprintf(macStr, sizeof(macStr), "%02X:%02X:%02X:%02X:%02X:%02X",
|
||||
station.mac[0], station.mac[1], station.mac[2],
|
||||
station.mac[3], station.mac[4], station.mac[5]);
|
||||
return String(macStr);
|
||||
}
|
||||
|
||||
void WiFiScan::RunSetup() {
|
||||
if (ieee80211_raw_frame_sanity_check(31337, 0, 0) == 1)
|
||||
this->wsl_bypass_enabled = true;
|
||||
|
||||
@@ -400,6 +400,7 @@ class WiFiScan
|
||||
bool save_serial = false;
|
||||
void startPcap(String file_name);
|
||||
void startLog(String file_name);
|
||||
String macToString(const Station& station);
|
||||
|
||||
static void getMAC(char *addr, uint8_t* data, uint16_t offset);
|
||||
static void pwnSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
//// BOARD TARGETS
|
||||
//#define MARAUDER_M5STICKC
|
||||
//#define MARAUDER_MINI
|
||||
#define MARAUDER_MINI
|
||||
//#define MARAUDER_V4
|
||||
//#define MARAUDER_V6
|
||||
#define MARAUDER_V6_1
|
||||
//#define MARAUDER_V6_1
|
||||
//#define MARAUDER_KIT
|
||||
//#define GENERIC_ESP32
|
||||
//#define MARAUDER_FLIPPER
|
||||
|
||||
@@ -192,6 +192,7 @@ void setup()
|
||||
backlightOff();
|
||||
|
||||
// Draw the title screen
|
||||
/*
|
||||
#ifdef HAS_SCREEN
|
||||
#ifndef MARAUDER_MINI
|
||||
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
|
||||
@@ -199,6 +200,7 @@ void setup()
|
||||
display_obj.drawJpeg("/marauder3L.jpg", 0, 0);
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
#ifndef MARAUDER_MINI
|
||||
@@ -210,6 +212,7 @@ void setup()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
backlightOn(); // Need this
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
Reference in New Issue
Block a user