mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 07:40:58 -08:00
nye³ (#35)
* Update Display.cpp I THINK I FIGURED OUT WHAT IM DOING * Add files via upload * Update esp32_marauder.ino * Update MenuFunctions.cpp * Update MenuFunctions.h * Update MenuFunctions.cpp * Update README.md * Update README.md * Update MenuFunctions.cpp * Update MenuFunctions.h * Update MenuFunctions.h * Add files via upload * Update esp32_marauder.ino * Update README.md * Update Display.cpp moved the float "wd", as the draw function would continously change it, which resulted in those weird effects when trying to draw different thicknesses * Update MenuFunctions.cpp * Update Display.cpp made it so the drawing code doesnt need to draw every pixel individually and made it so it can handle higher thiccnesses... at all. it did not handly thicknesses above 2 with any kind of grace * Update Display.cpp removed unneccessary variable changes, just realized i kept making certain variables be a certain value over and over * Fix screen change battery percentage * restore TFT touch data Co-authored-by: Just Call Me Koko <25190487+justcallmekoko@users.noreply.github.com>
This commit is contained in:
10
README.md
10
README.md
@@ -96,6 +96,14 @@ Make the following connections between your 2.8" TFT Screen and your ESP32 board
|
||||
| | T_IRQ | |
|
||||
| SD_CS | | GPIO12 |
|
||||
|
||||
For the analog battery circuit, use a 4 to 1 voltage divider, and (optional) a mosfet
|
||||
For the charge detection circuit, use a 1 to 2 voltage divider (the charge detection is optional and only changes the battery icon colour while charging)
|
||||
| BATTERY | ESP32 |
|
||||
| ------- | ------ |
|
||||
| BAT + | GPIO34 |
|
||||
| MOSFET | GPIO13 |
|
||||
| CHARGE +| GPIO27 |
|
||||
|
||||
## Flashing Firmware
|
||||
### Using Arduino IDE
|
||||
1. Install the [Arduino IDE](https://www.arduino.cc/en/main/software)
|
||||
@@ -115,8 +123,10 @@ Make the following connections between your 2.8" TFT Screen and your ESP32 board
|
||||
8. Install the [CH340 Drivers](https://github.com/justcallmekoko/ESP32Marauder/blob/master/Drivers/CH34x_Install_Windows_v3_4.EXE)
|
||||
9. Download or clone this repository
|
||||
10. Open `esp32_marauder.ino`
|
||||
10.5. If you're using the analog battery measuring circuit, go to the MenuFunctions.h and change "#define BATTERY_ANALOG_ON" to 1
|
||||
11. Plug your ESP32 into a USB port and select the COM port under `Tools`>`Port`
|
||||
12. Select `LOLIN D32` under `Tools`>`Boards`
|
||||
12.5 If you want an upscaled version of the logo, go to the data folder and rename "marauder3L1.jpg" to "marauder3L.jpg"
|
||||
13. Click `ESP32 Sketch Data Upload` and wait for the SPIFFS upload to finish
|
||||
14. Click the upload button
|
||||
|
||||
|
||||
@@ -465,7 +465,6 @@ void Display::drawJpeg(const char *filename, int xpos, int ypos) {
|
||||
uint16_t xlast;
|
||||
uint16_t ylast;
|
||||
uint32_t AH;
|
||||
float wd = 3;
|
||||
void Display::drawStylus()
|
||||
{
|
||||
uint16_t x = 0, y = 0; // To store the touch coordinates
|
||||
@@ -477,26 +476,35 @@ void Display::drawStylus()
|
||||
if (pressed) {
|
||||
// tft.fillCircle(x, y, 2, TFT_WHITE);
|
||||
if ( xlast > 0 && ylast > 0 ) {
|
||||
int dx = abs(x - xlast), sx = xlast < x ? 1 : -1;
|
||||
int dy = abs(y - ylast), sy = ylast < y ? 1 : -1;
|
||||
int err = dx - dy, e2, x2, y2; /* error value e_xy */
|
||||
float ed = dx + dy == 0 ? 1 : sqrt((float)dx * dx + (float)dy * dy);
|
||||
|
||||
for (wd = (wd + 1) / 2; ; ) { /* pixel loop */
|
||||
tft.drawPixel(xlast, ylast, TFT_WHITE);
|
||||
e2 = err; x2 = xlast;
|
||||
if (2 * e2 >= -dx) { /* x step */
|
||||
for (e2 += dy, y2 = ylast; e2 < ed * wd && (y != y2 || dx > dy); e2 += dx)
|
||||
tft.drawPixel(xlast, y2 += sy, TFT_WHITE);
|
||||
if (xlast == x) break;
|
||||
e2 = err; err -= dy; xlast += sx;
|
||||
uint16_t the_color = TFT_WHITE;
|
||||
uint16_t wd = 1;
|
||||
int xlast2;
|
||||
int ylast2;
|
||||
int x2;
|
||||
int y2;
|
||||
int n;
|
||||
int n2 = -wd;
|
||||
xlast2 = xlast - wd;
|
||||
x2 = x - wd;
|
||||
for (n = -wd; n <= wd; n++) {
|
||||
ylast2 = ylast + n;
|
||||
y2 = y + n;
|
||||
tft.drawLine(xlast2, ylast2, x2, y2, the_color);
|
||||
}
|
||||
if (2 * e2 <= dy) { /* y step */
|
||||
for (e2 = dx - e2; e2 < ed * wd && (x != x2 || dx < dy); e2 += dy)
|
||||
tft.drawPixel(x2 += sx, ylast, TFT_WHITE);
|
||||
if (ylast == y) break;
|
||||
err += dx; ylast += sy;
|
||||
for (n2 = -wd; n2 <= wd; n2++) {
|
||||
xlast2 = xlast + n2;
|
||||
x2 = x + n2;
|
||||
tft.drawLine(xlast2, ylast2, x2, y2, the_color);
|
||||
}
|
||||
for (n = wd; n >= -wd; n--) {
|
||||
ylast2 = ylast + n;
|
||||
y2 = y + n;
|
||||
tft.drawLine(xlast2, ylast2, x2, y2, the_color);
|
||||
}
|
||||
for (n2 = wd; n2 >= -wd; n2--) {
|
||||
xlast2 = xlast + n2;
|
||||
x2 = x + n2;
|
||||
tft.drawLine(xlast2, ylast2, x2, y2, the_color);
|
||||
}
|
||||
// tft.drawLine(xlast, ylast, x, y, TFT_WHITE);
|
||||
}
|
||||
|
||||
@@ -156,6 +156,106 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
y = -1;
|
||||
}
|
||||
|
||||
#if BATTERY_ANALOG_ON == 1
|
||||
byte battery_analog_array[10];
|
||||
byte battery_count = 0;
|
||||
byte battery_analog_last = 101;
|
||||
#define BATTERY_CHECK 50
|
||||
uint16_t battery_analog = 0;
|
||||
void MenuFunctions::battery(bool initial)
|
||||
{
|
||||
if (BATTERY_ANALOG_ON) {
|
||||
uint8_t n = 0;
|
||||
byte battery_analog_sample[10];
|
||||
byte deviation;
|
||||
if (battery_count == BATTERY_CHECK - 5) digitalWrite(BATTERY_PIN, HIGH);
|
||||
else if (battery_count == 5) digitalWrite(BATTERY_PIN, LOW);
|
||||
if (battery_count == 0) {
|
||||
battery_analog = 0;
|
||||
for (n = 9; n > 0; n--)battery_analog_array[n] = battery_analog_array[n - 1];
|
||||
for (n = 0; n < 10; n++) {
|
||||
battery_analog_sample[n] = map((analogRead(ANALOG_PIN) * 5), 2400, 4200, 0, 100);
|
||||
if (battery_analog_sample[n] > 100) battery_analog_sample[n] = 100;
|
||||
else if (battery_analog_sample[n] < 0) battery_analog_sample[n] = 0;
|
||||
battery_analog += battery_analog_sample[n];
|
||||
}
|
||||
battery_analog = battery_analog / 10;
|
||||
for (n = 0; n < 10; n++) {
|
||||
deviation = abs(battery_analog - battery_analog_sample[n]);
|
||||
if (deviation >= 10) battery_analog_sample[n] = battery_analog;
|
||||
}
|
||||
battery_analog = 0;
|
||||
for (n = 0; n < 10; n++) battery_analog += battery_analog_sample[n];
|
||||
battery_analog = battery_analog / 10;
|
||||
battery_analog_array[0] = battery_analog;
|
||||
if (battery_analog_array[9] > 0 ) {
|
||||
battery_analog = 0;
|
||||
for (n = 0; n < 10; n++) battery_analog += battery_analog_array[n];
|
||||
battery_analog = battery_analog / 10;
|
||||
}
|
||||
battery_count ++;
|
||||
}
|
||||
else if (battery_count < BATTERY_CHECK) battery_count++;
|
||||
else if (battery_count >= BATTERY_CHECK) battery_count = 0;
|
||||
|
||||
if (battery_analog_last != battery_analog) {
|
||||
battery_analog_last = battery_analog;
|
||||
MenuFunctions::battery2();
|
||||
}
|
||||
}
|
||||
}
|
||||
void MenuFunctions::battery2(bool initial)
|
||||
{
|
||||
uint16_t the_color;
|
||||
if ( digitalRead(CHARGING_PIN) == 1) the_color = TFT_BLUE;
|
||||
else if (battery_analog < 20) the_color = TFT_RED;
|
||||
else if (battery_analog < 40) the_color = TFT_YELLOW;
|
||||
else the_color = TFT_GREEN;
|
||||
|
||||
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
|
||||
display_obj.tft.fillRect(186, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
display_obj.tft.drawXBitmap(186,
|
||||
0,
|
||||
menu_icons[STATUS_BAT],
|
||||
16,
|
||||
16,
|
||||
STATUSBAR_COLOR,
|
||||
the_color);
|
||||
display_obj.tft.drawString((String) battery_analog + "%", 204, 0, 2);
|
||||
}
|
||||
#else
|
||||
void MenuFunctions::battery(bool initial)
|
||||
{
|
||||
uint16_t the_color;
|
||||
if (battery_obj.i2c_supported)
|
||||
{
|
||||
// Could use int compare maybe idk
|
||||
if (((String)battery_obj.battery_level != "25") && ((String)battery_obj.battery_level != "0"))
|
||||
the_color = TFT_GREEN;
|
||||
else
|
||||
the_color = TFT_RED;
|
||||
|
||||
if ((battery_obj.battery_level != battery_obj.old_level) || (initial)) {
|
||||
battery_obj.old_level = battery_obj.battery_level;
|
||||
display_obj.tft.fillRect(204, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
display_obj.tft.setCursor(0, 1);
|
||||
display_obj.tft.drawXBitmap(186,
|
||||
0,
|
||||
menu_icons[STATUS_BAT],
|
||||
16,
|
||||
16,
|
||||
STATUSBAR_COLOR,
|
||||
the_color);
|
||||
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 204, 0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
void MenuFunctions::battery2(bool initial)
|
||||
{
|
||||
MenuFunctions::battery(initial);
|
||||
}
|
||||
#endif
|
||||
|
||||
void MenuFunctions::updateStatusBar()
|
||||
{
|
||||
uint16_t the_color;
|
||||
@@ -196,27 +296,7 @@ void MenuFunctions::updateStatusBar()
|
||||
}
|
||||
|
||||
// Draw battery info
|
||||
if (battery_obj.i2c_supported)
|
||||
{
|
||||
if ((String)battery_obj.battery_level != "25")
|
||||
the_color = TFT_GREEN;
|
||||
else
|
||||
the_color = TFT_RED;
|
||||
|
||||
if (battery_obj.battery_level != battery_obj.old_level) {
|
||||
battery_obj.old_level = battery_obj.battery_level;
|
||||
display_obj.tft.fillRect(204, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
display_obj.tft.setCursor(0, 1);
|
||||
display_obj.tft.drawXBitmap(186,
|
||||
0,
|
||||
menu_icons[STATUS_BAT],
|
||||
16,
|
||||
16,
|
||||
STATUSBAR_COLOR,
|
||||
the_color);
|
||||
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 204, 0, 2);
|
||||
}
|
||||
}
|
||||
MenuFunctions::battery(false);
|
||||
|
||||
// Draw SD info
|
||||
if (sd_obj.supported)
|
||||
@@ -273,26 +353,8 @@ void MenuFunctions::drawStatusBar()
|
||||
display_obj.tft.fillRect(100, 0, 60, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2);
|
||||
|
||||
// Draw battery info
|
||||
if (battery_obj.i2c_supported)
|
||||
{
|
||||
if ((String)battery_obj.battery_level != "25")
|
||||
the_color = TFT_GREEN;
|
||||
else
|
||||
the_color = TFT_RED;
|
||||
|
||||
battery_obj.old_level = battery_obj.battery_level;
|
||||
display_obj.tft.fillRect(204, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
display_obj.tft.setCursor(0, 1);
|
||||
display_obj.tft.drawXBitmap(186,
|
||||
0,
|
||||
menu_icons[STATUS_BAT],
|
||||
16,
|
||||
16,
|
||||
STATUSBAR_COLOR,
|
||||
the_color);
|
||||
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 204, 0, 2);
|
||||
}
|
||||
MenuFunctions::battery2(true);
|
||||
|
||||
// Draw SD info
|
||||
if (sd_obj.supported)
|
||||
@@ -384,93 +446,208 @@ void MenuFunctions::RunSetup()
|
||||
|
||||
// Build Main Menu
|
||||
mainMenu.parentMenu = NULL;
|
||||
addNodes(&mainMenu, "WiFi", TFT_GREEN, NULL, WIFI, [this](){changeMenu(&wifiMenu);});
|
||||
addNodes(&mainMenu, "Bluetooth", TFT_CYAN, NULL, BLUETOOTH, [this](){changeMenu(&bluetoothMenu);});
|
||||
addNodes(&mainMenu, "General Apps", TFT_MAGENTA, NULL, GENERAL_APPS, [this](){changeMenu(&generalMenu);});
|
||||
addNodes(&mainMenu, "Device", TFT_BLUE, NULL, DEVICE, [this](){changeMenu(&deviceMenu);});
|
||||
addNodes(&mainMenu, "Reboot", TFT_LIGHTGREY, NULL, REBOOT, [](){ESP.restart();});
|
||||
addNodes(&mainMenu, "WiFi", TFT_GREEN, NULL, WIFI, [this]() {
|
||||
changeMenu(&wifiMenu);
|
||||
});
|
||||
addNodes(&mainMenu, "Bluetooth", TFT_CYAN, NULL, BLUETOOTH, [this]() {
|
||||
changeMenu(&bluetoothMenu);
|
||||
});
|
||||
addNodes(&mainMenu, "General Apps", TFT_MAGENTA, NULL, GENERAL_APPS, [this]() {
|
||||
changeMenu(&generalMenu);
|
||||
});
|
||||
addNodes(&mainMenu, "Device", TFT_BLUE, NULL, DEVICE, [this]() {
|
||||
changeMenu(&deviceMenu);
|
||||
});
|
||||
addNodes(&mainMenu, "Reboot", TFT_LIGHTGREY, NULL, REBOOT, []() {
|
||||
ESP.restart();
|
||||
});
|
||||
|
||||
// Build WiFi Menu
|
||||
wifiMenu.parentMenu = &mainMenu; // Main Menu is second menu parent
|
||||
addNodes(&wifiMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiMenu.parentMenu);});
|
||||
addNodes(&wifiMenu, "Sniffers", TFT_YELLOW, NULL, SNIFFERS, [this](){changeMenu(&wifiSnifferMenu);});
|
||||
addNodes(&wifiMenu, "Scanners", TFT_ORANGE, NULL, SCANNERS, [this](){changeMenu(&wifiScannerMenu);});
|
||||
addNodes(&wifiMenu, "Attacks", TFT_RED, NULL, ATTACKS, [this](){changeMenu(&wifiAttackMenu);});
|
||||
addNodes(&wifiMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(wifiMenu.parentMenu);
|
||||
});
|
||||
addNodes(&wifiMenu, "Sniffers", TFT_YELLOW, NULL, SNIFFERS, [this]() {
|
||||
changeMenu(&wifiSnifferMenu);
|
||||
});
|
||||
addNodes(&wifiMenu, "Scanners", TFT_ORANGE, NULL, SCANNERS, [this]() {
|
||||
changeMenu(&wifiScannerMenu);
|
||||
});
|
||||
addNodes(&wifiMenu, "Attacks", TFT_RED, NULL, ATTACKS, [this]() {
|
||||
changeMenu(&wifiAttackMenu);
|
||||
});
|
||||
|
||||
// Build WiFi sniffer Menu
|
||||
wifiSnifferMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||
addNodes(&wifiSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiSnifferMenu.parentMenu);});
|
||||
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, PROBE_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);});
|
||||
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, BEACON_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);});
|
||||
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, DEAUTH_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);});
|
||||
addNodes(&wifiSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(wifiSnifferMenu.parentMenu);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "Probe Request Sniff", TFT_CYAN, NULL, PROBE_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_CYAN);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "Beacon Sniff", TFT_MAGENTA, NULL, BEACON_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);
|
||||
});
|
||||
addNodes(&wifiSnifferMenu, "Deauth Sniff", TFT_RED, NULL, DEAUTH_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
|
||||
});
|
||||
|
||||
// Build WiFi scanner Menu
|
||||
wifiScannerMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||
addNodes(&wifiScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiScannerMenu.parentMenu);});
|
||||
addNodes(&wifiScannerMenu, "Packet Monitor", TFT_BLUE, NULL, PACKET_MONITOR, [this](){wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);});
|
||||
addNodes(&wifiScannerMenu, "EAPOL/PMKID Scan", TFT_VIOLET, NULL, EAPOL, [this](){wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);});
|
||||
addNodes(&wifiScannerMenu, "Detect Pwnagotchi", TFT_RED, NULL, PWNAGOTCHI, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_RED);});
|
||||
addNodes(&wifiScannerMenu, "Detect Espressif", TFT_ORANGE, NULL, ESPRESSIF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_SCAN_ESPRESSIF, TFT_ORANGE);});
|
||||
addNodes(&wifiScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(wifiScannerMenu.parentMenu);
|
||||
});
|
||||
addNodes(&wifiScannerMenu, "Packet Monitor", TFT_BLUE, NULL, PACKET_MONITOR, [this]() {
|
||||
wifi_scan_obj.StartScan(WIFI_PACKET_MONITOR, TFT_BLUE);
|
||||
});
|
||||
addNodes(&wifiScannerMenu, "EAPOL/PMKID Scan", TFT_VIOLET, NULL, EAPOL, [this]() {
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
|
||||
});
|
||||
addNodes(&wifiScannerMenu, "Detect Pwnagotchi", TFT_RED, NULL, PWNAGOTCHI, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_RED);
|
||||
});
|
||||
addNodes(&wifiScannerMenu, "Detect Espressif", TFT_ORANGE, NULL, ESPRESSIF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_ESPRESSIF, TFT_ORANGE);
|
||||
});
|
||||
|
||||
// Build WiFi attack menu
|
||||
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||
addNodes(&wifiAttackMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(wifiAttackMenu.parentMenu);});
|
||||
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, BEACON_SPAM, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);});
|
||||
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, RICK_ROLL, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);});
|
||||
addNodes(&wifiAttackMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(wifiAttackMenu.parentMenu);
|
||||
});
|
||||
addNodes(&wifiAttackMenu, "Beacon Spam Random", TFT_ORANGE, NULL, BEACON_SPAM, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);
|
||||
});
|
||||
addNodes(&wifiAttackMenu, "Rick Roll Beacon", TFT_YELLOW, NULL, RICK_ROLL, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);
|
||||
});
|
||||
|
||||
// Build Bluetooth Menu
|
||||
bluetoothMenu.parentMenu = &mainMenu; // Second Menu is third menu parent
|
||||
addNodes(&bluetoothMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothMenu.parentMenu);});
|
||||
addNodes(&bluetoothMenu, "Sniffers", TFT_YELLOW, NULL, SNIFFERS, [this](){changeMenu(&bluetoothSnifferMenu);});
|
||||
addNodes(&bluetoothMenu, "Scanners", TFT_ORANGE, NULL, SCANNERS, [this](){changeMenu(&bluetoothScannerMenu);});
|
||||
addNodes(&bluetoothMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(bluetoothMenu.parentMenu);
|
||||
});
|
||||
addNodes(&bluetoothMenu, "Sniffers", TFT_YELLOW, NULL, SNIFFERS, [this]() {
|
||||
changeMenu(&bluetoothSnifferMenu);
|
||||
});
|
||||
addNodes(&bluetoothMenu, "Scanners", TFT_ORANGE, NULL, SCANNERS, [this]() {
|
||||
changeMenu(&bluetoothScannerMenu);
|
||||
});
|
||||
|
||||
// Build bluetooth sniffer Menu
|
||||
bluetoothSnifferMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
||||
addNodes(&bluetoothSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothSnifferMenu.parentMenu);});
|
||||
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);});
|
||||
addNodes(&bluetoothSnifferMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(bluetoothSnifferMenu.parentMenu);
|
||||
});
|
||||
addNodes(&bluetoothSnifferMenu, "Bluetooth Sniffer", TFT_GREEN, NULL, BLUETOOTH_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
|
||||
});
|
||||
|
||||
// Build bluetooth scanner Menu
|
||||
bluetoothScannerMenu.parentMenu = &bluetoothMenu; // Second Menu is third menu parent
|
||||
addNodes(&bluetoothScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(bluetoothScannerMenu.parentMenu);});
|
||||
addNodes(&bluetoothScannerMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, CC_SKIMMERS, [this](){display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);});
|
||||
addNodes(&bluetoothScannerMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(bluetoothScannerMenu.parentMenu);
|
||||
});
|
||||
addNodes(&bluetoothScannerMenu, "Detect Card Skimmers", TFT_MAGENTA, NULL, CC_SKIMMERS, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);
|
||||
});
|
||||
|
||||
// General apps menu
|
||||
generalMenu.parentMenu = &mainMenu;
|
||||
addNodes(&generalMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){display_obj.draw_tft = false; changeMenu(generalMenu.parentMenu);});
|
||||
addNodes(&generalMenu, "Draw", TFT_WHITE, NULL, DRAW, [this](){display_obj.clearScreen(); display_obj.draw_tft = true;});
|
||||
addNodes(&generalMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
display_obj.draw_tft = false;
|
||||
changeMenu(generalMenu.parentMenu);
|
||||
});
|
||||
addNodes(&generalMenu, "Draw", TFT_WHITE, NULL, DRAW, [this]() {
|
||||
display_obj.clearScreen();
|
||||
display_obj.draw_tft = true;
|
||||
});
|
||||
|
||||
// Device menu
|
||||
deviceMenu.parentMenu = &mainMenu;
|
||||
addNodes(&deviceMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(deviceMenu.parentMenu);});
|
||||
addNodes(&deviceMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(deviceMenu.parentMenu);
|
||||
});
|
||||
//addNodes(&deviceMenu, "Update Firmware", TFT_ORANGE, NULL, UPDATE, [this](){wifi_scan_obj.currentScanMode = OTA_UPDATE; changeMenu(&updateMenu); web_obj.setupOTAupdate();});
|
||||
addNodes(&deviceMenu, "Update Firmware", TFT_ORANGE, NULL, UPDATE, [this](){wifi_scan_obj.currentScanMode = OTA_UPDATE; changeMenu(&whichUpdateMenu);});
|
||||
addNodes(&deviceMenu, "Device Info", TFT_WHITE, NULL, DEVICE_INFO, [this](){wifi_scan_obj.currentScanMode = SHOW_INFO; changeMenu(&infoMenu); wifi_scan_obj.RunInfo();});
|
||||
addNodes(&deviceMenu, "Update Firmware", TFT_ORANGE, NULL, UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
changeMenu(&whichUpdateMenu);
|
||||
});
|
||||
addNodes(&deviceMenu, "Device Info", TFT_WHITE, NULL, DEVICE_INFO, [this]() {
|
||||
wifi_scan_obj.currentScanMode = SHOW_INFO;
|
||||
changeMenu(&infoMenu);
|
||||
wifi_scan_obj.RunInfo();
|
||||
});
|
||||
//addNodes(&deviceMenu, "Join WiFi", TFT_YELLOW, NULL, SNIFFERS, [this](){display_obj.clearScreen(); wifi_scan_obj.currentScanMode = LV_JOIN_WIFI; wifi_scan_obj.StartScan(LV_JOIN_WIFI, TFT_YELLOW);});
|
||||
|
||||
// Select update
|
||||
whichUpdateMenu.parentMenu = &deviceMenu;
|
||||
addNodes(&whichUpdateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(whichUpdateMenu.parentMenu);});
|
||||
addNodes(&whichUpdateMenu, "Web Update", TFT_GREEN, NULL, WEB_UPDATE, [this](){wifi_scan_obj.currentScanMode = OTA_UPDATE; changeMenu(&updateMenu); web_obj.setupOTAupdate();});
|
||||
if (sd_obj.supported) addNodes(&whichUpdateMenu, "SD Update", TFT_MAGENTA, NULL, SD_UPDATE, [this](){wifi_scan_obj.currentScanMode = OTA_UPDATE; changeMenu(&confirmMenu);});
|
||||
addNodes(&whichUpdateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(whichUpdateMenu.parentMenu);
|
||||
});
|
||||
addNodes(&whichUpdateMenu, "Web Update", TFT_GREEN, NULL, WEB_UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
changeMenu(&updateMenu);
|
||||
web_obj.setupOTAupdate();
|
||||
});
|
||||
if (sd_obj.supported) addNodes(&whichUpdateMenu, "SD Update", TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
changeMenu(&confirmMenu);
|
||||
});
|
||||
|
||||
// Confirm SD update menu
|
||||
confirmMenu.parentMenu = &whichUpdateMenu;
|
||||
addNodes(&confirmMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){changeMenu(confirmMenu.parentMenu);});
|
||||
addNodes(&confirmMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
changeMenu(confirmMenu.parentMenu);
|
||||
});
|
||||
//addNodes(&confirmMenu, "Yes", TFT_ORANGE, NULL, UPDATE, [this](){wifi_scan_obj.currentScanMode = OTA_UPDATE; changeMenu(&updateMenu); sd_obj.runUpdate();});
|
||||
addNodes(&confirmMenu, "Yes", TFT_ORANGE, NULL, UPDATE, [this](){wifi_scan_obj.currentScanMode = OTA_UPDATE; changeMenu(&failedUpdateMenu); sd_obj.runUpdate();});
|
||||
addNodes(&confirmMenu, "Yes", TFT_ORANGE, NULL, UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
changeMenu(&failedUpdateMenu);
|
||||
sd_obj.runUpdate();
|
||||
});
|
||||
|
||||
// Web Update
|
||||
updateMenu.parentMenu = &deviceMenu;
|
||||
addNodes(&updateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; changeMenu(updateMenu.parentMenu); WiFi.softAPdisconnect(true); web_obj.shutdownServer();});
|
||||
addNodes(&updateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
changeMenu(updateMenu.parentMenu);
|
||||
WiFi.softAPdisconnect(true);
|
||||
web_obj.shutdownServer();
|
||||
});
|
||||
//addNodes(&updateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; changeMenu(updateMenu.parentMenu);});
|
||||
|
||||
// Failed update menu
|
||||
failedUpdateMenu.parentMenu = &whichUpdateMenu;
|
||||
addNodes(&failedUpdateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; changeMenu(failedUpdateMenu.parentMenu);});
|
||||
addNodes(&failedUpdateMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
changeMenu(failedUpdateMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Device info menu
|
||||
infoMenu.parentMenu = &deviceMenu;
|
||||
addNodes(&infoMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this](){wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; changeMenu(infoMenu.parentMenu);});
|
||||
addNodes(&infoMenu, "Back", TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
changeMenu(infoMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Set the current menu to the mainMenu
|
||||
changeMenu(&mainMenu);
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
#ifndef MenuFunctions_h
|
||||
#define MenuFunctions_h
|
||||
|
||||
#define BATTERY_ANALOG_ON 0
|
||||
|
||||
#include "WiFiScan.h"
|
||||
#include "Display.h"
|
||||
#include "BatteryInterface.h"
|
||||
#include "SDInterface.h"
|
||||
#include "Web.h"
|
||||
|
||||
|
||||
extern Display display_obj;
|
||||
extern WiFiScan wifi_scan_obj;
|
||||
extern Web web_obj;
|
||||
@@ -28,6 +31,12 @@ extern BatteryInterface battery_obj;
|
||||
|
||||
#define FLASH_BUTTON 0
|
||||
|
||||
#if BATTERY_ANALOG_ON == 1
|
||||
#define BATTERY_PIN 13
|
||||
#define ANALOG_PIN 34
|
||||
#define CHARGING_PIN 27
|
||||
#endif
|
||||
|
||||
// Icon definitions
|
||||
#define ATTACKS 0
|
||||
#define BEACON_SNIFF 1
|
||||
@@ -119,6 +128,8 @@ class MenuFunctions
|
||||
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
|
||||
void drawStatusBar();
|
||||
void updateStatusBar();
|
||||
void battery(bool initial = false);
|
||||
void battery2(bool initial = false);
|
||||
void showMenuList(Menu* menu, int layer);
|
||||
void orientDisplay();
|
||||
|
||||
|
||||
BIN
esp32_marauder/data/marauder3L1.jpg
Normal file
BIN
esp32_marauder/data/marauder3L1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -58,6 +58,10 @@ void setup()
|
||||
pinMode(FLASH_BUTTON, INPUT);
|
||||
pinMode(TFT_BL, OUTPUT);
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
#if BATTERY_ANALOG_ON == 1
|
||||
pinMode(BATTERY_PIN, OUTPUT);
|
||||
pinMode(CHARGING_PIN, INPUT);
|
||||
#endif
|
||||
|
||||
// Preset SPI CS pins to avoid bus conflicts
|
||||
digitalWrite(TFT_CS, HIGH);
|
||||
|
||||
Reference in New Issue
Block a user