Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve UI (v2 branch) #1670

Open
wants to merge 4 commits into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion esp8266_deauther/CLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ void CLI::runCommand(String input) {
}

// ===== SEND ===== //
// send deauth <apMac> <stMac> <rason> <channel>
// send deauth <apMac> <stMac> <reason> <channel>
else if (eqlsCMD(0, CLI_SEND) && (list->size() == 6) && eqlsCMD(1, CLI_DEAUTH)) {
uint8_t apMac[6];
uint8_t stMac[6];
Expand Down
32 changes: 16 additions & 16 deletions esp8266_deauther/DisplayUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void DisplayUI::setup() {

// MAIN MENU
createMenu(&mainMenu, NULL, [this]() {
addMenuNode(&mainMenu, D_SCAN, &scanMenu); /// SCAN
addMenuNode(&mainMenu, D_SCAN, &scanMenu); // SCAN
addMenuNode(&mainMenu, D_SHOW, &showMenu); // SHOW
addMenuNode(&mainMenu, D_ATTACK, &attackMenu); // ATTACK
addMenuNode(&mainMenu, D_PACKET_MONITOR, [this]() { // PACKET MONITOR
Expand Down Expand Up @@ -263,19 +263,19 @@ void DisplayUI::setup() {
accesspoints.getSelected(selectedID) ? accesspoints.deselect(selectedID) : accesspoints.select(selectedID);
});
addMenuNode(&apMenu, [this]() {
return str(D_ENCRYPTION) + accesspoints.getEncStr(selectedID);
return leftRight(str(D_ENCRYPTION), accesspoints.getEncStr(selectedID), maxLen - 1);
}, NULL); // Encryption: -/WPA2
addMenuNode(&apMenu, [this]() {
return str(D_RSSI) + (String)accesspoints.getRSSI(selectedID);
return leftRight(str(D_RSSI), (String)accesspoints.getRSSI(selectedID), maxLen - 1);
}, NULL); // RSSI: -90
addMenuNode(&apMenu, [this]() {
return str(D_CHANNEL) + (String)accesspoints.getCh(selectedID);
return leftRight(str(D_CHANNEL), (String)accesspoints.getCh(selectedID), maxLen - 1);
}, NULL); // Channel: 11
addMenuNode(&apMenu, [this]() {
return accesspoints.getMacStr(selectedID);
}, NULL); // 00:11:22:00:11:22
addMenuNode(&apMenu, [this]() {
return str(D_VENDOR) + accesspoints.getVendorStr(selectedID);
return leftRight(str(D_VENDOR), accesspoints.getVendorStr(selectedID), maxLen - 1);
}, NULL); // Vendor: INTEL
addMenuNode(&apMenu, [this]() {
return accesspoints.getSelected(selectedID) ? str(D_DESELECT) : str(D_SELECT); // SELECT/DESELECT
Expand Down Expand Up @@ -307,10 +307,10 @@ void DisplayUI::setup() {
return stations.getMacStr(selectedID);
}, NULL); // 00:11:22:00:11:22
addMenuNode(&stationMenu, [this]() {
return str(D_VENDOR) + stations.getVendorStr(selectedID);
return leftRight(str(D_VENDOR), stations.getVendorStr(selectedID), maxLen - 1);
}, NULL); // Vendor: INTEL
addMenuNode(&stationMenu, [this]() {
return str(D_AP) + stations.getAPStr(selectedID); // AP: someAP
return leftRight(str(D_AP), stations.getAPStr(selectedID), maxLen - 1); // AP: someAP
}, [this]() {
int apID = accesspoints.find(stations.getAP(selectedID));

Expand All @@ -320,13 +320,13 @@ void DisplayUI::setup() {
}
});
addMenuNode(&stationMenu, [this]() {
return str(D_PKTS) + String(*stations.getPkts(selectedID));
return leftRight(str(D_PKTS), String(*stations.getPkts(selectedID)), maxLen - 1);
}, NULL); // Pkts: 12
addMenuNode(&stationMenu, [this]() {
return str(D_CHANNEL) + String(stations.getCh(selectedID));
return leftRight(str(D_CHANNEL), String(stations.getCh(selectedID)), maxLen - 1);
}, NULL); // Channel: 11
addMenuNode(&stationMenu, [this]() {
return str(D_SEEN) + stations.getTimeStr(selectedID);
return leftRight(str(D_SEEN), stations.getTimeStr(selectedID), maxLen - 1);
}, NULL); // Seen: <1min

addMenuNode(&stationMenu, [this]() {
Expand All @@ -352,13 +352,13 @@ void DisplayUI::setup() {
return names.getMacStr(selectedID);
}, NULL); // 00:11:22:00:11:22
addMenuNode(&nameMenu, [this]() {
return str(D_VENDOR) + names.getVendorStr(selectedID);
return leftRight(str(D_VENDOR), names.getVendorStr(selectedID), maxLen - 1);
}, NULL); // Vendor: INTEL
addMenuNode(&nameMenu, [this]() {
return str(D_AP) + names.getBssidStr(selectedID);
return leftRight(str(D_AP), names.getBssidStr(selectedID), maxLen - 1);
}, NULL); // AP: 00:11:22:00:11:22
addMenuNode(&nameMenu, [this]() {
return str(D_CHANNEL) + (String)names.getCh(selectedID);
return leftRight(str(D_CHANNEL), (String)names.getCh(selectedID), maxLen - 1);
}, NULL); // Channel: 11

addMenuNode(&nameMenu, [this]() {
Expand All @@ -379,7 +379,7 @@ void DisplayUI::setup() {
return ssids.getName(selectedID).substring(0, ssids.getLen(selectedID));
}, NULL); // SSID
addMenuNode(&ssidMenu, [this]() {
return str(D_ENCRYPTION) + ssids.getEncStr(selectedID); // WPA2
return leftRight(str(D_ENCRYPTION), ssids.getEncStr(selectedID), maxLen - 1); // WPA2
}, [this]() {
ssids.setWPA2(selectedID, !ssids.getWPA2(selectedID));
});
Expand Down Expand Up @@ -772,14 +772,14 @@ void DisplayUI::drawLoadingScan() {
drawString(0, leftRight(str(DSP_SCAN_FOR), scan.getMode(), maxLen));
drawString(1, leftRight(str(DSP_APS), String(accesspoints.count()), maxLen));
drawString(2, leftRight(str(DSP_STS), String(stations.count()), maxLen));
drawString(3, leftRight(str(DSP_PKTS), String(scan.getPacketRate()) + str(DSP_S), maxLen));
drawString(3, leftRight(str(D_PKTRATE), String(scan.getPacketRate()), maxLen));
drawString(4, center(percentage, maxLen));
}

void DisplayUI::drawPacketMonitor() {
double scale = scan.getScaleFactor(sreenHeight - lineHeight - 2);

String headline = leftRight(str(D_CH) + getChannel() + String(' ') + String('[') + String(scan.deauths) + String(']'), String(scan.getPacketRate()) + str(D_PKTS), maxLen);
String headline = leftRight(str(D_CH) + getChannel() + String(' ') + String('[') + String(scan.deauths) + String(']'), String(scan.getPacketRate()) + str(D_PKTRATE), maxLen);

drawString(0, 0, headline);

Expand Down
12 changes: 6 additions & 6 deletions esp8266_deauther/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern void prntln(const uint32_t i);

// ===== GLOBAL STRINGS ===== //

// Often used characters, therefor in the RAM
// Often used characters, therefore in the RAM
const char CURSOR = '|';
const char SPACE = ' ';
const char DOUBLEPOINT = ':';
Expand Down Expand Up @@ -198,7 +198,7 @@ const char CLI_HELP_CHICKEN[] PROGMEM = "chicken";
const char CLI_HELP_REBOOT[] PROGMEM = "reboot";
const char CLI_HELP_INFO[] PROGMEM = "info";
const char CLI_HELP_COMMENT[] PROGMEM = "// <comments>";
const char CLI_HELP_SEND_DEAUTH[] PROGMEM = "send deauth <apMac> <stMac> <rason> <channel>";
const char CLI_HELP_SEND_DEAUTH[] PROGMEM = "send deauth <apMac> <stMac> <reason> <channel>";
const char CLI_HELP_SEND_BEACON[] PROGMEM = "send beacon <mac> <ssid> <ch> [wpa2]";
const char CLI_HELP_SEND_PROBE[] PROGMEM = "send probe <mac> <ssid> <ch>";
const char CLI_HELP_LED_A[] PROGMEM = "led <r> <g> <b>";
Expand Down Expand Up @@ -336,7 +336,6 @@ const char D_MSG_DISPLAY_ON[] PROGMEM = "Turned display on";
const char DSP_SCAN_FOR[] PROGMEM = "Scan for";
const char DSP_APS[] PROGMEM = "APs";
const char DSP_STS[] PROGMEM = "STs";
const char DSP_PKTS[] PROGMEM = "Pkts";
const char DSP_S[] PROGMEM = "/s";
const char DSP_SCAN_DONE[] PROGMEM = "Done";

Expand Down Expand Up @@ -397,7 +396,8 @@ const char D_CHANNEL[] PROGMEM = "Channel:";
const char D_CH[] PROGMEM = "Ch";
const char D_VENDOR[] PROGMEM = "Vendor:";
const char D_AP[] PROGMEM = "AP:";
const char D_PKTS[] PROGMEM = "pkts";
const char D_PKTS[] PROGMEM = "Pkts:";
const char D_PKTRATE[] PROGMEM = "Pkt/s";
const char D_SEEN[] PROGMEM = "Seen:";

// ===== STATIONS ===== //
Expand Down Expand Up @@ -503,8 +503,8 @@ const char SC_RESTRAT[] PROGMEM = "Scan will restart in ";
const char SC_CONTINUE[] PROGMEM = "s - type stop to disable the continuous mode";
const char SC_RESTART[] PROGMEM = "restarting in ";
const char SC_ERROR_MODE[] PROGMEM = "ERROR: Invalid scan mode ";
const char SC_OUTPUT_A[] PROGMEM = "Scanning WiFi [%+2u%%]: %+3u packets/s | %+2u devices | %+2u deauths\r\n";
const char SC_OUTPUT_B[] PROGMEM = "Scanning WiFi: %+3u packets/s | %+2u devices | %+2u deauths\r\n";
const char SC_OUTPUT_A[] PROGMEM = "Scanning WiFi [%+2u%%]: %+4u packets/s | %+2u devices | %+2u deauths\r\n";
const char SC_OUTPUT_B[] PROGMEM = "Scanning WiFi: %+4u packets/s | %+2u devices | %+2u deauths\r\n";
const char SC_JSON_APS[] PROGMEM = "aps";
const char SC_JSON_STATIONS[] PROGMEM = "stations";
const char SC_JSON_NAMES[] PROGMEM = "names";
Expand Down
4 changes: 2 additions & 2 deletions serialcommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- [`write <file> <commands>`](#write)
- [`info`](#info)
- [`// <comments>`](#comment)
- [`send deauth <apMac> <stMac> <rason> <channel>`](#send)
- [`send deauth <apMac> <stMac> <reason> <channel>`](#send)
- [`send beacon <mac> <ssid> <ch> [wpa2]`](#send)
- [`send probe <mac> <ssid> <ch>`](#send)
- [`led <r> <g> <b> [<brightness>]`](#led)
Expand Down Expand Up @@ -263,7 +263,7 @@ Please don't use this command within a script! It won't work but it might lead t
## WRITE
`write <file> <commands>`
Writes (appends) a command to the given file and saves it.
**Please note** that this command has, like all commands, a limit of 512 characters and therefor shouldn't be used
**Please note** that this command has, like all commands, a limit of 512 characters and therefore shouldn't be used
to write extensive files. There is a better way to upload files to the SPIFFS explained in the tutorials.md file.

## INFO
Expand Down