mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-08-02 00:47:56 -07:00
Merge branch 'StickCPlus-2-port' into master
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -209,7 +209,13 @@ PROGMEM static const unsigned char menu_icons[][66] = {
|
||||
0xBB, 0x63, 0x38, 0x87, 0x3C, 0x3E, 0xFB, 0x0F, 0x3F, 0xFF, 0x81, 0x3F,
|
||||
0xFF, 0x3F, 0x38, 0xFF, 0xFF, 0x3C, 0xFF, 0x07, 0x3E, 0xFF, 0xEB, 0x3F,
|
||||
0xFF, 0xEF, 0x3F, 0xFF, 0xEF, 0x3F, 0xFF, 0xDF, 0x3F, 0xFF, 0xFF, 0x3F,
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F}
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
|
||||
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // BLANK: 36
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
|
||||
};
|
||||
|
||||
/*#ifndef MARAUDER_MINI
|
||||
|
||||
@@ -110,6 +110,14 @@ int8_t BatteryInterface::getBatteryLevel() {
|
||||
|
||||
|
||||
if (this->has_max17048) {
|
||||
return this->maxlipo.cellPercent();
|
||||
float percent = this->maxlipo.cellPercent();
|
||||
|
||||
// Sometimes we dumb
|
||||
if (percent >= 100)
|
||||
return 100;
|
||||
else if (percent <= 0)
|
||||
return 0;
|
||||
else
|
||||
return percent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,13 +283,42 @@ void Display::scrollScreenBuffer(bool down) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void Display::processAndPrintString(TFT_eSPI& tft, const String& originalString) {
|
||||
// Define colors
|
||||
uint16_t text_color = TFT_GREEN; // Default text color
|
||||
uint16_t background_color = TFT_BLACK; // Default background color
|
||||
|
||||
String new_string = originalString;
|
||||
|
||||
// Check for color macros at the start of the string
|
||||
if (new_string.startsWith(RED_KEY)) {
|
||||
text_color = TFT_RED;
|
||||
new_string.remove(0, strlen(RED_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(GREEN_KEY)) {
|
||||
text_color = TFT_GREEN;
|
||||
new_string.remove(0, strlen(GREEN_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(CYAN_KEY)) {
|
||||
text_color = TFT_CYAN;
|
||||
new_string.remove(0, strlen(CYAN_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(WHITE_KEY)) {
|
||||
text_color = TFT_WHITE;
|
||||
new_string.remove(0, strlen(WHITE_KEY)); // Remove the macro
|
||||
} else if (new_string.startsWith(MAGENTA_KEY)) {
|
||||
text_color = TFT_MAGENTA;
|
||||
new_string.remove(0, strlen(MAGENTA_KEY)); // Remove the macro
|
||||
}
|
||||
|
||||
// Set text color and print the string
|
||||
tft.setTextColor(text_color, background_color);
|
||||
tft.print(new_string);
|
||||
}
|
||||
|
||||
void Display::displayBuffer(bool do_clear)
|
||||
{
|
||||
if (this->display_buffer->size() > 0)
|
||||
{
|
||||
delay(1);
|
||||
|
||||
while (display_buffer->size() > 0)
|
||||
int print_count = 1;
|
||||
while ((display_buffer->size() > 0) && (print_count > 0))
|
||||
{
|
||||
|
||||
#ifndef SCREEN_BUFFER
|
||||
@@ -318,13 +347,19 @@ void Display::displayBuffer(bool do_clear)
|
||||
|
||||
for (int i = 0; i < this->screen_buffer->size(); i++) {
|
||||
tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
|
||||
for (int x = 0; x < TFT_WIDTH / CHAR_WIDTH; x++)
|
||||
tft.print(" ");
|
||||
String spaces = String(' ', TFT_WIDTH / CHAR_WIDTH);
|
||||
//for (int x = 0; x < TFT_WIDTH / CHAR_WIDTH; x++)
|
||||
// tft.print(" ");
|
||||
tft.print(spaces);
|
||||
tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
|
||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
tft.print(this->screen_buffer->get(i));
|
||||
|
||||
this->processAndPrintString(tft, this->screen_buffer->get(i));
|
||||
//tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
//tft.print(this->screen_buffer->get(i));
|
||||
}
|
||||
#endif
|
||||
|
||||
print_count--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,12 @@
|
||||
#define LV_ADD_SSID 14
|
||||
#define WIFI_ATTACK_BEACON_LIST 15
|
||||
|
||||
#define RED_KEY ";red;"
|
||||
#define GREEN_KEY ";grn;"
|
||||
#define CYAN_KEY ";cyn;"
|
||||
#define MAGENTA_KEY ";mgn;"
|
||||
#define WHITE_KEY ";wht;"
|
||||
|
||||
class Display
|
||||
{
|
||||
private:
|
||||
@@ -58,6 +64,7 @@ class Display
|
||||
#ifdef SCREEN_BUFFER
|
||||
void scrollScreenBuffer(bool down = false);
|
||||
#endif
|
||||
void processAndPrintString(TFT_eSPI& tft, const String& originalString);
|
||||
|
||||
public:
|
||||
Display();
|
||||
|
||||
@@ -574,7 +574,7 @@ void MenuFunctions::buttonNotSelected(uint8_t b, int8_t x) {
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
display_obj.tft.setFreeFont(MENU_FONT);
|
||||
display_obj.key[b].drawButton(false, current_menu->list->get(x).name);
|
||||
if (current_menu->list->get(x).name != text09)
|
||||
if ((current_menu->list->get(x).name != text09) && (current_menu->list->get(x).icon != 255))
|
||||
display_obj.tft.drawXBitmap(0,
|
||||
KEY_Y + x * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
menu_icons[current_menu->list->get(x).icon],
|
||||
@@ -599,7 +599,7 @@ void MenuFunctions::buttonSelected(uint8_t b, int8_t x) {
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
display_obj.tft.setFreeFont(MENU_FONT);
|
||||
display_obj.key[b].drawButton(true, current_menu->list->get(x).name);
|
||||
if (current_menu->list->get(x).name != text09)
|
||||
if ((current_menu->list->get(x).name != text09) && (current_menu->list->get(x).icon != 255))
|
||||
display_obj.tft.drawXBitmap(0,
|
||||
KEY_Y + x * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
menu_icons[current_menu->list->get(x).icon],
|
||||
@@ -1769,18 +1769,24 @@ void MenuFunctions::RunSetup()
|
||||
});
|
||||
|
||||
// Select APs on Mini
|
||||
this->addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
this->addNodes(&wifiGeneralMenu, "Select APs", TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||
// Add the back button
|
||||
wifiAPMenu.list->clear();
|
||||
this->addNodes(&wifiAPMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
this->changeMenu(wifiAPMenu.parentMenu);
|
||||
});
|
||||
|
||||
// Determine how big the whole menu is going to be
|
||||
int menu_limit;
|
||||
if (access_points->size() <= BUTTON_ARRAY_LEN)
|
||||
menu_limit = access_points->size();
|
||||
else
|
||||
menu_limit = BUTTON_ARRAY_LEN;
|
||||
|
||||
// Populate the menu with buttons
|
||||
for (int i = 0; i < menu_limit - 1; i++) {
|
||||
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFT_CYAN, NULL, KEYBOARD_ICO, [this, i](){
|
||||
// This is the menu node
|
||||
this->addNodes(&wifiAPMenu, access_points->get(i).essid, TFT_CYAN, NULL, 255, [this, i](){
|
||||
AccessPoint new_ap = access_points->get(i);
|
||||
new_ap.selected = !access_points->get(i).selected;
|
||||
|
||||
@@ -2630,18 +2636,18 @@ void MenuFunctions::displayCurrentMenu(uint8_t start_index)
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
#ifndef HAS_ILI9341
|
||||
if ((current_menu->list->get(i).selected) || (current_menu->selected == i)) {
|
||||
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);
|
||||
}
|
||||
#else
|
||||
display_obj.key[i].drawButton(false, current_menu->list->get(i).name);
|
||||
#endif
|
||||
|
||||
if (current_menu->list->get(i).name != text09)
|
||||
if ((current_menu->list->get(i).name != text09) && (current_menu->list->get(i).icon != 255))
|
||||
display_obj.tft.drawXBitmap(0,
|
||||
KEY_Y + i * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
KEY_Y + (i - start_index) * (KEY_H + KEY_SPACING_Y) - (ICON_H / 2),
|
||||
menu_icons[current_menu->list->get(i).icon],
|
||||
ICON_W,
|
||||
ICON_H,
|
||||
|
||||
@@ -73,6 +73,7 @@ extern Settings settings_obj;
|
||||
#define GPS_MENU 33
|
||||
#define DISABLE_TOUCH 34
|
||||
#define FLIPPER 35
|
||||
#define BLANK 36
|
||||
|
||||
PROGMEM void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p);
|
||||
PROGMEM bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data);
|
||||
|
||||
+79
-50
@@ -1999,7 +1999,7 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.setTextColor(TFT_WHITE, color);
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
display_obj.tft.fillRect(0,16,240,16, color);
|
||||
display_obj.tft.drawCentreString(text_table4[38],120,16,2);
|
||||
display_obj.tft.drawCentreString(text_table1[45],120,16,2);
|
||||
#endif
|
||||
#ifdef HAS_ILI9341
|
||||
display_obj.touchToExit();
|
||||
@@ -3040,7 +3040,7 @@ void WiFiScan::apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
|
||||
if (!in_list) {
|
||||
|
||||
delay(random(0, 10));
|
||||
//delay(random(0, 10));
|
||||
Serial.print("RSSI: ");
|
||||
Serial.print(snifferPacket->rx_ctrl.rssi);
|
||||
Serial.print(" Ch: ");
|
||||
@@ -3086,12 +3086,12 @@ void WiFiScan::apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
Serial.print(" ");
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
if (display_obj.display_buffer->size() == 0)
|
||||
{
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
}
|
||||
//if (display_obj.display_buffer->size() == 0)
|
||||
//{
|
||||
//display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
//display_obj.loading = false;
|
||||
//}
|
||||
#endif
|
||||
|
||||
if (essid == "") {
|
||||
@@ -3246,12 +3246,12 @@ void WiFiScan::apSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
Serial.print(" ");
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
if (display_obj.display_buffer->size() == 0)
|
||||
{
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
}
|
||||
//if (display_obj.display_buffer->size() == 0)
|
||||
//{
|
||||
// display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
// display_obj.loading = false;
|
||||
//}
|
||||
#endif
|
||||
|
||||
if (essid == "") {
|
||||
@@ -4547,48 +4547,77 @@ void WiFiScan::wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
const WifiMgmtHdr *hdr = &ipkt->hdr;
|
||||
|
||||
// If we dont the buffer size is not 0, don't write or else we get CORRUPT_HEAP
|
||||
#ifdef HAS_ILI9341
|
||||
if (snifferPacket->payload[0] == 0x80)
|
||||
{
|
||||
num_beacon++;
|
||||
}
|
||||
else if ((snifferPacket->payload[0] == 0xA0 || snifferPacket->payload[0] == 0xC0 ))
|
||||
{
|
||||
num_deauth++;
|
||||
}
|
||||
else if (snifferPacket->payload[0] == 0x40)
|
||||
{
|
||||
num_probe++;
|
||||
}
|
||||
#endif
|
||||
|
||||
char addr[] = "00:00:00:00:00:00";
|
||||
getMAC(addr, snifferPacket->payload, 10);
|
||||
display_string.concat(addr);
|
||||
|
||||
int temp_len = display_string.length();
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
for (int i = 0; i < 40 - temp_len; i++)
|
||||
{
|
||||
display_string.concat(" ");
|
||||
}
|
||||
|
||||
//Serial.print(" ");
|
||||
|
||||
#ifdef SCREEN_BUFFER
|
||||
if (display_obj.display_buffer->size() == 0)
|
||||
#ifdef HAS_ILI9341
|
||||
if (snifferPacket->payload[0] == 0x80)
|
||||
{
|
||||
display_obj.loading = true;
|
||||
display_obj.display_buffer->add(display_string);
|
||||
display_obj.loading = false;
|
||||
Serial.println(display_string);
|
||||
num_beacon++;
|
||||
}
|
||||
else if ((snifferPacket->payload[0] == 0xA0 || snifferPacket->payload[0] == 0xC0 ))
|
||||
{
|
||||
num_deauth++;
|
||||
}
|
||||
else if (snifferPacket->payload[0] == 0x40)
|
||||
{
|
||||
num_probe++;
|
||||
}
|
||||
#else
|
||||
if (snifferPacket->payload[0] == 0x80)
|
||||
display_string.concat(";grn;");
|
||||
else if ((snifferPacket->payload[0] == 0xA0 || snifferPacket->payload[0] == 0xC0 ))
|
||||
display_string.concat(";red;");
|
||||
else if (snifferPacket->payload[0] == 0x40)
|
||||
display_string.concat(";cyn;");
|
||||
else
|
||||
display_string.concat(";mgn;");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
else {
|
||||
#ifdef HAS_SCREEN
|
||||
#ifndef HAS_ILI9341
|
||||
display_string.concat(";wht;");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
char src_addr[] = "00:00:00:00:00:00";
|
||||
char dst_addr[] = "00:00:00:00:00:00";
|
||||
getMAC(src_addr, snifferPacket->payload, 10);
|
||||
getMAC(dst_addr, snifferPacket->payload, 4);
|
||||
display_string.concat(src_addr);
|
||||
display_string.concat(" -> ");
|
||||
display_string.concat(dst_addr);
|
||||
|
||||
int temp_len = display_string.length();
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
// Fill blank space
|
||||
for (int i = 0; i < 40 - temp_len; i++)
|
||||
{
|
||||
display_string.concat(" ");
|
||||
}
|
||||
|
||||
//Serial.print(" ");
|
||||
|
||||
#ifdef SCREEN_BUFFER
|
||||
//if (display_obj.display_buffer->size() == 0)
|
||||
//{
|
||||
// display_obj.loading = true;
|
||||
//while(display_obj.display_buffer->size() >= 10)
|
||||
// delay(10);
|
||||
if (display_obj.display_buffer->size() >= 10)
|
||||
return;
|
||||
|
||||
display_obj.display_buffer->add(display_string);
|
||||
// display_obj.loading = false;
|
||||
Serial.println(display_string);
|
||||
//}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
//}
|
||||
}
|
||||
|
||||
void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//#define MARAUDER_REV_FEATHER
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v1.2.0"
|
||||
#define MARAUDER_VERSION "v1.2.1"
|
||||
|
||||
//// HARDWARE NAMES
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user