-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
RF Chat beta test #2264
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
Open
mokapi47
wants to merge
16
commits into
BruceDevices:dev
Choose a base branch
from
mokapi47:dev_RF_Chat
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
RF Chat beta test #2264
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
79bc65d
Add BW16Tool class and related structures
uchiha-madara-02 7fae322
Add Bw16Menu class header file
uchiha-madara-02 42196b6
Implement Bw16Menu functionality and drawing methods
uchiha-madara-02 1b1e6a0
Add bw16Menu to MainMenu items
uchiha-madara-02 fb2a9e3
Add Bw16Menu to main menu header
uchiha-madara-02 88aa56b
Add bw16 theme entry to theme.cpp
uchiha-madara-02 914192c
Add bw16 theme file and control boolean
uchiha-madara-02 9c24bfd
Merge pull request #2255 from uchiha-madara-02/patch-7
pr3y 5d5e0f5
Merge pull request #2256 from uchiha-madara-02/patch-6
pr3y c412d6f
Merge pull request #2257 from uchiha-madara-02/patch-9
pr3y e417db9
Merge pull request #2258 from uchiha-madara-02/patch-8
pr3y 60abcc9
Merge pull request #2259 from uchiha-madara-02/patch-5
pr3y f20137b
Merge pull request #2260 from uchiha-madara-02/patch-4
pr3y 65e9025
Merge pull request #2261 from uchiha-madara-02/patch-2
pr3y f136e03
Add files via upload
mokapi47 d98f7e9
Add files via upload
mokapi47 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| #include "Bw16Menu.h" | ||
| #include "core/display.h" | ||
| #include "core/settings.h" | ||
| #include "core/utils.h" | ||
|
|
||
| BW16Tool Bw16Menu::tool; | ||
|
|
||
| void Bw16Menu::optionsMenu() { | ||
| tool.setup(); | ||
|
|
||
| options = { | ||
| {"Bad Ble", [&]() { tool.attckbleMenu(); }}, | ||
| {"Scan WiFi", [&]() { tool.scanWifi(); } }, | ||
| {"Select WiFi", [&]() { tool.selectWifi(); } }, | ||
| {"Attacks", [&]() { attackMenu(); } }, | ||
| {"Config", [this]() { configMenu(); } } | ||
| }; | ||
|
|
||
| addOptionToMainMenu(); | ||
| String txt = "BW16 |TX:" + String(bruceConfigPins.gps_bus.tx) + | ||
| " |RX:" + String(bruceConfigPins.gps_bus.rx) + " | (" + String(bruceConfigPins.gpsBaudrate) + | ||
| " bps)"; | ||
| loopOptions(options, MENU_TYPE_SUBMENU, txt.c_str()); | ||
| } | ||
|
|
||
| void Bw16Menu::attackMenu() { | ||
| options = { | ||
| {"Deauth Selected", [&]() { tool.attackSelected(); }}, | ||
| {"Deauth ALL", [&]() { tool.attackAll(); } }, | ||
| {"Beacon Spam", [&]() { tool.beaconSpam(); } }, | ||
| {"Beacon List", [&]() { tool.beaconList(); } }, | ||
| {"Beacon & Deauth", [&]() { tool.beaconDeauth(); } }, | ||
| {"Evil Portal", [&]() { tool.evilPortal(); } }, | ||
| {"Back", [this]() { optionsMenu(); } } | ||
| }; | ||
| loopOptions(options, MENU_TYPE_SUBMENU, "BW16 Attacks"); | ||
| } | ||
|
|
||
| void Bw16Menu::configMenu() { | ||
| options = { | ||
| {"Baudrate", setGpsBaudrateMenu }, | ||
| {"UART Pins", [=]() { setUARTPinsMenu(bruceConfigPins.gps_bus); }}, | ||
| {"Back", [this]() { optionsMenu(); } } | ||
| }; | ||
| loopOptions(options, MENU_TYPE_SUBMENU, "BW16 Config"); | ||
| } | ||
|
|
||
| void Bw16Menu::drawIcon(float scale) { | ||
| clearIconArea(); | ||
| uint16_t color = bruceConfig.priColor; | ||
| uint16_t bg = bruceConfig.bgColor; | ||
|
|
||
| int minDim = min(tftWidth, tftHeight); | ||
|
|
||
| int basePx; | ||
| if (minDim <= 135) { | ||
| basePx = 4; | ||
| } else if (minDim <= 240) { | ||
| basePx = 5; | ||
| } else if (minDim <= 320) { | ||
| basePx = 6; | ||
| } else { | ||
| basePx = 7; | ||
| } | ||
|
|
||
| float adjustedScale = scale * (minDim / 240.0f); | ||
| adjustedScale = constrain(adjustedScale, 0.8f, 1.2f); | ||
|
|
||
| int px = max(2, (int)(basePx * adjustedScale)); | ||
| int totalW = 24 * px; | ||
| int totalH = 20 * px; | ||
| int x = iconCenterX - totalW / 2; | ||
| int y = iconCenterY - totalH / 2; | ||
|
|
||
| tft.fillRect(x + 2 * px, y, totalW - 4 * px, px, color); | ||
| tft.fillRect(x + 2 * px, y + totalH - px, totalW - 4 * px, px, color); | ||
| tft.fillRect(x, y + 2 * px, px, totalH - 4 * px, color); | ||
| tft.fillRect(x + totalW - px, y + 2 * px, px, totalH - 4 * px, color); | ||
|
|
||
| tft.fillRect(x + px, y + px, px, px, color); | ||
| tft.fillRect(x + totalW - 2 * px, y + px, px, px, color); | ||
| tft.fillRect(x + px, y + totalH - 2 * px, px, px, color); | ||
| tft.fillRect(x + totalW - 2 * px, y + totalH - 2 * px, px, px, color); | ||
|
|
||
| int wy = y + 3 * px; | ||
| int wx = x + 2 * px; | ||
|
|
||
| tft.fillRect(wx, wy, px, 5 * px, color); | ||
| tft.fillRect(wx + 2 * px, wy + 2 * px, px, 3 * px, color); | ||
| tft.fillRect(wx + 4 * px, wy + 2 * px, px, 3 * px, color); | ||
| tft.fillRect(wx + 6 * px, wy, px, 5 * px, color); | ||
| tft.fillRect(wx + 1 * px, wy + 5 * px, px, px, color); | ||
| tft.fillRect(wx + 3 * px, wy + 4 * px, px, px, color); | ||
| tft.fillRect(wx + 5 * px, wy + 5 * px, px, px, color); | ||
|
|
||
| int ix = wx + 8 * px; | ||
| tft.fillRect(ix, wy, 3 * px, px, color); | ||
| tft.fillRect(ix + px, wy + px, px, 3 * px, color); | ||
| tft.fillRect(ix, wy + 4 * px, 3 * px, px, color); | ||
|
|
||
| int fx = ix + 4 * px; | ||
| tft.fillRect(fx, wy, 4 * px, px, color); | ||
| tft.fillRect(fx + px, wy + px, px, 4 * px, color); | ||
| tft.fillRect(fx, wy + 4 * px, px, px, color); | ||
| tft.fillRect(fx + 2 * px, wy + 2 * px, 2 * px, px, color); | ||
| tft.drawPixel(fx + px, wy + 2 * px, bg); | ||
|
|
||
| int ix2 = fx + 5 * px; | ||
| tft.fillRect(ix2, wy, 3 * px, px, color); | ||
| tft.fillRect(ix2 + px, wy + px, px, 3 * px, color); | ||
| tft.fillRect(ix2, wy + 4 * px, 3 * px, px, color); | ||
|
|
||
| int by = y + 11 * px; | ||
| int x5 = x + 5 * px; | ||
|
|
||
| tft.fillRect(x5, by, 7 * px, px, color); | ||
| tft.fillRect(x5, by + px, 2 * px, 2 * px, color); | ||
| tft.fillRect(x5, by + 3 * px, 6 * px, px, color); | ||
| tft.fillRect(x5 + 5 * px, by + 4 * px, 2 * px, 2 * px, color); | ||
| tft.fillRect(x5 + px, by + 6 * px, 5 * px, px, color); | ||
| tft.fillRect(x5, by + 5 * px, px, px, color); | ||
| tft.drawPixel(x5 + 6 * px, by + 3 * px, bg); | ||
| tft.drawPixel(x5 + 6 * px, by + 6 * px, bg); | ||
|
|
||
| int xG = x5 + 8 * px; | ||
| tft.fillRect(xG + px, by, 5 * px, px, color); | ||
| tft.fillRect(xG, by + px, 2 * px, 5 * px, color); | ||
| tft.fillRect(xG + px, by + 6 * px, 5 * px, px, color); | ||
| tft.fillRect(xG + 5 * px, by + 3 * px, 2 * px, 3 * px, color); | ||
| tft.fillRect(xG + 3 * px, by + 3 * px, 2 * px, px, color); | ||
| tft.fillRect(xG + 6 * px, by + px, px, px, color); | ||
| tft.drawPixel(xG, by, bg); | ||
| tft.drawPixel(xG, by + 6 * px, bg); | ||
| tft.drawPixel(xG + 6 * px, by + 6 * px, bg); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #ifndef __BW16_MENU_H__ | ||
| #define __BW16_MENU_H__ | ||
|
|
||
| #include "MenuItemInterface.h" | ||
| #include "modules/bw16/bw16.h" | ||
|
|
||
| class Bw16Menu : public MenuItemInterface { | ||
| public: | ||
| Bw16Menu() : MenuItemInterface("BW16") {} | ||
|
|
||
| void optionsMenu(void); | ||
| void attackMenu(); | ||
| void configMenu(void); | ||
| void drawIcon(float scale); | ||
| bool hasTheme() { return bruceConfig.theme.bw16; } | ||
| String themePath() { return bruceConfig.theme.paths.bw16; } | ||
|
|
||
| private: | ||
| static BW16Tool tool; | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| #ifndef __BW16_TOOL_H__ | ||
| #define __BW16_TOOL_H__ | ||
|
|
||
| #include <Arduino.h> | ||
| #include <algorithm> | ||
| #include <globals.h> | ||
| #include <vector> | ||
|
|
||
| struct BW16Network { | ||
| int index; | ||
| String ssid; | ||
| String bssid; | ||
| int channel; | ||
| int rssi; | ||
| }; | ||
|
|
||
| struct BW16Group { | ||
| String ssid; | ||
| std::vector<BW16Network> aps; | ||
| int maxRssi = -127; | ||
| bool has24 = false; | ||
| bool has5 = false; | ||
| }; | ||
|
|
||
| class BW16Tool { | ||
| public: | ||
| BW16Tool(); | ||
| ~BW16Tool(); | ||
|
|
||
| void setup(); | ||
| void scanWifi(); | ||
| void selectWifi(); | ||
| void attackWifiMenu(); | ||
|
|
||
| void attackSelected(); | ||
| void attackAll(); | ||
| void beaconSpam(); | ||
| void beaconList(); | ||
| void beaconDeauth(); | ||
| void evilPortal(); | ||
| void attckbleMenu(); | ||
| void send_at_ble(String type); | ||
| String readSerialLine(); | ||
|
|
||
| private: | ||
| bool isBW16Active = false; | ||
| bool rxPinReleased = false; | ||
| std::vector<BW16Network> all_networks; | ||
| std::vector<BW16Group> grouped_networks; | ||
| std::vector<String> selected_bssids; | ||
|
|
||
| bool begin_bw16(); | ||
| void end(); | ||
| void releasePins(); | ||
| void restorePins(); | ||
| void display_banner(); | ||
| void send_attack_command(String type); | ||
| void printCustomLog(String msg); | ||
| void centerString(String text); | ||
| void save_captured_creds(const std::vector<String> &creds); | ||
| }; | ||
|
|
||
| #endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it wont built on LITE_VERSION... these functions must be enclosured in the flag