mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-07-30 23:50:26 -07:00
Merge pull request #1124 from justcallmekoko/develop
toggle channel hop for beacon sniff
This commit is contained in:
@@ -382,6 +382,64 @@ void Display::tftDrawChannelScaleButtons(int set_channel, bool lnd_an)
|
||||
key[5].drawButton();
|
||||
}
|
||||
|
||||
void Display::tftDrawChanHopButton(bool lnd_an, bool en) {
|
||||
if (lnd_an) {
|
||||
if (!en) {
|
||||
key[7].initButton(&tft, // Exit box
|
||||
137,
|
||||
10, // x, y, w, h, outline, fill, text
|
||||
EXT_BUTTON_WIDTH,
|
||||
EXT_BUTTON_WIDTH,
|
||||
TFT_ORANGE, // Outline
|
||||
TFT_RED, // Fill
|
||||
TFT_BLACK, // Text
|
||||
"X",
|
||||
2);
|
||||
} else {
|
||||
key[7].initButton(&tft, // Exit box
|
||||
137,
|
||||
10, // x, y, w, h, outline, fill, text
|
||||
EXT_BUTTON_WIDTH,
|
||||
EXT_BUTTON_WIDTH,
|
||||
TFT_WHITE, // Outline
|
||||
TFT_GREEN, // Fill
|
||||
TFT_BLACK, // Text
|
||||
"O",
|
||||
2);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
if (!en) {
|
||||
key[7].initButton(&tft, // Exit box
|
||||
(EXT_BUTTON_WIDTH / 2) * 14,
|
||||
(STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, // x, y, w, h, outline, fill, text
|
||||
EXT_BUTTON_WIDTH,
|
||||
EXT_BUTTON_WIDTH,
|
||||
TFT_ORANGE, // Outline
|
||||
TFT_RED, // Fill
|
||||
TFT_BLACK, // Text
|
||||
"HOP",
|
||||
1);
|
||||
} else {
|
||||
key[7].initButton(&tft, // Exit box
|
||||
(EXT_BUTTON_WIDTH / 2) * 14,
|
||||
(STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, // x, y, w, h, outline, fill, text
|
||||
EXT_BUTTON_WIDTH,
|
||||
EXT_BUTTON_WIDTH,
|
||||
TFT_WHITE, // Outline
|
||||
TFT_GREEN, // Fill
|
||||
TFT_BLACK, // Text
|
||||
"HOP",
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
key[7].setLabelDatum(1, 5, MC_DATUM);
|
||||
|
||||
key[7].drawButton();
|
||||
}
|
||||
|
||||
void Display::tftDrawExitScaleButtons(bool lnd_an)
|
||||
{
|
||||
//tft.drawFastVLine(178, 0, 20, TFT_WHITE);
|
||||
@@ -403,7 +461,7 @@ void Display::tftDrawExitScaleButtons(bool lnd_an)
|
||||
|
||||
else {
|
||||
key[6].initButton(&tft, // Exit box
|
||||
EXT_BUTTON_WIDTH / 2,
|
||||
EXT_BUTTON_WIDTH,
|
||||
(STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, // x, y, w, h, outline, fill, text
|
||||
EXT_BUTTON_WIDTH,
|
||||
EXT_BUTTON_WIDTH,
|
||||
@@ -506,7 +564,7 @@ void Display::displayBuffer(bool do_clear)
|
||||
if (this->display_buffer->size() > 0)
|
||||
{
|
||||
|
||||
int print_count = 10;
|
||||
int print_count = 2;
|
||||
|
||||
while ((display_buffer->size() > 0) && (print_count > 0))
|
||||
{
|
||||
@@ -539,10 +597,11 @@ void Display::displayBuffer(bool do_clear)
|
||||
screen_buffer->add(display_buffer->shift());
|
||||
|
||||
for (int i = 0; i < this->screen_buffer->size(); i++) {
|
||||
//tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
|
||||
//String spaces = String(' ', TFT_WIDTH / CHAR_WIDTH);
|
||||
//tft.print(spaces);
|
||||
tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
|
||||
#ifdef HAS_TOUCH
|
||||
tft.setCursor(xPos, (i * 12) + ((TFT_HEIGHT / 6) * 1.1));
|
||||
#else
|
||||
tft.setCursor(xPos, (i * 12) + (TFT_HEIGHT / 6));
|
||||
#endif
|
||||
|
||||
this->processAndPrintString(tft, this->screen_buffer->get(i));
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class Display
|
||||
public:
|
||||
Display();
|
||||
TFT_eSPI tft = TFT_eSPI();
|
||||
TFT_eSPI_Button key[BUTTON_ARRAY_LEN + 3];
|
||||
TFT_eSPI_Button key[BUTTON_ARRAY_LEN + 4];
|
||||
const String PROGMEM version_number = MARAUDER_VERSION;
|
||||
|
||||
#ifdef HAS_CYD_TOUCH
|
||||
@@ -127,6 +127,7 @@ class Display
|
||||
void tftDrawYScaleButtons(byte y_scale);
|
||||
void tftDrawChannelScaleButtons(int set_channel, bool lnd_an = true);
|
||||
void tftDrawExitScaleButtons(bool lnd_an = true);
|
||||
void tftDrawChanHopButton(bool lnd_an = true, bool en = false);
|
||||
void buildBanner(String msg, int xpos);
|
||||
void clearScreen();
|
||||
void displayBuffer(bool do_clear = false);
|
||||
|
||||
@@ -207,7 +207,6 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_DETECT_FOLLOW) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||
@@ -414,6 +413,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_CHAN_ANALYZER) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_CHAN_ACT) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_SIG_STREN) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_AP) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_FUNNY_BEACON) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_RICK_ROLL))
|
||||
|
||||
+46
-54
@@ -4996,11 +4996,19 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.drawCentreString("Wardrive", TFT_WIDTH / 2, 16, 2);
|
||||
}
|
||||
#ifdef HAS_ILI9341
|
||||
display_obj.touchToExit();
|
||||
if (scan_mode != WIFI_SCAN_AP)
|
||||
display_obj.touchToExit();
|
||||
#endif
|
||||
#endif
|
||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
||||
if (scan_mode != WIFI_SCAN_AP)
|
||||
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
|
||||
else {
|
||||
display_obj.setupScrollArea((STATUS_BAR_WIDTH * 2) + CHAR_WIDTH - 1, BOT_FIXED_AREA);
|
||||
display_obj.tftDrawChannelScaleButtons(set_channel, false);
|
||||
display_obj.tftDrawExitScaleButtons(false);
|
||||
display_obj.tftDrawChanHopButton(false, settings_obj.loadSetting<bool>("ChanHop"));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (scan_mode != WIFI_SCAN_WAR_DRIVE) {
|
||||
@@ -10151,32 +10159,36 @@ bool WiFiScan::filterActive() {
|
||||
// Do the touch stuff
|
||||
#ifdef HAS_ILI9341
|
||||
pressed = display_obj.updateTouch(&t_x, &t_y);
|
||||
//pressed = display_obj.tft.getTouch(&t_x, &t_y);
|
||||
#endif
|
||||
|
||||
// Check buttons for presses
|
||||
for (int8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
|
||||
{
|
||||
if (pressed && display_obj.key[b].contains(t_x, t_y))
|
||||
{
|
||||
display_obj.key[b].press(true);
|
||||
} else {
|
||||
display_obj.key[b].press(false);
|
||||
if (pressed) {
|
||||
while(display_obj.updateTouch(&t_x, &t_y)) {
|
||||
|
||||
|
||||
// Check buttons for presses
|
||||
for (int8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
|
||||
{
|
||||
if (pressed && display_obj.key[b].contains(t_x, t_y))
|
||||
display_obj.key[b].press(true);
|
||||
else
|
||||
display_obj.key[b].press(false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
|
||||
display_obj.key[b].press(false);
|
||||
}
|
||||
|
||||
// Which buttons pressed
|
||||
for (int8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
|
||||
{
|
||||
if (display_obj.key[b].justReleased()) return b;
|
||||
}
|
||||
if (display_obj.key[b].justReleased())
|
||||
return b;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
void WiFiScan::eapolMonitorMain(uint32_t currentTime)
|
||||
{
|
||||
void WiFiScan::eapolMonitorMain(uint32_t currentTime) {
|
||||
for (x_pos = (11 + x_scale); x_pos <= 320; x_pos = x_pos)
|
||||
{
|
||||
currentTime = millis();
|
||||
@@ -10288,41 +10300,6 @@ bool WiFiScan::filterActive() {
|
||||
y_pos_x = 0;
|
||||
y_pos_y = 0;
|
||||
y_pos_z = 0;
|
||||
/*boolean pressed = false;
|
||||
|
||||
uint16_t t_x = 0, t_y = 0; // To store the touch coordinates
|
||||
|
||||
// Do the touch stuff
|
||||
#ifdef HAS_ILI9341
|
||||
pressed = display_obj.tft.getTouch(&t_x, &t_y);
|
||||
#endif
|
||||
|
||||
if (pressed) {
|
||||
Serial.print("Got touch | X: ");
|
||||
Serial.print(t_x);
|
||||
Serial.print(" Y: ");
|
||||
Serial.println(t_y);
|
||||
}
|
||||
|
||||
|
||||
// Check buttons for presses
|
||||
for (uint8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
|
||||
{
|
||||
if (pressed && display_obj.key[b].contains(t_x, t_y))
|
||||
{
|
||||
display_obj.key[b].press(true);
|
||||
} else {
|
||||
display_obj.key[b].press(false);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Which buttons pressed
|
||||
//for (uint8_t b = 0; b < BUTTON_ARRAY_LEN; b++)
|
||||
//{
|
||||
|
||||
// if (display_obj.key[b].justReleased())
|
||||
// {
|
||||
// do_break = true;
|
||||
|
||||
int8_t b = this->checkAnalyzerButtons(currentTime);
|
||||
|
||||
@@ -10504,6 +10481,10 @@ void WiFiScan::channelHop(bool filtered, bool ranged)
|
||||
int top_chan = 0;
|
||||
int bot_chan = 0;
|
||||
|
||||
if ((!settings_obj.loadSetting<bool>("ChanHop")) &&
|
||||
(this->currentScanMode == WIFI_SCAN_AP))
|
||||
return;
|
||||
|
||||
if (!filtered) {
|
||||
#ifndef HAS_DUAL_BAND
|
||||
if (ranged) {
|
||||
@@ -10625,7 +10606,7 @@ void WiFiScan::signalAnalyzerLoop(uint32_t tick) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (this->dual_band_channel_index > 1) {
|
||||
if (this->dual_band_channel_index > 0) {
|
||||
this->dual_band_channel_index--;
|
||||
this->set_channel = this->dual_band_channels[this->dual_band_channel_index];
|
||||
display_obj.tftDrawChannelScaleButtons(this->set_channel, false);
|
||||
@@ -10657,6 +10638,13 @@ void WiFiScan::signalAnalyzerLoop(uint32_t tick) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
else if (b == 7) {
|
||||
settings_obj.toggleSetting("ChanHop");
|
||||
this->channel_hop = settings_obj.loadSetting<bool>("ChanHop");
|
||||
display_obj.tftDrawChanHopButton(false, this->channel_hop);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
@@ -11377,11 +11365,15 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
(currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) ||
|
||||
(currentScanMode == WIFI_SCAN_ALL))
|
||||
{
|
||||
if (currentTime - initTime >= this->channel_hop_delay * HOP_DELAY)
|
||||
{
|
||||
if (currentTime - initTime >= this->channel_hop_delay * HOP_DELAY) {
|
||||
initTime = millis();
|
||||
channelHop();
|
||||
}
|
||||
if (currentScanMode == WIFI_SCAN_AP) {
|
||||
#ifdef HAS_ILI9341
|
||||
this->signalAnalyzerLoop(currentTime);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_SAE_COMMIT) {
|
||||
if (currentTime - initTime >= 250) {
|
||||
|
||||
@@ -1115,7 +1115,7 @@
|
||||
|
||||
#define SCREEN_BUFFER
|
||||
|
||||
#define MAX_SCREEN_BUFFER 22
|
||||
#define MAX_SCREEN_BUFFER 21
|
||||
|
||||
#define SCREEN_ORIENTATION 0
|
||||
|
||||
@@ -1189,7 +1189,7 @@
|
||||
|
||||
#define SCREEN_BUFFER
|
||||
|
||||
#define MAX_SCREEN_BUFFER 22
|
||||
#define MAX_SCREEN_BUFFER 21
|
||||
|
||||
#define SCREEN_ORIENTATION 0
|
||||
|
||||
@@ -1258,7 +1258,7 @@
|
||||
|
||||
#define SCREEN_BUFFER
|
||||
|
||||
#define MAX_SCREEN_BUFFER 22
|
||||
#define MAX_SCREEN_BUFFER 21
|
||||
|
||||
#define SCREEN_ORIENTATION 0
|
||||
|
||||
@@ -1328,7 +1328,7 @@
|
||||
|
||||
#define SCREEN_BUFFER
|
||||
|
||||
#define MAX_SCREEN_BUFFER 22
|
||||
#define MAX_SCREEN_BUFFER 21
|
||||
|
||||
#define SCREEN_ORIENTATION 0
|
||||
|
||||
@@ -1471,7 +1471,7 @@
|
||||
|
||||
#define SCREEN_BUFFER
|
||||
|
||||
#define MAX_SCREEN_BUFFER 22
|
||||
#define MAX_SCREEN_BUFFER 21
|
||||
|
||||
#define SCREEN_ORIENTATION 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user