Compare commits

...

48 Commits

Author SHA1 Message Date
Just Call Me Koko
88777524e0 Release v0.9.9 2022-06-28 15:26:44 -04:00
Just Call Me Koko
f2d48d229a PMKID deauth optional 2022-06-22 19:17:25 -04:00
Just Call Me Koko
4aa93e2cc3 Send deauth for pmkid 2022-06-20 21:17:06 -04:00
Just Call Me Koko
00a785343c Update README.md 2022-06-18 19:55:01 -04:00
Just Call Me Koko
01b0520aec AP obfuscation attack 2022-06-18 03:22:13 -04:00
Just Call Me Koko
2468abba22 Save a beacon packet 2022-06-14 23:09:58 -04:00
Just Call Me Koko
355236dc42 Add targeted ap beacon spam 2022-06-13 20:18:20 -04:00
Just Call Me Koko
80f99f78a7 Add channel arg to pmkid sniff 2022-06-13 19:36:51 -04:00
Just Call Me Koko
809f0fb19d Release v0.9.8 2022-06-10 16:34:43 -04:00
Just Call Me Koko
71d5391066 Add help command 2022-06-03 21:02:20 -04:00
Just Call Me Koko
1988ec5808 Fix OTA update shutdown via CLI 2022-06-03 15:31:44 -04:00
Just Call Me Koko
2b130b9d11 Add more sniff and attack commands 2022-06-03 15:21:57 -04:00
Just Call Me Koko
0091c5642a print eapol when received 2022-06-03 12:39:44 -04:00
Just Call Me Koko
a80bba9b18 Add SSID commands 2022-06-02 17:13:54 -04:00
Just Call Me Koko
d686353322 Add attack command to CLI 2022-06-01 18:11:47 -04:00
Just Call Me Koko
ae8f8e870f Add more cmd, clean serial, add ascii 2022-05-31 22:46:28 -04:00
Gregor Hermani
d11faf5996 add OG-Marauder enclosure (#124)
* add Marauder Mini Case and rearrange files

* Add OG-Marauder Enclosure
2022-05-31 12:26:21 -04:00
Just Call Me Koko
6ae350dded Re-release v0.9.7 2022-05-28 14:50:00 -04:00
Just Call Me Koko
9a1ee15345 v0.9.7 Release 2022-05-28 14:29:15 -04:00
Just Call Me Koko
da538934e3 Trims serial input for PuTTY 2022-05-28 13:51:12 -04:00
Just Call Me Koko
e2b52f74e5 Merge pull request #122 from justcallmekoko/develop
Fix Marauder OTA for Flipper Zero
2022-05-28 09:51:00 -04:00
Just Call Me Koko
546afc63a7 Fix Marauder OTA for Flipper Zero 2022-05-28 09:47:06 -04:00
Just Call Me Koko
2f0d05a538 Develop (#121)
* Adding new library, changing way of displaying texts (#118)

* Adding custom icon for language button

* Adding new library, changing way of displaying texts

Added new library to make incoming translation possible to exists at the same time.

* Prepare for flipper integration

* More flipper wifi dev board work

* Add command parse

* Add set channel

* Create bins for release v0.9.6

Co-authored-by: mlodawy <105587112+mlodawy@users.noreply.github.com>
2022-05-28 09:06:59 -04:00
mlodawy
9f013d3d52 Adding custom icon for language button (#117) 2022-05-16 11:10:54 -04:00
mlodawy
45db8f3c22 Merge pull request #1 from justcallmekoko/master (#116) 2022-05-15 11:04:36 -04:00
Just Call Me Koko
e490b40196 Merge branch 'master' into master 2022-05-15 11:01:25 -04:00
mlodawy
72edd3d43d Add langauge button 2022-05-15 16:54:53 +02:00
Just Call Me Koko
bc6a07f5cb Add polish potato 2022-05-15 10:17:32 -04:00
Just Call Me Koko
bd7a350a9b Resize Marauder logo 2022-05-11 23:48:30 -04:00
Just Call Me Koko
cdd0ee5976 Add sniff deauth command 2022-05-11 18:53:55 -04:00
Just Call Me Koko
d7aac68866 Center click exit scan 2022-05-09 20:30:08 -04:00
Just Call Me Koko
0f58a0657b PROGMEM commands and remove mini lv_arduino 2022-05-07 14:36:44 -04:00
Gregor Hermani
d9a6966574 add Marauder Mini Case and rearrange files (#112) 2022-05-04 10:12:57 -04:00
Just Call Me Koko
5341c559be Add come cli commands 2022-05-03 00:44:07 -04:00
Just Call Me Koko
2c4edd012d Add some command line stuff 2022-05-03 00:22:11 -04:00
Just Call Me Koko
3b09650363 Merge branch 'master' of https://github.com/justcallmekoko/ESP32Marauder 2022-05-02 21:44:43 -04:00
Just Call Me Koko
7d6d0517e1 Add Marauder Mini Configuration 2022-05-02 21:44:42 -04:00
Just Call Me Koko
30020dd710 Add files via upload 2022-04-29 11:51:46 -04:00
Just Call Me Koko
3d2bb75081 Add files via upload 2022-04-29 11:51:29 -04:00
Just Call Me Koko
95841e5384 Add files via upload 2022-04-29 11:50:14 -04:00
Just Call Me Koko
a73ae2bbcb Create README.md 2022-04-29 11:48:52 -04:00
Just Call Me Koko
ae1aebde50 Add files via upload 2022-04-29 11:46:44 -04:00
Just Call Me Koko
9134280c6a Add files via upload 2022-04-29 11:45:23 -04:00
Just Call Me Koko
93d0f2e1d2 Create PCB_ESP32 Marauder 3.5 Kit V3 PCB_2022-04-29.json 2022-04-29 11:40:20 -04:00
Just Call Me Koko
e3f365febf Create PCB_ESP32 Marauder 3.7 OG PCB_2022-04-29.json 2022-04-29 11:38:31 -04:00
Just Call Me Koko
66576c1908 Create PCB_ESP32 Marauder 6 PCB_2022-04-29.json 2022-04-29 11:28:22 -04:00
Just Call Me Koko
8c53ac679f Update README.md 2022-01-19 11:36:25 -05:00
Just Call Me Koko
2d33c0b5ab Re-release v0.9.5
Fix some screen issues I guess?
2022-01-19 11:30:18 -05:00
77 changed files with 540098 additions and 3978 deletions

View File

@@ -1,3 +1,13 @@
//#define MARAUDER_V4
//#define MARAUDER_V6
//#define MARAUDER_KIT
//#define MARAUDER_MINI
#define MARAUDER_FLIPPER
#ifndef MARAUDER_FLIPPER
#define HAS_BT
#endif
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
@@ -5,7 +15,9 @@
#include <Update.h>
#include "esp_wifi.h"
#include "esp_wifi_types.h"
#include "esp_bt.h"
#ifdef HAS_BT
#include "esp_bt.h"
#endif
#define jquery_min_js_v3_2_1_gz_len 30178

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

1
PCBs/v4(OG)/README.md Normal file
View File

@@ -0,0 +1 @@
Further resources can be found [here](http://www.lcdwiki.com/2.8inch_SPI_Module_ILI9341_SKU:MSP2807)

File diff suppressed because one or more lines are too long

Binary file not shown.

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.9.3
# ESP32 Marauder v0.9.9
<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>

File diff suppressed because one or more lines are too long

View File

@@ -1,43 +1,49 @@
#include "BatteryInterface.h"
#include "lang_var.h"
BatteryInterface::BatteryInterface() {
}
void BatteryInterface::main(uint32_t currentTime) {
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("Battery Level changed: " + (String)new_level);
this->battery_level = new_level;
#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;
}
}
}
}
#endif
}
void BatteryInterface::RunSetup() {
Wire.begin(I2C_SDA, I2C_SCL);
this->initTime = millis();
#ifndef MARAUDER_FLIPPER
Wire.begin(I2C_SDA, I2C_SCL);
this->initTime = millis();
#endif
}
int8_t BatteryInterface::getBatteryLevel() {
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;
#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;
}
}
}
this->i2c_supported = false;
return -1;
this->i2c_supported = false;
return -1;
#endif
}

View File

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

View File

@@ -1,4 +1,5 @@
#include "Buffer.h"
#include "lang_var.h"
Buffer::Buffer(){
bufA = (uint8_t*)malloc(BUF_SIZE);
@@ -37,7 +38,7 @@ void Buffer::close(fs::FS* fs){
if(!writing) return;
forceSave(fs);
writing = false;
Serial.println("file closed");
Serial.println(text01);
}
void Buffer::addPacket(uint8_t* buf, uint32_t len){
@@ -123,7 +124,7 @@ void Buffer::save(fs::FS* fs){
file = fs->open(fileName, FILE_APPEND);
if (!file) {
Serial.println("Failed to open file '"+fileName+"'");
Serial.println(text02 + fileName+"'");
//useSD = false;
return;
}
@@ -159,7 +160,7 @@ void Buffer::forceSave(fs::FS* fs){
file = fs->open(fileName, FILE_APPEND);
if (!file) {
Serial.println("Failed to open file '"+fileName+"'");
Serial.println(text02+fileName+"'");
//useSD = false;
return;
}

View File

@@ -0,0 +1,555 @@
#include "CommandLine.h"
CommandLine::CommandLine() {
}
void CommandLine::RunSetup() {
Serial.println(this->ascii_art);
Serial.println(F("\n\n--------------------------------\n"));
Serial.println(F(" ESP32 Marauder \n"));
Serial.println(" " + version_number + "\n");
Serial.println(F(" By: justcallmekoko\n"));
Serial.println(F("--------------------------------\n\n"));
Serial.print("> ");
}
String CommandLine::getSerialInput() {
String input = "";
if (Serial.available() > 0)
input = Serial.readStringUntil('\n');
input.trim();
return input;
}
void CommandLine::main(uint32_t currentTime) {
String input = this->getSerialInput();
this->runCommand(input);
if (input != "")
Serial.print("> ");
}
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);
}
}
return cmd_args;
}
int CommandLine::argSearch(LinkedList<String>* cmd_args_list, String key) {
for (int i = 0; i < cmd_args_list->size(); i++) {
if (cmd_args_list->get(i) == key)
return i;
}
return -1;
}
bool CommandLine::checkValueExists(LinkedList<String>* cmd_args_list, int index) {
if (index < cmd_args_list->size() - 1)
return true;
return false;
}
bool CommandLine::inRange(int max, int index) {
if ((index >= 0) && (index < max))
return true;
return false;
}
bool CommandLine::apSelected() {
for (int i = 0; i < access_points->size(); i++) {
if (access_points->get(i).selected)
return true;
}
return false;
}
bool CommandLine::hasSSIDs() {
if (ssids->size() == 0)
return false;
return true;
}
void CommandLine::runCommand(String input) {
if (input != "")
Serial.println("#" + input);
else
return;
LinkedList<String> cmd_args = this->parseCommand(input, " ");
//// Admin commands
// Help
if (cmd_args.get(0) == HELP_CMD) {
Serial.println(HELP_HEAD);
Serial.println(HELP_CH_CMD);
Serial.println(HELP_CLEARAP_CMD_A);
Serial.println(HELP_CLEARAP_CMD_B);
Serial.println(HELP_REBOOT_CMD);
Serial.println(HELP_UPDATE_CMD_A);
Serial.println(HELP_UPDATE_CMD_B);
// WiFi sniff/scan
Serial.println(HELP_SCANAP_CMD);
Serial.println(HELP_SNIFF_BEACON_CMD);
Serial.println(HELP_SNIFF_PROBE_CMD);
Serial.println(HELP_SNIFF_PWN_CMD);
Serial.println(HELP_SNIFF_ESP_CMD);
Serial.println(HELP_SNIFF_DEAUTH_CMD);
Serial.println(HELP_SNIFF_PMKID_CMD);
Serial.println(HELP_STOPSCAN_CMD);
// WiFi attack
Serial.println(HELP_ATTACK_CMD);
// WiFi Aux
Serial.println(HELP_LIST_AP_CMD_A);
Serial.println(HELP_LIST_AP_CMD_B);
Serial.println(HELP_SEL_CMD_A);
Serial.println(HELP_SEL_CMD_B);
Serial.println(HELP_SSID_CMD_A);
Serial.println(HELP_SSID_CMD_B);
// Bluetooth sniff/scan
Serial.println(HELP_BT_SNIFF_CMD);
Serial.println(HELP_BT_SKIM_CMD);
Serial.println(HELP_FOOT);
return;
}
// Stop Scan
if (cmd_args.get(0) == STOPSCAN_CMD) {
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_scan_obj.StartScan(WIFI_SCAN_OFF);
Serial.println("Stopping WiFi tran/recv");
// If we don't do this, the text and button coordinates will be off
#ifdef HAS_SCREEN
display_obj.tft.init();
menu_function_obj.changeMenu(menu_function_obj.current_menu);
#endif
}
// Channel command
else if (cmd_args.get(0) == CH_CMD) {
// Search for channel set arg
int ch_set = this->argSearch(&cmd_args, "-s");
if (cmd_args.size() == 1) {
Serial.println("Current channel: " + (String)wifi_scan_obj.set_channel);
}
else if (ch_set != -1) {
wifi_scan_obj.set_channel = cmd_args.get(ch_set + 1).toInt();
wifi_scan_obj.changeChannel();
Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
}
}
// Clear APs
else if (cmd_args.get(0) == CLEARAP_CMD) {
int ap_sw = this->argSearch(&cmd_args, "-a"); // APs
int ss_sw = this->argSearch(&cmd_args, "-s"); // SSIDs
if (ap_sw != -1)
wifi_scan_obj.RunClearAPs();
if (ss_sw != -1)
wifi_scan_obj.RunClearSSIDs();
}
else if (cmd_args.get(0) == REBOOT_CMD) {
Serial.println("Rebooting...");
ESP.restart();
}
//// WiFi/Bluetooth Scan/Attack commands
if (!wifi_scan_obj.scanning()) {
// AP Scan
if (cmd_args.get(0) == SCANAP_CMD) {
int full_sw = -1;
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
if (full_sw == -1) {
Serial.println("Starting AP scan. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP, TFT_MAGENTA);
}
else {
Serial.println("Starting Full AP scan. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP_FULL, TFT_MAGENTA);
}
}
// Beacon sniff
else if (cmd_args.get(0) == SNIFF_BEACON_CMD) {
Serial.println("Starting Beacon sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);
}
// Probe sniff
else if (cmd_args.get(0) == SNIFF_PROBE_CMD) {
Serial.println("Starting Probe sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_MAGENTA);
}
// Deauth sniff
else if (cmd_args.get(0) == SNIFF_DEAUTH_CMD) {
Serial.println("Starting Deauth sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
}
// Pwn sniff
else if (cmd_args.get(0) == SNIFF_PWN_CMD) {
Serial.println("Starting Pwnagotchi sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_MAGENTA);
}
// Espressif sniff
else if (cmd_args.get(0) == SNIFF_ESP_CMD) {
Serial.println("Starting Espressif device sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_ESPRESSIF, TFT_MAGENTA);
}
// PMKID sniff
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
if (ch_sw != -1) {
wifi_scan_obj.set_channel = cmd_args.get(ch_sw + 1).toInt();
wifi_scan_obj.changeChannel();
Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
}
if (d_sw == -1) {
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 {
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
if (cmd_args.get(0) == ATTACK_CMD) {
int attack_type_switch = this->argSearch(&cmd_args, "-t"); // Required
int list_beacon_sw = this->argSearch(&cmd_args, "-l");
int rand_beacon_sw = this->argSearch(&cmd_args, "-r");
int ap_beacon_sw = this->argSearch(&cmd_args, "-a");
if (attack_type_switch == -1) {
Serial.println("You must specify an attack type");
return;
}
else {
String attack_type = cmd_args.get(attack_type_switch + 1);
// Branch on attack type
// Deauth
if (attack_type == ATTACK_TYPE_DEAUTH) {
if (!this->apSelected()) {
Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
return;
}
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
Serial.println("Starting Deauthentication attack. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_ATTACK_DEAUTH, TFT_RED);
}
// Beacon
else if (attack_type == ATTACK_TYPE_BEACON) {
// spam by list
if (list_beacon_sw != -1) {
if (!this->hasSSIDs()) {
Serial.println("You don't have any SSIDs in your list. Use " + (String)SSID_CMD);
return;
}
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
Serial.println("Starting Beacon list spam. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_LIST, TFT_RED);
}
// spam with random
else if (rand_beacon_sw != -1) {
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
Serial.println("Starting random Beacon spam. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);
}
// Spam from AP list
else if (ap_beacon_sw != -1) {
if (!this->apSelected()) {
Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
return;
}
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
Serial.println("Starting Targeted AP Beacon spam. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_ATTACK_AP_SPAM, TFT_MAGENTA);
}
else {
Serial.println("You did not specify a beacon attack type");
}
}
else if (attack_type == ATTACK_TYPE_PROBE) {
if (!this->apSelected()) {
Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
return;
}
Serial.println("Starting Probe spam. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_ATTACK_AUTH, TFT_RED);
}
else if (attack_type == ATTACK_TYPE_RR) {
Serial.println("Starting Rick Roll Beacon spam. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);
}
else {
Serial.println("Attack type not properly defined");
return;
}
}
}
//// 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();
#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();
#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 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;
//#ifdef HAS_SCREEN
// menu_function_obj.changeMenu(menu_function_obj.updateMenu);
//#endif
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 aux commands
// List access points
if (cmd_args.get(0) == LIST_AP_CMD) {
int ap_sw = this->argSearch(&cmd_args, "-a");
int ss_sw = this->argSearch(&cmd_args, "-s");
// 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 + " (selected)");
else
Serial.println("[" + (String)i + "] " + access_points->get(i).essid);
}
}
// List SSIDs
else if (ss_sw != -1) {
for (int i = 0; i < ssids->size(); i++) {
if (ssids->get(i).selected)
Serial.println("[" + (String)i + "] " + ssids->get(i).essid + " (selected)");
else
Serial.println("[" + (String)i + "] " + ssids->get(i).essid);
}
}
else {
Serial.println("You did not specify which list to show");
return;
}
}
// Select access points or stations
else if (cmd_args.get(0) == SEL_CMD) {
// Get switches
int ap_sw = this->argSearch(&cmd_args, "-a");
int ss_sw = this->argSearch(&cmd_args, "-s");
// select Access points
if (ap_sw != -1) {
// Get list of indices
LinkedList<String> ap_index = this->parseCommand(cmd_args.get(ap_sw + 1), ",");
// 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 ssids
else if (ss_sw != -1) {
// Get list of indices
LinkedList<String> ss_index = this->parseCommand(cmd_args.get(ss_sw + 1), ",");
// Mark APs as selected
for (int i = 0; i < ss_index.size(); i++) {
int index = ss_index.get(i).toInt();
if (!this->inRange(ssids->size(), index)) {
Serial.println("Index not in range: " + (String)index);
continue;
}
if (ssids->get(index).selected) {
// Unselect "selected" ap
ssid new_ssid = ssids->get(index);
new_ssid.selected = false;
ssids->set(index, new_ssid);
}
else {
// Select "unselected" ap
ssid new_ssid = ssids->get(index);
new_ssid.selected = true;
ssids->set(index, new_ssid);
}
}
}
else {
Serial.println("You did not specify which list to select from");
return;
}
}
// SSID stuff
else if (cmd_args.get(0) == SSID_CMD) {
int add_sw = this->argSearch(&cmd_args, "-a");
int gen_sw = this->argSearch(&cmd_args, "-g");
int spc_sw = this->argSearch(&cmd_args, "-n");
int rem_sw = this->argSearch(&cmd_args, "-r");
// Add ssid
if (add_sw != -1) {
// Generate random
if (gen_sw != -1) {
int gen_count = cmd_args.get(gen_sw + 1).toInt();
wifi_scan_obj.generateSSIDs(gen_count);
}
// Add specific
else if (spc_sw != -1) {
String essid = cmd_args.get(spc_sw + 1);
wifi_scan_obj.addSSID(essid);
}
else {
Serial.println("You did not specify how to add SSIDs");
}
}
// Remove SSID
else if (rem_sw != -1) {
int index = cmd_args.get(rem_sw + 1).toInt();
if (!this->inRange(ssids->size(), index)) {
Serial.println("Index not in range: " + (String)index);
return;
}
ssids->remove(index);
}
else {
Serial.println("You did not specify whether to add or remove SSIDs");
return;
}
}
}

View File

@@ -0,0 +1,145 @@
#ifndef CommandLine_h
#define CommandLine_h
#include "configs.h"
#ifdef HAS_SCREEN
#include "MenuFunctions.h"
#include "Display.h"
#endif
#include "WiFiScan.h"
#include "Web.h"
#include "SDInterface.h"
#ifdef HAS_SCREEN
extern MenuFunctions menu_function_obj;
extern Display display_obj;
#endif
extern WiFiScan wifi_scan_obj;
extern Web web_obj;
extern SDInterface sd_obj;
extern LinkedList<AccessPoint>* access_points;
extern LinkedList<ssid>* ssids;
extern const String PROGMEM version_number;
//// Commands
// Admin
const char PROGMEM CH_CMD[] = "channel";
const char PROGMEM CLEARAP_CMD[] = "clearlist";
const char PROGMEM REBOOT_CMD[] = "reboot";
const char PROGMEM UPDATE_CMD[] = "update";
const char PROGMEM HELP_CMD[] = "help";
// WiFi sniff/scan
const char PROGMEM SCANAP_CMD[] = "scanap";
const char PROGMEM SNIFF_BEACON_CMD[] = "sniffbeacon";
const char PROGMEM SNIFF_PROBE_CMD[] = "sniffprobe";
const char PROGMEM SNIFF_PWN_CMD[] = "sniffpwn";
const char PROGMEM SNIFF_ESP_CMD[] = "sniffesp";
const char PROGMEM SNIFF_DEAUTH_CMD[] = "sniffdeauth";
const char PROGMEM SNIFF_PMKID_CMD[] = "sniffpmkid";
const char PROGMEM STOPSCAN_CMD[] = "stopscan";
// WiFi attack
const char PROGMEM ATTACK_CMD[] = "attack";
const char PROGMEM ATTACK_TYPE_DEAUTH[] = "deauth";
const char PROGMEM ATTACK_TYPE_BEACON[] = "beacon";
const char PROGMEM ATTACK_TYPE_PROBE[] = "probe";
const char PROGMEM ATTACK_TYPE_RR[] = "rickroll";
// WiFi Aux
const char PROGMEM LIST_AP_CMD[] = "list";
const char PROGMEM SEL_CMD[] = "select";
const char PROGMEM SSID_CMD[] = "ssid";
// Bluetooth sniff/scan
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
const char PROGMEM BT_SKIM_CMD[] = "sniffskim";
//// Command help messages
// Admin
const char PROGMEM HELP_HEAD[] = "============ Commands ============";
const char PROGMEM HELP_CH_CMD[] = "channel [-s <channel>]";
const char PROGMEM HELP_CLEARAP_CMD_A[] = "clearlist -a";
const char PROGMEM HELP_CLEARAP_CMD_B[] = "clearlist -s";
const char PROGMEM HELP_REBOOT_CMD[] = "reboot";
const char PROGMEM HELP_UPDATE_CMD_A[] = "update -s";
const char PROGMEM HELP_UPDATE_CMD_B[] = "update -w";
// WiFi sniff/scan
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
const char PROGMEM HELP_SNIFF_BEACON_CMD[] = "sniffbeacon";
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_STOPSCAN_CMD[] = "stopscan";
// WiFi attack
const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth/probe/rickroll>";
// WiFi Aux
const char PROGMEM HELP_LIST_AP_CMD_A[] = "list -s";
const char PROGMEM HELP_LIST_AP_CMD_B[] = "list -a";
const char PROGMEM HELP_SEL_CMD_A[] = "select -a <index (comma separated)>";
const char PROGMEM HELP_SEL_CMD_B[] = "select -s <index (comma separated)>";
const char PROGMEM HELP_SSID_CMD_A[] = "ssid -a [-g <count>/-n <name>]";
const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";
// Bluetooth sniff/scan
const char PROGMEM HELP_BT_SNIFF_CMD[] = "sniffbt";
const char PROGMEM HELP_BT_SKIM_CMD[] = "sniffskim";
const char PROGMEM HELP_FOOT[] = "==================================";
class CommandLine {
private:
String getSerialInput();
LinkedList<String> parseCommand(String input, char* delim);
void runCommand(String input);
bool checkValueExists(LinkedList<String>* cmd_args_list, int index);
bool inRange(int max, int index);
bool apSelected();
bool hasSSIDs();
int argSearch(LinkedList<String>* cmd_args, String key);
const char* ascii_art =
"\r\n"
" @@@@@@ \r\n"
" @@@@@@@@ \r\n"
" @@@@@@@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@ @@@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@ @@@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
"@@@@@@@ @@@@@@@@@@@@@@@@ \r\n"
"@@@@@ @@@@@@@@@@@@@@@ \r\n"
"@@@@@ @@@@@@@ \r\n"
"@@@@@ @@@@@@ \r\n"
"@@@@@@ @@@@@@@ \r\n"
" @@@@@@ @@@@@@@@@@@@\r\n"
" @@@@@@@ @@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@ @@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@ @@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@@@ \r\n"
" @@@@@@ \r\n"
" @@@@ \r\n"
"\r\n";
public:
CommandLine();
void RunSetup();
void main(uint32_t currentTime);
};
#endif

View File

@@ -1,15 +1,7 @@
#include "Display.h"
#include "lang_var.h"
/*
Big thanks to bodmer for having great TFT and JPEG libraries
https://github.com/bodmer
*/
//PROGMEM lv_obj_t * slider_label;
//PROGMEM lv_obj_t * ta1;
//PROGMEM lv_obj_t * ta2;
#ifdef HAS_SCREEN
Display::Display()
{
@@ -27,123 +19,32 @@ void Display::RunSetup()
tft.setRotation(0); // Portrait
tft.setCursor(0, 0);
//tft.setFreeFont(&FreeMonoBold9pt7b);
// Calibration data
//uint16_t calData[5] = { 390, 3516, 253, 3520, 7 }; tft.setRotation(1); // Portrait
#ifndef MARAUDER_MINI
#ifdef TFT_SHIELD
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
//Serial.println(F("Using TFT Shield"));
#else if defined(TFT_DIY)
uint16_t calData[5] = { 339, 3470, 237, 3438, 2 }; // tft.setRotation(0); // Portrait with DIY TFT
//Serial.println(F("Using TFT DIY"));
#endif
tft.setTouch(calData);
#ifdef TFT_SHIELD
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
Serial.println(F("Using TFT Shield"));
#else if defined(TFT_DIY)
uint16_t calData[5] = { 339, 3470, 237, 3438, 2 }; // tft.setRotation(0); // Portrait with DIY TFT
Serial.println(F("Using TFT DIY"));
#endif
tft.setTouch(calData);
//tft.fillScreen(TFT_BLACK);
clearScreen();
Serial.println("SPI_FREQUENCY: " + (String)SPI_FREQUENCY);
Serial.println("SPI_READ_FREQUENCY: " + (String)SPI_READ_FREQUENCY);
Serial.println("SPI_TOUCH_FREQUENCY: " + (String)SPI_TOUCH_FREQUENCY);
// Initialize file system
// This should probably have its own class
//if (!SPIFFS.begin()) {
// Serial.println(F("SPIFFS initialisation failed!"));
//while (1) yield(); // Stay here twiddling thumbs waiting
//}
//this->initLVGL();
// Draw the title screen
//drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
//showCenterText(version_number, 250);
//tft.drawCentreString(version_number, 120, 250, 2);
//digitalWrite(TFT_BL, HIGH);
//delay(5000);
//Serial.println("SPI_FREQUENCY: " + (String)SPI_FREQUENCY);
//Serial.println("SPI_READ_FREQUENCY:" + (String)SPI_READ_FREQUENCY);
//Serial.println("SPI_TOUCH_FREQUENCY: " + (String)SPI_TOUCH_FREQUENCY);
#ifdef KIT
pinMode(KIT_LED_BUILTIN, OUTPUT);
#endif
}
/* Interrupt driven periodic handler */
/*
void Display::lv_tick_handler()
{
lv_tick_inc(LVGL_TICK_PERIOD);
}*/
/* Display flushing */
/*
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
extern Display display_obj;
uint16_t c;
display_obj.tft.startWrite();
display_obj.tft.setAddrWindow(area->x1, area->y1, (area->x2 - area->x1 + 1), (area->y2 - area->y1 + 1));
for (int y = area->y1; y <= area->y2; y++) {
for (int x = area->x1; x <= area->x2; x++) {
c = color_p->full;
display_obj.tft.writeColor(c, 1);
color_p++;
}
}
display_obj.tft.endWrite();
lv_disp_flush_ready(disp);
}
bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
{
extern Display display_obj;
uint16_t touchX, touchY;
bool touched = display_obj.tft.getTouch(&touchX, &touchY, 600);
if(!touched)
{
return false;
}
if(touchX>WIDTH_1 || touchY > HEIGHT_1)
{
Serial.println("Y or y outside of expected parameters..");
Serial.print("y:");
Serial.print(touchX);
Serial.print(" x:");
Serial.print(touchY);
}
else
{
data->state = touched ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
//if(data->state == LV_INDEV_STATE_PR) touchpad_get_xy(&last_x, &last_y);
data->point.x = touchX;
data->point.y = touchY;
Serial.print("Data x");
Serial.println(touchX);
Serial.print("Data y");
Serial.println(touchY);
}
return false;
}*/
void Display::drawFrame()
{
tft.drawRect(FRAME_X, FRAME_Y, FRAME_W, FRAME_H, TFT_BLACK);
@@ -156,7 +57,7 @@ void Display::tftDrawRedOnOffButton() {
tft.setTextColor(TFT_WHITE);
tft.setTextSize(2);
tft.setTextDatum(MC_DATUM);
tft.drawString("ON", GREENBUTTON_X + (GREENBUTTON_W / 2), GREENBUTTON_Y + (GREENBUTTON_H / 2));
tft.drawString(text03, GREENBUTTON_X + (GREENBUTTON_W / 2), GREENBUTTON_Y + (GREENBUTTON_H / 2));
this->SwitchOn = false;
}
@@ -167,7 +68,7 @@ void Display::tftDrawGreenOnOffButton() {
tft.setTextColor(TFT_WHITE);
tft.setTextSize(2);
tft.setTextDatum(MC_DATUM);
tft.drawString("OFF", REDBUTTON_X + (REDBUTTON_W / 2) + 1, REDBUTTON_Y + (REDBUTTON_H / 2));
tft.drawString(text04, REDBUTTON_X + (REDBUTTON_W / 2) + 1, REDBUTTON_Y + (REDBUTTON_H / 2));
this->SwitchOn = true;
}
@@ -269,7 +170,7 @@ void Display::tftDrawYScaleButtons(byte y_scale)
void Display::tftDrawChannelScaleButtons(int set_channel)
{
tft.drawFastVLine(178, 0, 20, TFT_WHITE);
tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Channel:"); tft.print(set_channel);
tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print(text10); tft.print(set_channel);
key[4].initButton(&tft, // channel - box
164,
@@ -339,14 +240,14 @@ void Display::touchToExit()
{
tft.setTextColor(TFT_BLACK, TFT_LIGHTGREY);
tft.fillRect(0,32,HEIGHT_1,16, TFT_LIGHTGREY);
tft.drawCentreString("Touch screen to exit",120,32,2);
tft.drawCentreString(text11,120,32,2);
}
// Function to just draw the screen black
void Display::clearScreen()
{
Serial.println(F("clearScreen()"));
//Serial.println(F("clearScreen()"));
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0);
}
@@ -388,7 +289,7 @@ void Display::showCenterText(String text, int y)
void Display::initScrollValues(bool tte)
{
Serial.println(F("initScrollValues()"));
//Serial.println(F("initScrollValues()"));
yDraw = YMAX - BOT_FIXED_AREA - TEXT_HEIGHT;
xPos = 0;
@@ -444,24 +345,28 @@ int Display::scroll_line(uint32_t color) {
// Function to setup hardware scroll for TFT screen
void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
Serial.println(F("setupScrollArea()"));
Serial.println(" tfa: " + (String)tfa);
Serial.println(" bfa: " + (String)bfa);
Serial.println("yStart: " + (String)this->yStart);
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
tft.writedata(tfa >> 8); // Top Fixed Area line count
tft.writedata(tfa);
tft.writedata((YMAX-tfa-bfa)>>8); // Vertical Scrolling Area line count
tft.writedata(YMAX-tfa-bfa);
tft.writedata(bfa >> 8); // Bottom Fixed Area line count
tft.writedata(bfa);
//Serial.println(F("setupScrollArea()"));
//Serial.println(" tfa: " + (String)tfa);
//Serial.println(" bfa: " + (String)bfa);
//Serial.println("yStart: " + (String)this->yStart);
#ifndef MARAUDER_MINI
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
tft.writedata(tfa >> 8); // Top Fixed Area line count
tft.writedata(tfa);
tft.writedata((YMAX-tfa-bfa)>>8); // Vertical Scrolling Area line count
tft.writedata(YMAX-tfa-bfa);
tft.writedata(bfa >> 8); // Bottom Fixed Area line count
tft.writedata(bfa);
#endif
}
void Display::scrollAddress(uint16_t vsp) {
tft.writecommand(ILI9341_VSCRSADD); // Vertical scrolling pointer
tft.writedata(vsp>>8);
tft.writedata(vsp);
#ifndef MARAUDER_MINI
tft.writecommand(ILI9341_VSCRSADD); // Vertical scrolling pointer
tft.writedata(vsp>>8);
tft.writedata(vsp);
#endif
}
@@ -494,9 +399,9 @@ void Display::drawJpeg(const char *filename, int xpos, int ypos) {
// render the image onto the screen at given coordinates
jpegRender(xpos, ypos);
}
else {
Serial.println(F("Jpeg file format not supported!"));
}
//else {
// Serial.println(F("Jpeg file format not supported!"));
//}
}
void Display::setupDraw() {
@@ -516,7 +421,7 @@ void Display::drawStylus()
boolean pressed = tft.getTouch(&x, &y);
if ((x <= 10) && (y <= 10) && (pressed)) {
Serial.println(F("Exit draw function"));
//Serial.println(F("Exit draw function"));
this->draw_tft = false;
this->exit_draw = true;
return;
@@ -649,7 +554,7 @@ void Display::jpegRender(int xpos, int ypos) {
// Print information decoded from the Jpeg image
//====================================================================================
void Display::jpegInfo() {
/*
Serial.println("===============");
Serial.println("JPEG image info");
Serial.println("===============");
@@ -663,7 +568,7 @@ void Display::jpegInfo() {
Serial.print ("MCU height :"); Serial.println(JpegDec.MCUHeight);
Serial.println("===============");
Serial.println("");
*/
}
//====================================================================================
@@ -840,7 +745,7 @@ void Display::buildBanner(String msg, int xpos)
//img.fillCircle(SCREEN_WIDTH / 2, TEXT_HEIGHT / 2, 10, TFT_ORANGE);
// Now print text on top of the graphics
img.setTextSize(2); // Font size scaling is x1
img.setTextSize(BANNER_TEXT_SIZE); // Font size scaling is x1
img.setTextFont(0); // Font 4 selected
img.setTextColor(TFT_WHITE); // Black text, no background colour
img.setTextWrap(false); // Turn of wrap so we can print past end of sprite
@@ -853,112 +758,6 @@ void Display::buildBanner(String msg, int xpos)
img.print(msg);
}
/*
void Display::initLVGL() {
tick.attach_ms(LVGL_TICK_PERIOD, lv_tick_handler);
lv_init();
lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10);
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.hor_res = WIDTH_1;
disp_drv.ver_res = HEIGHT_1;
disp_drv.flush_cb = my_disp_flush;
disp_drv.buffer = &disp_buf;
lv_disp_drv_register(&disp_drv);
lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = my_touchpad_read;
lv_indev_drv_register(&indev_drv);
}
void Display::deinitLVGL() {
Serial.println(F("Deinit LVGL"));
//lv_deinit();
}
void Display::joinWiFiGFX(){
// Create one text area
ta1 = lv_textarea_create(lv_scr_act(), NULL);
lv_textarea_set_one_line(ta1, true);
lv_obj_set_width(ta1, LV_HOR_RES / 2 - 20);
lv_obj_set_pos(ta1, 5, 20);
//lv_ta_set_cursor_type(ta, LV_CURSOR_BLOCK);
lv_textarea_set_text(ta1, "");
lv_obj_set_event_cb(ta1, ta_event_cb);
// Create first label
lv_obj_t * ssid_label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(ssid_label, "SSID:");
lv_obj_align(ssid_label, ta1, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
// Create second text area
ta2 = lv_textarea_create(lv_scr_act(), ta1);
//lv_textarea_set_pwd_mode(ta2, true); // This shit makes it so backspace does not work
//lv_textarea_set_pwd_show_time(ta2, 1000);
lv_textarea_set_cursor_hidden(ta2, true);
lv_obj_align(ta2, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20);
// Create second label
lv_obj_t * pw_label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(pw_label, "Password:");
lv_obj_align(pw_label, ta2, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
// 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);
lv_obj_set_event_cb(kb, keyboard_event_cb);
// Focus it on one of the text areas to start
lv_keyboard_set_textarea(kb, ta1);
lv_keyboard_set_cursor_manage(kb, true);
}
void keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event){
extern Display display_obj;
lv_keyboard_def_event_cb(kb, event);
if(event == LV_EVENT_APPLY){
printf("LV_EVENT_APPLY\n");
//String ta1_text = lv_textarea_get_text(lv_keyboard_get_textarea(kb));
String ta1_text = lv_textarea_get_text(ta1);
String ta2_text = lv_textarea_get_text(ta2);
Serial.println(ta1_text);
Serial.println(ta2_text);
//joinWiFi(ta1_text, ta2_text);
}else if(event == LV_EVENT_CANCEL){
printf("LV_EVENT_CANCEL\n");
//lv_textarea_set_text(lv_keyboard_get_textarea(kb), "");
display_obj.deinitLVGL();
display_obj.exit_draw = true; // set everything back to normal
}
}
void ta_event_cb(lv_obj_t * ta, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
if(kb != NULL)
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");
// }
//}
}*/
void Display::main(uint8_t scan_mode)
{
if ((scan_mode == LV_JOIN_WIFI) ||
@@ -967,3 +766,5 @@ void Display::main(uint8_t scan_mode)
return;
}
// End SPIFFS_functions
#endif

View File

@@ -1,6 +1,9 @@
#ifndef Display_h
#define Display_h
#include "configs.h"
#ifdef HAS_SCREEN
#include <FS.h>
#include <functional>
@@ -16,16 +19,6 @@
#include <TFT_eSPI.h>
#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
// WiFi stuff
#define OTA_UPDATE 100
#define SHOW_INFO 101
@@ -46,50 +39,6 @@
#define LV_ADD_SSID 14
#define WIFI_ATTACK_BEACON_LIST 15
#define TFT_SHIELD
//#define TFT_DIY
//#define KIT
#define SCREEN_WIDTH 240
#define SCREEN_HEIGHT 320
#define HEIGHT_1 240
#define WIDTH_1 320
#define STANDARD_FONT_CHAR_LIMIT 40 // 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 9
#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
/*
PROGMEM void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p);
PROGMEM bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data);
@@ -104,6 +53,9 @@ PROGMEM static void keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
PROGMEM static lv_obj_t *kb;
*/
// #define KIT
// #define TFT_DIY
class Display
{
private:
@@ -131,7 +83,7 @@ class Display
TFT_eSPI tft = TFT_eSPI();
TFT_eSprite img = TFT_eSprite(&tft);
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
const String PROGMEM version_number = "v0.9.5";
const String PROGMEM version_number = MARAUDER_VERSION;
bool printing = false;
bool loading = false;
@@ -202,3 +154,4 @@ class Display
void updateBanner(String msg);
};
#endif
#endif

View File

@@ -5,7 +5,7 @@ LedInterface::LedInterface() {
}
void LedInterface::RunSetup() {
Serial.println("Setting neopixel to black...");
//Serial.println("Setting neopixel to black...");
strip.setBrightness(0);
strip.begin();
strip.setPixelColor(0, strip.Color(0, 0, 0));

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,10 @@
#ifndef MenuFunctions_h
#define MenuFunctions_h
#include "configs.h"
#ifdef HAS_SCREEN
#define BATTERY_ANALOG_ON 0
#include "WiFiScan.h"
@@ -12,6 +16,14 @@
#include "a32u4_interface.h"
#include "settings.h"
#ifdef MARAUDER_MINI
#include <SwitchLib.h>
extern SwitchLib u_btn;
extern SwitchLib d_btn;
extern SwitchLib l_btn;
extern SwitchLib r_btn;
extern SwitchLib c_btn;
#endif
extern Display display_obj;
extern WiFiScan wifi_scan_obj;
@@ -22,19 +34,6 @@ extern EspInterface esp_obj;
extern A32u4Interface a32u4_obj;
extern Settings settings_obj;
// Keypad start position, key sizes and spacing
#define KEY_X 120 // Centre of key
#define KEY_Y 50
#define KEY_W 240 // Width and height
#define KEY_H 22
#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 22
//#define BUTTON_ARRAY_LEN 5
#define FLASH_BUTTON 0
#if BATTERY_ANALOG_ON == 1
@@ -79,6 +78,7 @@ extern Settings settings_obj;
#define ESP_UPDATE_ICO 32
#define BAD_USB_ICO 33
#define TEST_BAD_USB_ICO 34
#define LANGUAGE 35
PROGMEM void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p);
PROGMEM bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data);
@@ -106,6 +106,7 @@ struct Menu;
struct MenuNode {
String name;
String command;
uint16_t color;
int icon;
TFT_eSPI_Button* button;
@@ -118,7 +119,7 @@ struct Menu {
String name;
LinkedList<MenuNode>* list;
Menu * parentMenu;
//uint8_t selected;
uint8_t selected = 0;
};
@@ -150,6 +151,7 @@ class MenuFunctions
Menu settingsMenu;
Menu specSettingMenu;
Menu infoMenu;
Menu languageMenu;
// WiFi menu stuff
Menu wifiSnifferMenu;
@@ -174,8 +176,7 @@ class MenuFunctions
//TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable, bool selected = false);
void drawStatusBar();
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable, bool selected = false, String command = "");
void updateStatusBar();
void battery(bool initial = false);
void battery2(bool initial = false);
@@ -183,6 +184,8 @@ class MenuFunctions
String callSetting(String key);
void runBoolSetting(String ley);
void displaySetting(String key, Menu* menu, int index);
void buttonSelected(uint8_t b);
void buttonNotSelected(uint8_t b);
public:
MenuFunctions();
@@ -206,6 +209,7 @@ class MenuFunctions
void buildButtons(Menu* menu);
void changeMenu(Menu* menu);
void drawStatusBar();
void displayCurrentMenu();
void main(uint32_t currentTime);
void RunSetup();
@@ -213,5 +217,5 @@ class MenuFunctions
};
#endif
#endif

View File

@@ -1,4 +1,5 @@
#include "SDInterface.h"
#include "lang_var.h"
bool SDInterface::initSD() {
String display_string = "";
@@ -23,27 +24,20 @@ bool SDInterface::initSD() {
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"));
//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->cardSizeBT = SD.cardSize();
//this->cardSizeKB = SD.cardSize() / 1024;
this->cardSizeMB = SD.cardSize() / (1024 * 1024);
//this->cardSizeGB = SD.cardSize() / (1024 * 1024 * 1024);
//Serial.printf("SD Card Size: %llu Bytes\n", this->cardSizeBT);
//Serial.printf("SD Card Size: %lluKB\n", this->cardSizeKB);
Serial.printf("SD Card Size: %lluMB\n", this->cardSizeMB);
//Serial.printf("SD Card Size: %lluGB\n", this->cardSizeGB);
//Serial.printf("SD Card Size: %lluMB\n", this->cardSizeMB);
if (this->supported) {
//display_obj.tft.println((byte)(sd_obj.cardSizeMB % 10));
const int NUM_DIGITS = log10(this->cardSizeMB) + 1;
char sz[NUM_DIGITS + 1];
@@ -55,16 +49,11 @@ bool SDInterface::initSD() {
display_string.concat((String)sz[i]);
}
//this->card_sz = display_string;
this->card_sz = sz;
}
buffer_obj = Buffer();
//if (this->supported)
// buffer_obj.open(&SD);
// Check for SCRIPTS folder
if (!SD.exists("/SCRIPTS")) {
Serial.println("/SCRIPTS does not exist. Creating...");
@@ -78,7 +67,6 @@ bool SDInterface::initSD() {
void SDInterface::addPacket(uint8_t* buf, uint32_t len) {
if ((this->supported) && (this->do_save)) {
//Serial.println("Adding packet to buffer...");
buffer_obj.addPacket(buf, len);
}
}
@@ -89,21 +77,26 @@ void SDInterface::openCapture(String file_name) {
}
void SDInterface::runUpdate() {
//display_obj.clearScreen();
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);
display_obj.tft.println(F("Opening /update.bin..."));
#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);
display_obj.tft.println(F(text15));
#endif
File updateBin = SD.open("/update.bin");
if (updateBin) {
if(updateBin.isDirectory()){
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F("Error, could not find update.bin"));
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F(text_table2[0]));
#endif
Serial.println(F("Error, update.bin is not a file"));
display_obj.tft.setTextColor(TFT_WHITE);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_WHITE);
#endif
updateBin.close();
return;
}
@@ -111,70 +104,98 @@ void SDInterface::runUpdate() {
size_t updateSize = updateBin.size();
if (updateSize > 0) {
display_obj.tft.println(F("Starting SD Update..."));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table2[1]));
#endif
Serial.println(F("Try to start update"));
this->performUpdate(updateBin, updateSize);
}
else {
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F("Error, update.bin is empty"));
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F(text_table2[2]));
#endif
Serial.println(F("Error, file is empty"));
display_obj.tft.setTextColor(TFT_WHITE);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_WHITE);
#endif
return;
}
updateBin.close();
// whe finished remove the binary from sd card to indicate end of the process
display_obj.tft.println(F("rebooting..."));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table2[3]));
#endif
Serial.println(F("rebooting..."));
//SD.remove("/update.bin");
delay(1000);
ESP.restart();
}
else {
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F("Could not load update.bin from /"));
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F(text_table2[4]));
#endif
Serial.println(F("Could not load update.bin from sd root"));
display_obj.tft.setTextColor(TFT_WHITE);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_WHITE);
#endif
}
}
void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
if (Update.begin(updateSize)) {
display_obj.tft.println("File size: " + String(updateSize));
display_obj.tft.println(F("Writing file to partition..."));
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[5] + String(updateSize));
display_obj.tft.println(F(text_table2[6]));
#endif
size_t written = Update.writeStream(updateSource);
if (written == updateSize) {
display_obj.tft.println("Written: " + String(written) + " successfully");
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[7] + String(written) + text_table2[10]);
#endif
Serial.println("Written : " + String(written) + " successfully");
}
else {
display_obj.tft.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?");
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[8] + String(written) + "/" + String(updateSize) + text_table2[9]);
#endif
Serial.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?");
}
if (Update.end()) {
Serial.println("OTA done!");
if (Update.isFinished()) {
display_obj.tft.println(F("Update complete"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table2[11]));
#endif
Serial.println(F("Update successfully completed. Rebooting."));
}
else {
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println("Update could not complete");
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(text_table2[12]);
#endif
Serial.println("Update not finished? Something went wrong!");
display_obj.tft.setTextColor(TFT_WHITE);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_WHITE);
#endif
}
}
else {
display_obj.tft.println("Error Occurred. Error #: " + String(Update.getError()));
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[13] + String(Update.getError()));
#endif
Serial.println("Error Occurred. Error #: " + String(Update.getError()));
}
}
else
{
display_obj.tft.println("Not enough space to begin OTA");
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[14]);
#endif
Serial.println("Not enough space to begin OTA");
}
}
@@ -202,8 +223,3 @@ void SDInterface::main() {
}
}
}
//void SDInterface::savePacket(uint8_t* buf, uint32_t len) {
// if (this->supported)
// buffer_obj.save(
//}

View File

@@ -1,15 +1,19 @@
#ifndef SDInterface_h
#define SDInterface_h
#include "configs.h"
#include "SD.h"
#include "Buffer.h"
#include "Display.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include <Update.h>
extern Buffer buffer_obj;
extern Display display_obj;
#define SD_CS 12
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
#ifdef KIT
#define SD_DET 4

View File

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

View File

@@ -1,6 +1,8 @@
#ifndef TemperatureInterface_h
#define TemperatureInterface_h
#include "configs.h"
#include <Arduino.h>
class TemperatureInterface {

View File

@@ -1,4 +1,5 @@
#include "Web.h"
#include "lang_var.h"
WebServer server(80);
@@ -9,7 +10,6 @@ Web::Web()
void Web::main()
{
//Serial.println("Running the shits");
// Notify if client has connected to the update server
@@ -44,18 +44,24 @@ void Web::onJavaScript(void) {
void Web::setupOTAupdate()
{
uint8_t newMACAddress[] = {0x06, 0x07, 0x0D, 0x09, 0x0E, 0x0D};
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);
#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());
display_obj.tft.print("Configuring update server...\n\n");
#ifdef HAS_SCREEN
display_obj.tft.print(text_table3[0]);
#endif
Serial.println("Configuring update server...");
display_obj.tft.setTextColor(TFT_YELLOW);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_YELLOW);
#endif
// Start WiFi AP
Serial.println("Initializing WiFi...");
@@ -76,25 +82,16 @@ void Web::setupOTAupdate()
Serial.println(wifi_scan_obj.freeRAM());
Serial.println("Displaying settings to TFT...");
display_obj.tft.print("SSID: ");
display_obj.tft.println(ssid);
display_obj.tft.print("IP address: ");
display_obj.tft.print(WiFi.softAPIP());
display_obj.tft.print("\n");
#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());
/*use mdns for host name resolution*/
/*
if (!MDNS.begin(host)) { //http://esp32.local
Serial.println("Error setting up MDNS responder!");
while (1) {
delay(1000);
}
}
Serial.println("mDNS responder started");
*/
// return javascript jquery
Serial.println("Setting server behavior...");
Serial.println(wifi_scan_obj.freeRAM());
@@ -116,11 +113,12 @@ void Web::setupOTAupdate()
}, [this]() {
HTTPUpload& upload = server.upload();
if (upload.status == UPLOAD_FILE_START) {
display_obj.tft.setTextColor(TFT_YELLOW);
display_obj.tft.print("Update: ");
display_obj.tft.print(upload.filename.c_str());
display_obj.tft.print("\n");
//display_obj.updateBanner(menu_function_obj.current_menu->name);
#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);
@@ -130,30 +128,23 @@ void Web::setupOTAupdate()
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
Update.printError(Serial);
}
//display_obj.tft.println(upload.totalSize);
/*
String display_string = "";
display_obj.tft.setCursor(0, 164);
for (int i = 0; i < 40; i++) {
display_string.concat(" ");
}
*/
display_obj.tft.setTextColor(TFT_CYAN);
display_obj.tft.fillRect(0, 164, 240, 8, TFT_BLACK);
//delay(1);
//display_obj.tft.print(display_string);
display_obj.tft.setCursor(0, 164);
display_obj.tft.print("Bytes complete: ");
display_obj.tft.print(upload.totalSize);
display_obj.tft.print("\n");
#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
//Serial.println(upload.totalSize);
} else if (upload.status == UPLOAD_FILE_END) {
if (Update.end(true)) { //true to set the size to the current progress
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.print("Update Success: ");
display_obj.tft.print(upload.totalSize);
display_obj.tft.print("\nRebooting...\n");
#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 {
@@ -168,8 +159,10 @@ void Web::setupOTAupdate()
Serial.println("Starting server...");
server.begin();
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.println("\nCompleted update server setup");
#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());
}

View File

@@ -5,6 +5,8 @@
Code taken from espressif ESP32 OTA Update example
*/
#include "configs.h"
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
@@ -12,10 +14,17 @@ Code taken from espressif ESP32 OTA Update example
#include <Update.h>
#include "Assets.h"
#include "Display.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include "WiFiScan.h"
extern Display display_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
extern WiFiScan wifi_scan_obj;
class Web

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
#ifndef WiFiScan_h
#define WiFiScan_h
#include "configs.h"
//#include <BLEDevice.h>
//#include <BLEUtils.h>
//#include <BLEScan.h>
@@ -8,15 +10,20 @@
#include <ArduinoJson.h>
// Testing NimBLE
#include <NimBLEDevice.h>
//#include <NimBLEAdvertisedDevice.h>
#ifdef HAS_BT
#include <NimBLEDevice.h>
#endif
#include <WiFi.h>
#include <math.h>
#include "esp_wifi.h"
#include "esp_wifi_types.h"
#include "esp_bt.h"
#include "Display.h"
#ifdef HAS_BT
#include "esp_bt.h"
#endif
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include "SDInterface.h"
#include "Buffer.h"
#include "BatteryInterface.h"
@@ -51,12 +58,17 @@
#define WIFI_ATTACK_AUTH 18
#define WIFI_ATTACK_MIMIC 19
#define WIFI_ATTACK_DEAUTH 20
#define WIFI_ATTACK_AP_SPAM 21
#define WIFI_SCAN_TARGET_AP_FULL 22
#define WIFI_SCAN_ACTIVE_EAPOL 23
#define GRAPH_REFRESH 100
#define MAX_CHANNEL 14
extern Display display_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
extern SDInterface sd_obj;
extern Buffer buffer_obj;
extern BatteryInterface battery_obj;
@@ -69,6 +81,7 @@ esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, b
struct ssid {
String essid;
int bssid[6];
bool selected;
};
struct AccessPoint {
@@ -76,6 +89,7 @@ struct AccessPoint {
int channel;
int bssid[6];
bool selected;
LinkedList<char>* beacon;
};
class WiFiScan
@@ -112,7 +126,9 @@ class WiFiScan
int bluetoothScanTime = 5;
int packets_sent = 0;
const wifi_promiscuous_filter_t filt = {.filter_mask=WIFI_PROMIS_FILTER_MASK_MGMT | WIFI_PROMIS_FILTER_MASK_DATA};
NimBLEScan* pBLEScan;
#ifdef HAS_BT
NimBLEScan* pBLEScan;
#endif
//String connected_network = "";
String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_";
@@ -207,7 +223,6 @@ class WiFiScan
void packetMonitorMain(uint32_t currentTime);
void eapolMonitorMain(uint32_t currentTime);
void changeChannel();
void updateMidway();
void tftDrawXScalButtons();
void tftDrawYScaleButtons();
@@ -216,8 +231,10 @@ class WiFiScan
void tftDrawGraphObjects();
void sendProbeAttack(uint32_t currentTime);
void sendDeauthAttack(uint32_t currentTime);
void sendDeauthFrame(uint8_t bssid[6], int channel);
void broadcastRandomSSID(uint32_t currentTime);
void broadcastCustomBeacon(uint32_t current_time, ssid custom_ssid);
void broadcastCustomBeacon(uint32_t current_time, AccessPoint custom_ssid);
void broadcastSetSSID(uint32_t current_time, char* ESSID);
void RunAPScan(uint8_t scan_mode, uint16_t color);
//void RunRickRoll(uint8_t scan_mode, uint16_t color);
@@ -235,7 +252,9 @@ 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);
static void scanCompleteCB(BLEScanResults scanResults);
#ifdef HAS_BT
static void scanCompleteCB(BLEScanResults scanResults);
#endif
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
@@ -267,17 +286,19 @@ class WiFiScan
int clearSSIDs();
int clearAPs();
bool addSSID(String essid);
int generateSSIDs();
int generateSSIDs(int count = 20);
bool shutdownWiFi();
bool shutdownBLE();
bool scanning();
void joinWiFi(String ssid, String password);
String getStaMAC();
String getApMAC();
String freeRAM();
void changeChannel();
void RunInfo();
void RunShutdownWiFi();
void RunShutdownBLE();
void RunGenerateSSIDs();
void RunGenerateSSIDs(int count = 20);
void RunClearSSIDs();
void RunClearAPs();
void channelHop();
@@ -291,9 +312,11 @@ class WiFiScan
static void pwnSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void apSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type);
static void deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void probeSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void beaconListSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
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);
};

View File

@@ -25,14 +25,18 @@ void A32u4Interface::begin() {
if (a32u4_rep != 0) {
this->supported = true;
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.tft.println("ATmega32U4 Found!");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.tft.println("ATmega32U4 Found!");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
}
else {
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println("ATmega32U4 Not Found");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println("ATmega32U4 Not Found");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
Serial.print("A32U4 Said: ");
Serial.println(a32u4_rep);
}
@@ -62,5 +66,4 @@ void A32u4Interface::main(uint32_t current_time) {
}
}
//delay(1);*/
}

View File

@@ -1,12 +1,18 @@
#ifndef a32u4_interface_h
#define a32u4_interface_h
#include "Display.h"
#include "configs.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include <HardwareSerial.h>
#define BAUD32U4 115200
extern Display display_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
class A32u4Interface {
public:

400
esp32_marauder/configs.h Normal file
View File

@@ -0,0 +1,400 @@
#ifndef configs_h
#define configs_h
#define POLISH_POTATO
//#define MARAUDER_MINI
//#define MARAUDER_V4
//#define MARAUDER_V6
#define MARAUDER_KIT
//#define GENERIC_ESP32
//#define MARAUDER_FLIPPER
#define MARAUDER_VERSION "v0.9.9"
//// 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
#endif
#ifdef MARAUDER_V4
#endif
//// END BUTTON DEFINITIONS
//// DISPLAY DEFINITIONS
#ifdef MARAUDER_V4
#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 9
#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_V6
#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 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 9
#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 9
#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
#define BANNER_TEXT_SIZE 1
#ifndef TFT_WIDTH
#define TFT_WIDTH 128
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 128
#endif
#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 9
#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
//// MENU DEFINITIONS
#ifdef MARAUDER_V4
#define BANNER_TIME 100
#define COMMAND_PREFIX "!"
// Keypad start position, key sizes and spacing
#define KEY_X 120 // Centre of key
#define KEY_Y 50
#define KEY_W 240 // Width and height
#define KEY_H 22
#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 22
//#define BUTTON_ARRAY_LEN 5
#endif
#ifdef MARAUDER_V6
#define BANNER_TIME 100
#define COMMAND_PREFIX "!"
// Keypad start position, key sizes and spacing
#define KEY_X 120 // Centre of key
#define KEY_Y 50
#define KEY_W 240 // Width and height
#define KEY_H 22
#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 22
//#define BUTTON_ARRAY_LEN 5
#endif
#ifdef MARAUDER_KIT
#define BANNER_TIME 100
#define COMMAND_PREFIX "!"
// Keypad start position, key sizes and spacing
#define KEY_X 120 // Centre of key
#define KEY_Y 50
#define KEY_W 240 // Width and height
#define KEY_H 22
#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 22
//#define BUTTON_ARRAY_LEN 5
#endif
#ifdef MARAUDER_MINI
#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/4.5)
#define KEY_W TFT_WIDTH // Width and height
#define KEY_H (TFT_HEIGHT/12.8)
#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 MARAUDER_V6
#define SD_CS 12
#endif
#ifdef MARAUDER_KIT
#define SD_CS 12
#endif
#ifdef MARAUDER_MINI
#define SD_CS 4
#endif
#ifdef MARAUDER_FLIPPER
#define SD_CS -1
#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_CYAN 0
#define TFT_BLUE 0
#define TFT_RED 0
#define TFT_GREEN 0
#define TFT_GREY 0
#define TFT_GRAY 0
#define TFT_MAGENTA 0
#define TFT_VIOLET 0
#define TFT_ORANGE 0
#define TFT_YELLOW 0
#define STANDARD_FONT_CHAR_LIMIT 40
#define FLASH_BUTTON -1
#include <FS.h>
#include <functional>
#include <LinkedList.h>
#include "SPIFFS.h"
#include "Assets.h"
#endif
//// END SCREEN STUFF
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -5,6 +5,13 @@ Partition Scheme: Minimal SPIFFS
https://www.online-utility.org/image/convert/to/XBM
*/
#include "configs.h"
#ifndef HAS_SCREEN
#define MenuFunctions_h
#define Display_h
#endif
#include <WiFi.h>
#include <Wire.h>
#include "esp_wifi.h"
@@ -15,11 +22,8 @@ https://www.online-utility.org/image/convert/to/XBM
#include "esp_system.h"
#include <Arduino.h>
#include "Assets.h"
#include "Display.h"
#include "WiFiScan.h"
#include "MenuFunctions.h"
#include "SDInterface.h"
#include "Web.h"
#include "Buffer.h"
@@ -27,24 +31,26 @@ https://www.online-utility.org/image/convert/to/XBM
#include "TemperatureInterface.h"
#include "LedInterface.h"
#include "esp_interface.h"
#include "a32u4_interface.h"
#include "settings.h"
//#include "icons.h"
#include "CommandLine.h"
#include "lang_var.h"
/*
#ifdef __cplusplus
extern "C" {
#ifdef HAS_SCREEN
#include "Display.h"
#include "MenuFunctions.h"
#include "a32u4_interface.h"
#endif
#ifdef MARAUDER_MINI
#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);
#endif
uint8_t temprature_sens_read();
#ifdef __cplusplus
}
#endif
uint8_t temprature_sens_read();
*/
Display display_obj;
WiFiScan wifi_scan_obj;
MenuFunctions menu_function_obj;
SDInterface sd_obj;
Web web_obj;
Buffer buffer_obj;
@@ -52,213 +58,264 @@ BatteryInterface battery_obj;
TemperatureInterface temp_obj;
LedInterface led_obj;
EspInterface esp_obj;
A32u4Interface a32u4_obj;
Settings settings_obj;
CommandLine cli_obj;
#ifdef HAS_SCREEN
Display display_obj;
MenuFunctions menu_function_obj;
A32u4Interface a32u4_obj;
#endif
const String PROGMEM version_number = MARAUDER_VERSION;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
uint32_t currentTime = 0;
void backlightOn() {
#ifdef HAS_SCREEN
#ifdef MARAUDER_MINI
digitalWrite(TFT_BL, LOW);
#endif
#ifndef MARAUDER_MINI
digitalWrite(TFT_BL, HIGH);
#endif
#endif
}
void backlightOff() {
#ifdef HAS_SCREEN
#ifdef MARAUDER_MINI
digitalWrite(TFT_BL, HIGH);
#endif
#ifndef MARAUDER_MINI
digitalWrite(TFT_BL, LOW);
#endif
#endif
}
void setup()
{
pinMode(FLASH_BUTTON, INPUT);
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, LOW);
#ifdef HAS_SCREEN
pinMode(TFT_BL, OUTPUT);
#endif
backlightOff();
#if BATTERY_ANALOG_ON == 1
pinMode(BATTERY_PIN, OUTPUT);
pinMode(CHARGING_PIN, INPUT);
#endif
// Preset SPI CS pins to avoid bus conflicts
digitalWrite(TFT_CS, HIGH);
#ifdef HAS_SCREEN
digitalWrite(TFT_CS, HIGH);
#endif
digitalWrite(SD_CS, HIGH);
Serial.begin(115200);
//Serial.begin(115200);
Serial.println("\n\nHello, World!\n");
//Serial.println("\n\nHello, World!\n");
Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
display_obj.RunSetup();
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
digitalWrite(TFT_BL, LOW);
//#ifdef HAS_SCREEN
// Serial.println("Has Screen");
//#else
// Serial.println("Does not have screen");
//#endif
#ifdef HAS_SCREEN
display_obj.RunSetup();
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
#endif
backlightOff();
// Draw the title screen
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
#ifdef HAS_SCREEN
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
#endif
//showCenterText(version_number, 250);
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
digitalWrite(TFT_BL, HIGH); // Need this
delay(2000);
display_obj.clearScreen();
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
display_obj.tft.println("Giving room for HardwareSerial...");
delay(2000);
display_obj.tft.println("Marauder " + display_obj.version_number + "\n");
display_obj.tft.println("Started Serial");
#ifdef HAS_SCREEN
//showCenterText(version_number, 250);
#ifndef MARAUDER_MINI
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
#endif
Serial.println(F("\n\n--------------------------------\n"));
Serial.println(F(" ESP32 Marauder \n"));
Serial.println(" " + display_obj.version_number + "\n");
Serial.println(F(" By: justcallmekoko\n"));
Serial.println(F("--------------------------------\n\n"));
#ifdef MARAUDER_MINI
display_obj.tft.drawCentreString(display_obj.version_number, TFT_WIDTH/2, TFT_HEIGHT, 1);
#endif
#endif
backlightOn(); // Need this
#ifdef HAS_SCREEN
delay(2000);
display_obj.clearScreen();
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
display_obj.tft.println(text_table0[0]);
delay(2000);
display_obj.tft.println("Marauder " + display_obj.version_number + "\n");
display_obj.tft.println(text_table0[1]);
#endif
//Serial.println("Internal Temp: " + (String)((temprature_sens_read() - 32) / 1.8));
settings_obj.begin();
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");
else
Serial.println("This is a test Force PMKID: false");
//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");
//else
// Serial.println("This is a test Force PMKID: false");
wifi_scan_obj.RunSetup();
Serial.println(wifi_scan_obj.freeRAM());
//Serial.println(wifi_scan_obj.freeRAM());
display_obj.tft.println("Checked RAM");
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[2]));
#endif
// Do some SD stuff
if(sd_obj.initSD()) {
Serial.println(F("SD Card supported"));
display_obj.tft.println(F("Initialized SD Card"));
//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"));
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println(F("Failed to Initialize SD Card"));
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#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
}
// Run display setup
Serial.println(wifi_scan_obj.freeRAM());
//display_obj.RunSetup();
// Build menus
Serial.println(wifi_scan_obj.freeRAM());
//menu_function_obj.RunSetup();
//display_obj.tft.println("Created Menu Structure");
// Battery stuff
Serial.println(wifi_scan_obj.freeRAM());
battery_obj.RunSetup();
display_obj.tft.println(F("Checked battery configuration"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[5]));
#endif
// Temperature stuff
Serial.println(wifi_scan_obj.freeRAM());
temp_obj.RunSetup();
#ifndef MARAUDER_FLIPPER
temp_obj.RunSetup();
#endif
display_obj.tft.println(F("Initialized temperature interface"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[6]));
#endif
battery_obj.battery_level = battery_obj.getBatteryLevel();
if (battery_obj.i2c_supported) {
Serial.println(F("IP5306 I2C Supported: true"));
}
else
Serial.println(F("IP5306 I2C Supported: false"));
Serial.println(wifi_scan_obj.freeRAM());
#ifndef MARAUDER_FLIPPER
battery_obj.battery_level = battery_obj.getBatteryLevel();
// if (battery_obj.i2c_supported) {
// Serial.println(F("IP5306 I2C Supported: true"));
// }
// else
// Serial.println(F("IP5306 I2C Supported: false"));
#endif
// Do some LED stuff
led_obj.RunSetup();
#ifndef MARAUDER_FLIPPER
led_obj.RunSetup();
#endif
display_obj.tft.println(F("Initialized LED Interface"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[7]));
//display_obj.tft.println(F("Starting..."));
delay(500);
#endif
delay(500);
//display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
// OG Logo Section
/*
digitalWrite(TFT_BL, LOW);
// Draw the title screen
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
//showCenterText(version_number, 250);
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
digitalWrite(TFT_BL, HIGH);
*/
//esp_obj.begin();
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[8]));
//a32u4_obj.begin(); // This goes last to make sure nothing is messed up when reading serial
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
delay(2000);
#endif
display_obj.tft.println(F("Starting..."));
#ifdef HAS_SCREEN
menu_function_obj.RunSetup();
#endif
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
delay(2000);
menu_function_obj.RunSetup();
//Serial.println(F("\n\n--------------------------------\n"));
//Serial.println(F(" ESP32 Marauder \n"));
//Serial.println(" " + version_number + "\n");
//Serial.println(F(" By: justcallmekoko\n"));
//Serial.println(F("--------------------------------\n\n"));
Serial.println("CLI Ready");
cli_obj.RunSetup();
}
void loop()
{
// get the current time
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
currentTime = millis();
// Update all of our objects
//if ((!display_obj.draw_tft) &&
// (wifi_scan_obj.currentScanMode != OTA_UPDATE))
if ((!display_obj.draw_tft) && (wifi_scan_obj.currentScanMode != ESP_UPDATE))
#ifdef HAS_SCREEN
bool do_draw = display_obj.draw_tft;
#else
bool do_draw = false;
#endif
if ((!do_draw) && (wifi_scan_obj.currentScanMode != ESP_UPDATE))
{
display_obj.main(wifi_scan_obj.currentScanMode);
cli_obj.main(currentTime);
#ifdef HAS_SCREEN
display_obj.main(wifi_scan_obj.currentScanMode);
#endif
wifi_scan_obj.main(currentTime);
sd_obj.main();
battery_obj.main(currentTime);
temp_obj.main(currentTime);
#ifndef MARAUDER_FLIPPER
battery_obj.main(currentTime);
temp_obj.main(currentTime);
#endif
settings_obj.main(currentTime);
//esp_obj.main(currentTime);
//a32u4_obj.main(currentTime);
//led_obj.main(currentTime);
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL))
menu_function_obj.main(currentTime);
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL)) {
#ifdef HAS_SCREEN
menu_function_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
}
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
web_obj.main();
delay(1);
}
else if ((display_obj.draw_tft) &&
(wifi_scan_obj.currentScanMode != OTA_UPDATE))
{
display_obj.drawStylus();
}
#ifdef HAS_SCREEN
else if ((display_obj.draw_tft) &&
(wifi_scan_obj.currentScanMode != OTA_UPDATE))
{
display_obj.drawStylus();
}
#endif
else if (wifi_scan_obj.currentScanMode == ESP_UPDATE) {
display_obj.main(wifi_scan_obj.currentScanMode);
menu_function_obj.main(currentTime);
//esp_obj.program();
#ifdef HAS_SCREEN
display_obj.main(wifi_scan_obj.currentScanMode);
menu_function_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
delay(1);
}
//else
//{
// web_obj.main();
//}
//Serial.println(wifi_scan_obj.currentScanMode);
//Serial.print("Run Time: ");
//Serial.print(millis() - currentTime);
//Serial.println("ms");
}

Binary file not shown.

Binary file not shown.

View File

@@ -16,7 +16,9 @@ void EspInterface::begin() {
delay(100);
display_obj.tft.println("Checking for ESP8266...");
#ifdef HAS_SCREEN
display_obj.tft.println("Checking for ESP8266...");
#endif
this->bootRunMode();
@@ -40,16 +42,20 @@ void EspInterface::begin() {
Serial.println("\nDisplay string: " + (String)display_string);
if (display_string == "ESP8266 Pong") {
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.tft.println("ESP8266 Found!");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.tft.println("ESP8266 Found!");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
Serial.println("ESP8266 Found!");
this->supported = true;
}
else {
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println("ESP8266 Not Found");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println("ESP8266 Not Found");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
}
this->initTime = millis();
@@ -57,16 +63,17 @@ void EspInterface::begin() {
void EspInterface::RunUpdate() {
this->bootProgramMode();
#ifdef HAS_SCREEN
display_obj.tft.setTextWrap(true);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.setTextWrap(true);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.println("Waiting for serial data...");
display_obj.tft.setTextColor(TFT_WHITE);
display_obj.tft.println("Waiting for serial data...");
display_obj.tft.setTextColor(TFT_WHITE);
#endif
}
void EspInterface::bootProgramMode() {
@@ -103,7 +110,9 @@ void EspInterface::program() {
}
if (Serial.available()) {
display_obj.tft.print(".");
#ifdef HAS_SCREEN
display_obj.tft.print(".");
#endif
while (Serial.available()) {
MySerial.write((uint8_t)Serial.read());
}

View File

@@ -1,14 +1,21 @@
#ifndef esp_interface_h
#define esp_interface_h
#include "Display.h"
#include "configs.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include <HardwareSerial.h>
#define ESP_RST 14
#define ESP_ZERO 13
#define BAUD 115200
extern Display display_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
class EspInterface {
public:

180
esp32_marauder/lang_var.h Normal file
View File

@@ -0,0 +1,180 @@
#ifndef lang_var_h
#define lang_var_h
#include "configs.h"
//Starting window texts
PROGMEM const char text0_0[] = "Giving room for HardwareSerial...";
PROGMEM const char text0_1[] = "Started Serial";
PROGMEM const char text0_2[] = "Checked RAM";
PROGMEM const char text0_3[] = "Initialized SD Card";
PROGMEM const char text0_4[] = "Failed to Initialize SD Card";
PROGMEM const char text0_5[] = "Checked battery configuration";
PROGMEM const char text0_6[] = "Initialized temperature interface";
PROGMEM const char text0_7[] = "Initialized LED Interface";
PROGMEM const char text0_8[] = "Starting...";
//Single library (action) texts/Often used
PROGMEM const char text00[] = "Battery Level changed: ";
PROGMEM const char text01[] = "file closed";
PROGMEM const char text02[] = "Failed to open file '";
PROGMEM const char text03[] = "ON";
PROGMEM const char text04[] = "OFF";
PROGMEM const char text05[] = "Load";
PROGMEM const char text06[] = "Save As";
PROGMEM const char text07[] = "Exit";
PROGMEM const char text08[] = "Settings";
PROGMEM const char text09[] = "Back";
PROGMEM const char text10[] = "Channel:";
PROGMEM const char text11[] = "Touch screen to exit";
PROGMEM const char text12[] = "Cancel";
PROGMEM const char text13[] = "Save";
PROGMEM const char text14[] = "Yes";
PROGMEM const char text15[] = "Opening /update.bin...";
PROGMEM const char text16[] = "Close";
PROGMEM const char text17[] = "FAIL";
PROGMEM const char text18[] = "packets/sec: ";
//Menufunctions.cpp texts
PROGMEM const char text1_0[] = "SSID List";
PROGMEM const char text1_1[] = "Add SSIDs";
PROGMEM const char text1_2[] = "SSID: ";
PROGMEM const char text1_3[] = "Password:";
PROGMEM const char text1_4[] = "Setting disabled";
PROGMEM const char text1_5[] = "Setting on";
PROGMEM const char text1_6[] = "ESP32 Marauder ";
PROGMEM const char text1_7[] = "WiFi ";
PROGMEM const char text1_8[] = "Bad USB ";
PROGMEM const char text1_9[] = "Device ";
PROGMEM const char text1_10[] = "General Apps ";
PROGMEM const char text1_11[] = "Updating... ";
PROGMEM const char text1_12[] = "Select Method ";
PROGMEM const char text1_13[] = "Confirm Update ";
PROGMEM const char text1_14[] = "ESP8266 Update ";
PROGMEM const char text1_15[] = "Update Firmware ";
PROGMEM const char text1_16[] = "Language ";
PROGMEM const char text1_17[] = "Device Info ";
PROGMEM const char text1_18[] = "Settings ";
PROGMEM const char text1_19[] = "Bluetooth ";
PROGMEM const char text1_20[] = "WiFi Sniffers ";
PROGMEM const char text1_21[] = "WiFi Attacks ";
PROGMEM const char text1_22[] = "WiFi General ";
PROGMEM const char text1_23[] = "Bluetooth Sniffers ";
PROGMEM const char text1_24[] = "Bluetooth General ";
PROGMEM const char text1_25[] = "Shutdown WiFi ";
PROGMEM const char text1_26[] = "Shutdown BLE ";
PROGMEM const char text1_27[] = "Generate SSIDs ";
PROGMEM const char text1_28[] = "Clear SSIDs ";
PROGMEM const char text1_29[] = "Clear APs ";
PROGMEM const char text1_30[] = "Reboot";
PROGMEM const char text1_31[] = "Sniffers";
PROGMEM const char text1_32[] = "Attacks";
PROGMEM const char text1_33[] = "General";
PROGMEM const char text1_34[] = "Bluetooth Sniffer";
PROGMEM const char text1_35[] = "Detect Card Skimmers";
PROGMEM const char text1_36[] = "Test BadUSB";
PROGMEM const char text1_37[] = "Run Ducky Script";
PROGMEM const char text1_38[] = "Draw";
PROGMEM const char text1_39[] = "Web Update";
PROGMEM const char text1_40[] = "SD Update";
PROGMEM const char text1_41[] = "ESP8266 Update";
PROGMEM const char text1_42[] = "Probe Request Sniff";
PROGMEM const char text1_43[] = "Beacon Sniff";
PROGMEM const char text1_44[] = "Deauth Sniff";
PROGMEM const char text1_45[] = "Packet Monitor";
PROGMEM const char text1_46[] = "EAPOL/PMKID Scan";
PROGMEM const char text1_47[] = "Detect Pwnagotchi";
PROGMEM const char text1_48[] = "Detect Espressif";
PROGMEM const char text1_49[] = "Scan APs";
PROGMEM const char text1_50[] = "Beacon Spam List";
PROGMEM const char text1_51[] = "Beacon Spam Random";
PROGMEM const char text1_52[] = "Rick Roll Beacon";
PROGMEM const char text1_53[] = "Probe Req Flood";
PROGMEM const char text1_54[] = "Deauth Flood";
PROGMEM const char text1_55[] = "Join WiFi";
PROGMEM const char text1_56[] = "Select APs";
PROGMEM const char text1_57[] = "AP Clone Spam";
//SDInterface.cpp texts
PROGMEM const char text2_0[] = "Error, could not find update.bin";
PROGMEM const char text2_1[] = "Starting SD Update...";
PROGMEM const char text2_2[] = "Error, update.bin is empty";
PROGMEM const char text2_3[] = "\nRebooting...\n";
PROGMEM const char text2_4[] = "Could not load update.bin from /";
PROGMEM const char text2_5[] = "File size: ";
PROGMEM const char text2_6[] = "Writing file to partition...";
PROGMEM const char text2_7[] = "Written: ";
PROGMEM const char text2_8[] = "Written only : ";
PROGMEM const char text2_9[] = ". Retry?";
PROGMEM const char text2_10[] = " successfully";
PROGMEM const char text2_11[] = "Update complete";
PROGMEM const char text2_12[] = "Update could not complete";
PROGMEM const char text2_13[] = "Error Occurred. Error #: ";
PROGMEM const char text2_14[] = "Not enough space to begin OTA";
//Web.cpp texts
PROGMEM const char text3_0[] = "Configuring update server...\n\n";
PROGMEM const char text3_1[] = "IP address: ";
PROGMEM const char text3_2[] = "Update: ";
PROGMEM const char text3_3[] = "Bytes complete: ";
PROGMEM const char text3_4[] = "Update Success: ";
PROGMEM const char text3_5[] = "\nCompleted update server setup";
//WiFiScan.cpp texts
PROGMEM const char text4_0[] = " RSSI: ";
PROGMEM const char text4_1[] = "Potential Skimmer: ";
PROGMEM const char text4_2[] = "Already Connected";
PROGMEM const char text4_3[] = "Failed to connect";
PROGMEM const char text4_4[] = "Connected";
PROGMEM const char text4_5[] = "Force PMKID";
PROGMEM const char text4_6[] = "Force Probe";
PROGMEM const char text4_7[] = "Save PCAP";
PROGMEM const char text4_8[] = "Probe Flood";
PROGMEM const char text4_9[] = "Clearing APs...";
PROGMEM const char text4_10[] = "APs Cleared: ";
PROGMEM const char text4_11[] = "Clearing SSIDs...";
PROGMEM const char text4_12[] = "SSIDs Cleared: ";
PROGMEM const char text4_13[] = "Generating SSIDs...";
PROGMEM const char text4_14[] = "SSIDs Generated: "; //Add spaces before to match : [15]
PROGMEM const char text4_15[] = " Total SSIDs: "; //Add spaces beforer to match : [14]
PROGMEM const char text4_16[] = "Shutting down WiFi...";
PROGMEM const char text4_17[] = "WiFi not currently initialized";
PROGMEM const char text4_18[] = "Shutting down BLE...";
PROGMEM const char text4_19[] = "BLE not currently initialized";
PROGMEM const char text4_20[] = " Firmware: Marauder"; //From 20 to 35 add spaces so : is in line like it is now
PROGMEM const char text4_21[] = " Version: ";
PROGMEM const char text4_22[] = " ESP-IDF: ";
PROGMEM const char text4_23[] = " WSL Bypass: enabled\n";
PROGMEM const char text4_24[] = " WSL Bypass: disabled\n";
PROGMEM const char text4_25[] = " Station MAC: ";
PROGMEM const char text4_26[] = " AP MAC: ";
PROGMEM const char text4_27[] = " ";
PROGMEM const char text4_28[] = " SD Card: Connected";
PROGMEM const char text4_29[] = " SD Card Size: ";
PROGMEM const char text4_30[] = " SD Card: Not Connected";
PROGMEM const char text4_31[] = " SD Card Size: 0";
PROGMEM const char text4_32[] = " IP5306 I2C: supported";
PROGMEM const char text4_33[] = " Battery Lvl: ";
PROGMEM const char text4_34[] = " IP5306 I2C: not supported";
PROGMEM const char text4_35[] = "Internal temp: ";
PROGMEM const char text4_36[] = " Detect Espressif ";
PROGMEM const char text4_37[] = " Detect Pwnagotchi ";
PROGMEM const char text4_38[] = " Beacon Sniffer ";
PROGMEM const char text4_39[] = " Deauthentication Sniffer ";
PROGMEM const char text4_40[] = " Probe Request Sniffer ";
PROGMEM const char text4_41[] = " Bluetooth Sniff ";
PROGMEM const char text4_42[] = " Detect Card Skimmers ";
PROGMEM const char text4_43[] = "Scanning for\nBluetooth-enabled skimmers\nHC-03, HC-05, and HC-06...";
PROGMEM const char text4_44[] = " AP Scan ";
//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};
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};
#endif

View File

@@ -38,8 +38,8 @@ bool Settings::begin() {
DynamicJsonDocument jsonBuffer(1024);
DeserializationError error = deserializeJson(jsonBuffer, settingsFile);
serializeJson(jsonBuffer, json_string);
Serial.println("Settings: " + (String)json_string + "\n");
this->printJsonSettings(json_string);
//Serial.println("Settings: " + (String)json_string + "\n");
//this->printJsonSettings(json_string);
this->json_settings_string = json_string;

View File

@@ -1,15 +1,19 @@
#ifndef Settings_h
#define Settings_h
#include "configs.h"
#include "SPIFFS.h"
#include <FS.h>
#include <ArduinoJson.h>
#define FORMAT_SPIFFS_IF_FAILED true
#include "Display.h"
#ifdef HAS_SCREEN
#include "Display.h"
extern Display display_obj;
extern Display display_obj;
#endif
class Settings {

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.