Compare commits

...

53 Commits

Author SHA1 Message Date
Just Call Me Koko
4c50953dde Commented the wrong thing 2023-09-06 21:21:31 -04:00
Just Call Me Koko
a2f8eabd51 Change dev board pro gps rx pin 2023-09-06 20:59:15 -04:00
Just Call Me Koko
1465245cf4 Include v6_2 asset 2023-09-06 19:58:58 -04:00
Just Call Me Koko
3b3aa9a6e5 Fix find and spelling 2023-09-06 19:41:38 -04:00
Just Call Me Koko
6e645e437a Switch back to flipper 2023-09-06 19:26:03 -04:00
Just Call Me Koko
e0f95373c1 Export binary 2023-09-06 19:17:23 -04:00
Just Call Me Koko
787490820e Fix arduino-cli syntax 2023-09-06 18:54:58 -04:00
Just Call Me Koko
1167eaca67 set warnings to none 2023-09-06 18:38:59 -04:00
Just Call Me Koko
da949387fc Add warnings flag 2023-09-06 18:24:54 -04:00
Just Call Me Koko
0ec881f309 Add another arduino compile step 2023-09-06 18:00:04 -04:00
Just Call Me Koko
57186cf4b5 Adjust hist limit 2023-09-06 16:59:13 -04:00
Just Call Me Koko
a5d1b3faaf Fix MicroNMEA ref 2023-09-06 16:45:30 -04:00
Just Call Me Koko
9b14d2daf5 Update TFT_eSPI to 2.2.23 2023-09-06 16:39:50 -04:00
Just Call Me Koko
7092fdf6cb Replace SD lib in 2.0.10 2023-09-06 15:16:51 -04:00
Just Call Me Koko
e61c859df3 Fix GPS for WiFi Dev Board Pro 2023-09-06 14:48:41 -04:00
Just Call Me Koko
9b03aeff56 Add GPS to WiFi Dev Board Pro 2023-09-06 13:55:50 -04:00
Just Call Me Koko
d39f3fc2da Add GPS for flipper wifi dev board 2023-09-05 18:42:07 -04:00
Just Call Me Koko
e92476fb26 Add GPS Data command 2023-09-05 14:23:05 -04:00
Just Call Me Koko
4b000c8d18 Revert wardrive history limit 2023-09-05 13:46:49 -04:00
Just Call Me Koko
5d4f73dbc8 Change banner render method 2023-09-05 13:34:58 -04:00
Just Call Me Koko
3337c3e7a2 Adjust wardrive mac history 2023-09-04 21:56:29 -04:00
Just Call Me Koko
bf831a19fd Move GPS data menu to device 2023-09-04 21:36:02 -04:00
Just Call Me Koko
8f2b9c709a Remove unused methods and banner 2023-09-04 21:20:51 -04:00
Just Call Me Koko
edbd601af7 Change AP limit to test mem 2023-09-04 20:16:57 -04:00
Just Call Me Koko
e174291646 Add wardrive array 2023-09-04 20:06:26 -04:00
Just Call Me Koko
1580feb1d0 Fix GPS data still refreshing 2023-09-04 18:33:50 -04:00
Just Call Me Koko
5047296c94 Some don't have GPS 2023-09-01 16:01:10 -04:00
Just Call Me Koko
26a46d6c4d Add GPS data function 2023-09-01 15:20:10 -04:00
Just Call Me Koko
86328d2788 Add v6 SMA enclosures 2023-09-01 07:44:45 -04:00
Just Call Me Koko
f48d42ae0c Fix image position 2023-08-31 23:47:54 -04:00
Just Call Me Koko
4b40c0cf22 Add old Marauder title 2023-08-31 23:22:53 -04:00
Just Call Me Koko
363817c113 Trim more fat 2023-08-31 19:41:36 -04:00
Just Call Me Koko
4cf96a8f0c Fix includes 2023-08-31 19:26:09 -04:00
Just Call Me Koko
49888fa864 Remove bluetooth general menu 2023-08-31 18:46:13 -04:00
Just Call Me Koko
56133db97a Remove general menu 2023-08-31 18:39:07 -04:00
Just Call Me Koko
ce8c70daf7 New Marauder title screen 2023-08-31 18:11:21 -04:00
Just Call Me Koko
6a26ac2e04 Remove join/shutdown wifi 2023-08-31 15:02:34 -04:00
Just Call Me Koko
bc3038c73b Trim fat 2023-08-30 21:58:15 -04:00
Just Call Me Koko
eee1b5c8c2 Add GPS menu 2023-08-30 21:36:36 -04:00
Just Call Me Koko
ddfda9c9ed Clean up mem 2023-08-30 17:48:55 -04:00
Just Call Me Koko
d140f70093 Fix what happens and stuff 2023-08-30 16:50:54 -04:00
Just Call Me Koko
7299b66255 Stupid Arduino IDE autosave 2023-08-30 16:35:48 -04:00
Just Call Me Koko
c7936b06f2 Add MicroNMEA to libs 2023-08-30 16:29:06 -04:00
Just Call Me Koko
0106081308 Detect GPS module 2023-08-30 15:57:44 -04:00
Just Call Me Koko
3c9458e0f5 Add GPS capability 2023-08-30 15:08:06 -04:00
Just Call Me Koko
2735550d3a Merge pull request #317 from justcallmekoko/master
Master to Dev
2023-08-28 16:59:27 -04:00
Just Call Me Koko
6da2d33507 Merge pull request #313 from sfjuocekr/sfjuocekr-patch-1
Fix string copy
2023-08-28 09:31:34 -04:00
Just Call Me Koko
d1e0d96543 Merge pull request #316 from AWOK559/master
Added V6 case
2023-08-28 09:29:47 -04:00
AWOK
17a4035208 Added V6 case
Added case designed by AWOK
2023-08-26 20:10:39 -07:00
Sjoer van der Ploeg
def6d2d277 Fix string copy
strncpy only copies the bytes specified, so if you set a name like "PORTAL" and then want to set a name like "HELLO" the result for apName would be "HELLOL".

Instead copy the size of MAX_AP_NAME_SIZE.
2023-08-21 19:23:03 +02:00
Just Call Me Koko
9db9c630e4 Merge pull request #308 from justcallmekoko/develop
Develop
2023-08-01 11:35:54 -04:00
Just Call Me Koko
816e620b5b Merge pull request #307 from justcallmekoko/tracedgod
Tracedgod
2023-08-01 10:30:53 -04:00
Just Call Me Koko
d8c960dbe5 Add missing semi 2023-06-22 14:44:18 -04:00
46 changed files with 128102 additions and 1664 deletions

View File

@@ -44,6 +44,13 @@ jobs:
ref: master
path: CustomAsyncTCP
- name: Install MicroNMEA
uses: actions/checkout@v2
with:
repository: stevemarple/MicroNMEA
ref: v2.0.6
path: CustomMicroNMEA
- name: Install ESPAsyncWebServer
uses: actions/checkout@v2
with:
@@ -51,11 +58,18 @@ jobs:
ref: master
path: CustomESPAsyncWebServer
#- name: Install TFT_eSPI
# uses: actions/checkout@v2
# with:
# repository: justcallmekoko/TFT_eSPI
# ref: master
# path: CustomTFT_eSPI
- name: Install TFT_eSPI
uses: actions/checkout@v2
with:
repository: justcallmekoko/TFT_eSPI
ref: master
repository: Bodmer/TFT_eSPI
ref: 2.2.23
path: CustomTFT_eSPI
- name: Install LinkedList
@@ -107,9 +121,9 @@ jobs:
ref: main
path: CustomSwitchLib
- name: Search for SD lib in arduino-esp32 v2.0.4
run: |
find /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.4arduino-esp32 -name "SD"
#- name: Search for SD lib in arduino-esp32 v2.0.4
# run: |
# find /home/runner/work/ESP32Marauder/ESP32Marauder/2.0.4arduino-esp32 -name "SD"
- name: Configure TFT_eSPI
run: |
@@ -136,9 +150,9 @@ jobs:
# ls -la /home/runner/.arduino15/packages/esp32/hardware/esp32/
# echo Whoever made me have to do this can fuck off
- name: Search for SD lib in arduino-esp32
run: |
find /home/runner/ -name "SD"
#- name: Search for SD lib in arduino-esp32
# run: |
# find /home/runner/ -name "SD"
#- name: Replace SD lib
# run: |
@@ -242,6 +256,23 @@ jobs:
sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h
sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
#- name: Build Marauder for v6 Marauder with arduino/compile-sketches
# uses: arduino/compile-sketches@v1
# with:
# sketch-paths: esp32_marauder/esp32_marauder.ino
# cli-compile-flags: |
# - --warnings="none"
# - --export-binaries
# fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
#- name: Show compiled arduino/compile-sketches v6 bin
# run: |
# find ~ -name "esp32_marauder.ino.bin"
#- name: Rename v6_2 Marauder bin
# run: |
# mv ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.v6_2.bin
- name: Build Marauder for v6 Marauder
uses: ArminJo/arduino-test-compile@v3.2.1
with:
@@ -411,6 +442,13 @@ jobs:
path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.v6.bin
retention-days: 5
#- name: 'Upload v6_2 Artifact'
# uses: actions/upload-artifact@v3
# with:
# name: esp32_marauder.v6_2.bin
# path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.v6_2.bin
# retention-days: 5
- name: 'Upload Kit Artifact'
uses: actions/upload-artifact@v3
with:
@@ -517,6 +555,18 @@ jobs:
asset_name: esp32_marauder.v6.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
#- name: Upload v6_2 Asset
# id: upload-v6-2-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.v6_2.bin
# asset_name: esp32_marauder.v6_2.bin
# asset_content_type: application/bin
# if: github.event_name != 'pull_request'
- name: Upload Kit Asset
id: upload-kit-release-asset

File diff suppressed because one or more lines are too long

View File

@@ -215,6 +215,7 @@ void CommandLine::runCommand(String input) {
Serial.println(HELP_UPDATE_CMD_A);
Serial.println(HELP_LS_CMD);
Serial.println(HELP_LED_CMD);
Serial.println(HELP_GPS_DATA_CMD);
// WiFi sniff/scan
Serial.println(HELP_EVIL_PORTAL_CMD);
@@ -240,7 +241,6 @@ void CommandLine::runCommand(String input) {
Serial.println(HELP_SEL_CMD_A);
Serial.println(HELP_SSID_CMD_A);
Serial.println(HELP_SSID_CMD_B);
Serial.println(HELP_JOIN_WIFI_CMD);
// Bluetooth sniff/scan
Serial.println(HELP_BT_SNIFF_CMD);
@@ -271,6 +271,18 @@ void CommandLine::runCommand(String input) {
menu_function_obj.changeMenu(menu_function_obj.current_menu);
#endif
}
else if (cmd_args.get(0) == GPS_DATA_CMD) {
#ifdef HAS_GPS
if (gps_obj.getGpsModuleStatus()) {
Serial.println("Getting GPS Data. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_DATA;
#ifdef HAS_SCREEN
menu_function_obj.changeMenu(&menu_function_obj.gpsInfoMenu);
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_DATA, TFT_CYAN);
}
#endif
}
// LED command
else if (cmd_args.get(0) == LED_CMD) {
int hex_arg = this->argSearch(&cmd_args, "-s");
@@ -995,7 +1007,7 @@ void CommandLine::runCommand(String input) {
}
}
// Join WiFi
else if (cmd_args.get(0) == JOINWIFI_CMD) {
/*else if (cmd_args.get(0) == JOINWIFI_CMD) {
int n_sw = this->argSearch(&cmd_args, "-n"); // name
int a_sw = this->argSearch(&cmd_args, "-a"); // access point
int s_sw = this->argSearch(&cmd_args, "-s"); // ssid
@@ -1030,5 +1042,5 @@ void CommandLine::runCommand(String input) {
}
Serial.println("Attempting to join WiFi with ssid " + (String)essid);
wifi_scan_obj.joinWiFi(essid, pwx);
}
}*/
}

View File

@@ -45,6 +45,7 @@ const char PROGMEM HELP_CMD[] = "help";
const char PROGMEM SETTINGS_CMD[] = "settings";
const char PROGMEM LS_CMD[] = "ls";
const char PROGMEM LED_CMD[] = "led";
const char PROGMEM GPS_DATA_CMD[] = "gpsdata";
// WiFi sniff/scan
const char PROGMEM EVIL_PORTAL_CMD[] = "evilportal";
@@ -71,7 +72,6 @@ const char PROGMEM ATTACK_TYPE_RR[] = "rickroll";
const char PROGMEM LIST_AP_CMD[] = "list";
const char PROGMEM SEL_CMD[] = "select";
const char PROGMEM SSID_CMD[] = "ssid";
const char PROGMEM JOINWIFI_CMD[] = "join";
// Bluetooth sniff/scan
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
@@ -88,6 +88,7 @@ const char PROGMEM HELP_UPDATE_CMD_A[] = "update -s/-w";
const char PROGMEM HELP_SETTINGS_CMD[] = "settings [-s <setting> enable/disable>]/[-r]";
const char PROGMEM HELP_LS_CMD[] = "ls <directory>";
const char PROGMEM HELP_LED_CMD[] = "led -s <hex color>/-p <rainbow>";
const char PROGMEM HELP_GPS_DATA_CMD[] = "gpsdata";
// WiFi sniff/scan
const char PROGMEM HELP_EVIL_PORTAL_CMD[] = "evilportal [-c start]";
@@ -102,7 +103,6 @@ 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>][-d][-l]";
const char PROGMEM HELP_STOPSCAN_CMD[] = "stopscan";
const char PROGMEM HELP_JOIN_WIFI_CMD[] = "join [-n <ssid_name>/-s <ssid_index>/-a <access_point_index>] -p <password>";
// WiFi attack
const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth [-c]/[-s <src mac>] [-d <dst mac>]/probe/rickroll>";

View File

@@ -319,7 +319,7 @@ void Display::displayBuffer(bool do_clear)
void Display::showCenterText(String text, int y)
{
tft.setCursor((SCREEN_WIDTH - (text.length() * 6)) / 2, y);
tft.setCursor((SCREEN_WIDTH - (text.length() * (6 * BANNER_TEXT_SIZE))) / 2, y);
tft.println(text);
}
@@ -427,7 +427,7 @@ void Display::drawJpeg(const char *filename, int xpos, int ypos) {
// the filename can be a String or character array type:
//boolean decoded = JpegDec.decodeFsFile(filename); // or pass the filename (leading / distinguishes SPIFFS files)
boolean decoded = JpegDec.decodeArray(MarauderTitle, 13578);
boolean decoded = JpegDec.decodeArray(MarauderTitle, MARAUDER_TITLE_BYTES);
if (decoded) {
// print information about the image to the serial port
@@ -441,13 +441,13 @@ void Display::drawJpeg(const char *filename, int xpos, int ypos) {
//}
}
void Display::setupDraw() {
/*void Display::setupDraw() {
this->tft.drawLine(0, 0, 10, 0, TFT_MAGENTA);
this->tft.drawLine(0, 0, 0, 10, TFT_GREEN);
this->tft.drawLine(0, 0, 0, 0, TFT_CYAN);
}
}*/
uint16_t xlast;
/*uint16_t xlast;
uint16_t ylast;
uint32_t AH;
void Display::drawStylus()
@@ -513,7 +513,7 @@ void Display::drawStylus()
xlast = 0;
ylast = 0;
}
}
}*/
//====================================================================================
// Decode and render the Jpeg image onto the TFT screen
@@ -751,20 +751,20 @@ void Display::listDir(fs::FS &fs, const char * dirname, uint8_t levels) {
void Display::updateBanner(String msg)
{
this->img.deleteSprite();
//this->img.deleteSprite();
this->img.setColorDepth(8);
//this->img.setColorDepth(8);
this->img.createSprite(SCREEN_WIDTH, TEXT_HEIGHT);
//this->img.createSprite(SCREEN_WIDTH, TEXT_HEIGHT);
this->buildBanner(msg, current_banner_pos);
this->img.pushSprite(0, STATUS_BAR_WIDTH);
//this->img.pushSprite(0, STATUS_BAR_WIDTH);
current_banner_pos--;
//current_banner_pos--;
if (current_banner_pos <= 0)
current_banner_pos = SCREEN_WIDTH + 2;
//if (current_banner_pos <= 0)
// current_banner_pos = SCREEN_WIDTH + 2;
}
@@ -772,6 +772,13 @@ void Display::buildBanner(String msg, int xpos)
{
int h = TEXT_HEIGHT;
this->tft.fillRect(0, STATUS_BAR_WIDTH, SCREEN_WIDTH, TEXT_HEIGHT, TFT_BLACK);
this->tft.setFreeFont(NULL); // Font 4 selected
this->tft.setTextSize(BANNER_TEXT_SIZE); // Font size scaling is x1
this->tft.setTextColor(TFT_WHITE, TFT_BLACK); // Black text, no background colour
this->showCenterText(msg, STATUS_BAR_WIDTH);
/*
// We could just use fillSprite(color) but lets be a bit more creative...
// Fill with rainbow stripes
@@ -793,6 +800,7 @@ void Display::buildBanner(String msg, int xpos)
img.setCursor(xpos - SCREEN_WIDTH, 2); // Print text at xpos - sprite width
img.print(msg);
*/
}
void Display::main(uint8_t scan_mode)

View File

@@ -8,12 +8,10 @@
#include <FS.h>
#include <functional>
#include <JPEGDecoder.h>
//#include <SimpleList.h>
#include <LinkedList.h>
#include <SPI.h>
#include <lvgl.h>
#include <Ticker.h>
//#include <M5Stack.h>
#include "SPIFFS.h"
#include "Assets.h"
@@ -39,23 +37,6 @@
#define LV_ADD_SSID 14
#define WIFI_ATTACK_BEACON_LIST 15
/*
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);
PROGMEM static lv_disp_buf_t disp_buf;
PROGMEM static lv_color_t buf[LV_HOR_RES_MAX * 10];
PROGMEM static void ta_event_cb(lv_obj_t * ta, lv_event_t event);
PROGMEM static void keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
// lvgl stuff
PROGMEM static lv_obj_t *kb;
*/
// #define KIT
// #define TFT_DIY
class Display
{
private:
@@ -76,16 +57,9 @@ class Display
void scrollScreenBuffer(bool down = false);
#endif
//void addNodes(Menu* menu, String name, Menu* child, std::function<void()> callable);
//void changeMenu(Menu* menu);
//void showMenuList(Menu* menu, int layer);
//static void lv_tick_handler();
public:
Display();
//Ticker tick;
TFT_eSPI tft = TFT_eSPI();
TFT_eSprite img = TFT_eSprite(&tft);
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
const String PROGMEM version_number = MARAUDER_VERSION;
@@ -95,15 +69,9 @@ class Display
bool draw_tft = false;
bool exit_draw = false;
int TOP_FIXED_AREA_2 = 48;
int print_delay_1, print_delay_2 = 10;
int current_banner_pos = SCREEN_WIDTH;
//Menu* current_menu;
//Menu mainMenu;
//Menu wifiMenu;
//Menu bluetoothMenu;
uint8_t TOP_FIXED_AREA_2 = 48;
uint8_t print_delay_1, print_delay_2 = 10;
uint8_t current_banner_pos = SCREEN_WIDTH;
LinkedList<String>* display_buffer;
@@ -127,9 +95,6 @@ class Display
// We can speed up scrolling of short text lines by just blanking the character we drew
int blank[19]; // We keep all the strings pixel lengths to optimise the speed of the top line blanking
//void initLVGL();
//void deinitLVGL();
//void joinWiFiGFX();
void tftDrawRedOnOffButton();
void tftDrawGreenOnOffButton();
void tftDrawGraphObjects(byte x_scale);
@@ -143,8 +108,6 @@ class Display
void clearScreen();
void displayBuffer(bool do_clear = false);
void drawJpeg(const char *filename, int xpos, int ypos);
void setupDraw();
void drawStylus();
void getTouchWhileFunction(bool pressed);
void initScrollValues(bool tte = false);
void jpegInfo();

View File

@@ -203,7 +203,7 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
}
if (ap_config != "") {
strncpy(apName, ap_config.c_str(), strlen(ap_config.c_str()));
strncpy(apName, ap_config.c_str(), MAX_AP_NAME_SIZE);
this->has_ap = true;
Serial.println("ap config set");
return true;
@@ -304,4 +304,4 @@ void EvilPortal::main(uint8_t scan_mode) {
#endif
}
}
}
}

View File

@@ -45,18 +45,18 @@ char index_html[MAX_HTML_SIZE] = "TEST";
struct ssid {
String essid;
uint8_t channel;
int bssid[6];
uint8_t bssid[6];
bool selected;
};
struct AccessPoint {
String essid;
int channel;
int bssid[6];
uint8_t channel;
uint8_t bssid[6];
bool selected;
LinkedList<char>* beacon;
int rssi;
LinkedList<int>* stations;
char rssi;
LinkedList<uint8_t>* stations;
};
class CaptiveRequestHandler : public AsyncWebHandler {

View File

@@ -0,0 +1,113 @@
#include "GpsInterface.h"
#ifdef HAS_GPS
char nmeaBuffer[100];
MicroNMEA nmea(nmeaBuffer, sizeof(nmeaBuffer));
HardwareSerial Serial2(GPS_SERIAL_INDEX);
void GpsInterface::begin() {
Serial2.begin(9600, SERIAL_8N1, GPS_TX, GPS_RX);
MicroNMEA::sendSentence(Serial2, "$PSTMSETPAR,1201,0x00000042");
MicroNMEA::sendSentence(Serial2, "$PSTMSAVEPAR");
MicroNMEA::sendSentence(Serial2, "$PSTMSRR");
delay(4000);
if (Serial2.available()) {
Serial.println("GPS Attached Successfully");
this->gps_enabled = true;
while (Serial2.available())
Serial2.read();
}
}
// Thanks JosephHewitt
String GpsInterface::dt_string_from_gps(){
//Return a datetime String using GPS data only.
String datetime = "";
if (nmea.isValid() && nmea.getYear() > 0){
datetime += nmea.getYear();
datetime += "-";
datetime += nmea.getMonth();
datetime += "-";
datetime += nmea.getDay();
datetime += " ";
datetime += nmea.getHour();
datetime += ":";
datetime += nmea.getMinute();
datetime += ":";
datetime += nmea.getSecond();
}
return datetime;
}
void GpsInterface::setGPSInfo() {
this->good_fix = nmea.isValid();
this->num_sats = nmea.getNumSatellites();
this->datetime = this->dt_string_from_gps();
this->lat = String((float)nmea.getLatitude()/1000000, 7);
this->lon = String((float)nmea.getLongitude()/1000000, 7);
long alt = 0;
if (!nmea.getAltitude(alt)){
alt = 0;
}
this->altf = (float)alt / 1000;
//nmea.clear();
}
String GpsInterface::getLat() {
return this->lat;
}
String GpsInterface::getLon() {
return this->lon;
}
float GpsInterface::getAlt() {
return this->altf;
}
String GpsInterface::getDatetime() {
return this->datetime;
}
String GpsInterface::getNumSatsString() {
return (String)num_sats;
}
bool GpsInterface::getFixStatus() {
return this->good_fix;
}
bool GpsInterface::getGpsModuleStatus() {
return this->gps_enabled;
}
void GpsInterface::main() {
while (Serial2.available()) {
//Fetch the character one by one
char c = Serial2.read();
//Serial.print(c);
//Pass the character to the library
nmea.process(c);
}
uint8_t num_sat = nmea.getNumSatellites();
if ((nmea.isValid()) && (num_sat > 0))
this->setGPSInfo();
else if ((!nmea.isValid()) && (num_sat <= 0)) {
this->setGPSInfo();
}
}
#endif

View File

@@ -0,0 +1,36 @@
#ifndef GpsInterface_h
#define GpsInterface_h
#include <MicroNMEA.h>
#include "configs.h"
class GpsInterface {
public:
void begin();
void main();
String getNumSatsString();
bool getFixStatus();
bool getGpsModuleStatus();
String getLat();
String getLon();
float getAlt();
String getDatetime();
private:
// GPS Info
String lat = "";
String lon = "";
float altf = 0.0;
String datetime = "";
bool gps_enabled = false;
bool good_fix = false;
uint8_t num_sats = 0;
String dt_string_from_gps();
void setGPSInfo();
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -8,12 +8,8 @@
#define BATTERY_ANALOG_ON 0
#include "WiFiScan.h"
#include "Display.h"
#include "BatteryInterface.h"
#include "SDInterface.h"
//#include "Web.h"
//#include "esp_interface.h"
//#include "a32u4_interface.h"
#include "settings.h"
#ifdef HAS_BUTTONS
@@ -25,13 +21,9 @@
extern SwitchLib c_btn;
#endif
extern Display display_obj;
extern WiFiScan wifi_scan_obj;
//extern Web web_obj;
extern SDInterface sd_obj;
extern BatteryInterface battery_obj;
//extern EspInterface esp_obj;
//extern A32u4Interface a32u4_obj;
extern Settings settings_obj;
#define FLASH_BUTTON 0
@@ -68,17 +60,15 @@ extern Settings settings_obj;
#define STATUS_BAT 22
#define STATUS_SD 23
#define PWNAGOTCHI 24
#define ESPRESSIF 25
#define SHUTDOWN 26
#define BEACON_LIST 27
#define GENERATE 28
#define CLEAR_ICO 29
#define KEYBOARD_ICO 30
#define JOIN_WIFI 31
#define ESP_UPDATE_ICO 32
#define BAD_USB_ICO 33
#define TEST_BAD_USB_ICO 34
#define LANGUAGE 35
#define SHUTDOWN 25
#define BEACON_LIST 26
#define GENERATE 27
#define CLEAR_ICO 28
#define KEYBOARD_ICO 29
#define JOIN_WIFI 30
#define LANGUAGE 31
#define STATUS_GPS 32
#define GPS_MENU 33
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);
@@ -87,15 +77,10 @@ PROGMEM static lv_disp_buf_t disp_buf;
PROGMEM static lv_color_t buf[LV_HOR_RES_MAX * 10];
PROGMEM static void ta_event_cb(lv_obj_t * ta, lv_event_t event);
PROGMEM static void join_wifi_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
PROGMEM static void add_ssid_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
PROGMEM static void write_bad_usb_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
PROGMEM static void load_btn_cb(lv_obj_t * load_btn, lv_event_t event);
PROGMEM static void test_btn_cb(lv_obj_t * load_btn, lv_event_t event);
PROGMEM static void ap_list_cb(lv_obj_t * btn, lv_event_t event);
PROGMEM static void station_list_cb(lv_obj_t * btn, lv_event_t event);
PROGMEM static void setting_dropdown_cb(lv_obj_t * btn, lv_event_t event);
PROGMEM static void save_as_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
// lvgl stuff
PROGMEM static lv_obj_t *kb;
@@ -107,9 +92,9 @@ struct Menu;
struct MenuNode {
String name;
String command;
bool command;
uint16_t color;
int icon;
uint8_t icon;
TFT_eSPI_Button* button;
bool selected;
std::function<void()> callable;
@@ -132,7 +117,6 @@ class MenuFunctions
uint32_t initTime = 0;
//Menu* current_menu;
// Main menu stuff
Menu mainMenu;
@@ -140,14 +124,12 @@ class MenuFunctions
Menu wifiMenu;
Menu bluetoothMenu;
Menu badusbMenu;
Menu generalMenu;
Menu deviceMenu;
// Device menu stuff
Menu whichUpdateMenu;
Menu failedUpdateMenu;
Menu confirmMenu;
Menu espUpdateMenu;
Menu updateMenu;
Menu settingsMenu;
Menu specSettingMenu;
@@ -162,11 +144,8 @@ class MenuFunctions
// Bluetooth menu stuff
Menu bluetoothSnifferMenu;
Menu bluetoothGeneralMenu;
// Settings things menus
Menu shutdownWiFiMenu;
Menu shutdownBLEMenu;
Menu generateSSIDsMenu;
static void lv_tick_handler();
@@ -174,7 +153,6 @@ class MenuFunctions
// Menu icons
//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, String command = "");
void updateStatusBar();
@@ -194,6 +172,11 @@ class MenuFunctions
Menu clearSSIDsMenu;
Menu clearAPsMenu;
#ifdef HAS_GPS
// GPS Menu
Menu gpsInfoMenu;
#endif
Ticker tick;
uint16_t x = -1, y = -1;
@@ -203,13 +186,9 @@ class MenuFunctions
void initLVGL();
void deinitLVGL();
void joinWiFiGFX();
void addSSIDGFX();
void addAPGFX();
void addStationGFX();
void displaySettingsGFX();
void writeBadUSB();
void buildButtons(Menu* menu, int starting_index = 0);
void changeMenu(Menu* menu);
void drawStatusBar();

View File

@@ -1,33 +0,0 @@
#include "TemperatureInterface.h"
#ifdef __cplusplus
extern "C" {
#endif
uint8_t temprature_sens_read();
#ifdef __cplusplus
}
#endif
uint8_t temprature_sens_read();
TemperatureInterface::TemperatureInterface() {
}
void TemperatureInterface::RunSetup() {
this->initTime = millis();
this->current_temp = this->getCurrentTemp();
}
uint8_t TemperatureInterface::getCurrentTemp() {
return ((temprature_sens_read() - 32) / 1.8);
}
void TemperatureInterface::main(uint32_t currentTime) {
if (currentTime != 0) {
if (currentTime - initTime >= 100) {
//Serial.println("Checking Battery Level");
this->initTime = millis();
this->current_temp = this->getCurrentTemp();
}
}
}

View File

@@ -1,24 +0,0 @@
#ifndef TemperatureInterface_h
#define TemperatureInterface_h
#include "configs.h"
#include <Arduino.h>
class TemperatureInterface {
private:
uint32_t initTime = 0;
public:
TemperatureInterface();
uint8_t current_temp = 0;
uint8_t old_temp = 0;
uint8_t getCurrentTemp();
void RunSetup();
void main(uint32_t currentTime);
};
#endif

View File

@@ -207,7 +207,7 @@ int WiFiScan::generateSSIDs(int count) {
return num_gen;
}
void WiFiScan::joinWiFi(String ssid, String password)
/*void WiFiScan::joinWiFi(String ssid, String password)
{
static const char * btns[] ={text16, ""};
int count = 0;
@@ -218,7 +218,7 @@ void WiFiScan::joinWiFi(String ssid, String password)
lv_msgbox_set_text(mbox1, text_table4[2]);
lv_msgbox_add_btns(mbox1, btns);
lv_obj_set_width(mbox1, 200);
lv_obj_align(mbox1, NULL, LV_ALIGN_CENTER, 0, 0); /*Align to the corner*/
lv_obj_align(mbox1, NULL, LV_ALIGN_CENTER, 0, 0); //Align to the corner
#endif
this->wifi_initialized = true;
return;
@@ -249,7 +249,7 @@ void WiFiScan::joinWiFi(String ssid, String password)
lv_msgbox_add_btns(mbox1, btns);
lv_obj_set_width(mbox1, 200);
//lv_obj_set_event_cb(mbox1, event_handler);
lv_obj_align(mbox1, NULL, LV_ALIGN_CENTER, 0, 0); /*Align to the corner*/
lv_obj_align(mbox1, NULL, LV_ALIGN_CENTER, 0, 0); //Align to the corner
#endif
WiFi.mode(WIFI_OFF);
return;
@@ -261,7 +261,7 @@ void WiFiScan::joinWiFi(String ssid, String password)
lv_msgbox_set_text(mbox1, text_table4[4]);
lv_msgbox_add_btns(mbox1, btns);
lv_obj_set_width(mbox1, 200);
lv_obj_align(mbox1, NULL, LV_ALIGN_CENTER, 0, 0); /*Align to the corner*/
lv_obj_align(mbox1, NULL, LV_ALIGN_CENTER, 0, 0); //Align to the corner
#endif
connected_network = ssid;
@@ -269,7 +269,7 @@ void WiFiScan::joinWiFi(String ssid, String password)
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
this->wifi_initialized = true;
}
}*/
// Apply WiFi settings
void WiFiScan::initWiFi(uint8_t scan_mode) {
@@ -355,13 +355,6 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
RunBluetoothScan(scan_mode, color);
#endif
}
else if (scan_mode == WIFI_SCAN_ESPRESSIF)
RunEspressifScan(scan_mode, color);
else if (scan_mode == LV_JOIN_WIFI) {
#ifdef HAS_SCREEN
RunLvJoinWiFi(scan_mode, color);
#endif
}
else if (scan_mode == LV_ADD_SSID) {
#ifdef HAS_SCREEN
RunLvJoinWiFi(scan_mode, color);
@@ -490,7 +483,6 @@ void WiFiScan::StopScan(uint8_t scan_mode)
(currentScanMode == WIFI_SCAN_TARGET_AP) ||
(currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
(currentScanMode == WIFI_SCAN_PWN) ||
(currentScanMode == WIFI_SCAN_ESPRESSIF) ||
(currentScanMode == WIFI_SCAN_EAPOL) ||
(currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) ||
(currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) ||
@@ -774,34 +766,7 @@ void WiFiScan::RunGenerateSSIDs(int count) {
#endif
}
void WiFiScan::RunShutdownWiFi() {
#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_CYAN);
display_obj.tft.print(F(text_table4[16]));
#endif
if (this->wifi_initialized) {
this->shutdownWiFi();
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.println(F("OK"));
#endif
}
else {
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F(text17));
display_obj.tft.println(F(text_table4[17]));
#endif
}
}
void WiFiScan::RunShutdownBLE() {
/*void WiFiScan::RunShutdownBLE() {
#ifdef HAS_SCREEN
display_obj.tft.setTextWrap(false);
display_obj.tft.setFreeFont(NULL);
@@ -826,6 +791,51 @@ void WiFiScan::RunShutdownBLE() {
display_obj.tft.println(F(text_table4[19]));
#endif
}
}*/
void WiFiScan::RunGPSInfo() {
#ifdef HAS_GPS
Serial.println("Refreshing GPS Data on screen...");
#ifdef HAS_SCREEN
// Get screen position ready
display_obj.tft.setTextWrap(false);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_CYAN);
// Clean up screen first
//display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
display_obj.tft.fillRect(0, (SCREEN_HEIGHT / 3) - 6, SCREEN_WIDTH, SCREEN_HEIGHT - ((SCREEN_HEIGHT / 3) - 6), TFT_BLACK);
// Print the GPS data: 3
display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3);
if (gps_obj.getFixStatus())
display_obj.tft.println(" Good Fix: Yes");
else
display_obj.tft.println(" Good Fix: No");
display_obj.tft.println("Satellites: " + gps_obj.getNumSatsString());
display_obj.tft.println(" Latitude: " + gps_obj.getLat());
display_obj.tft.println(" Longitude: " + gps_obj.getLon());
display_obj.tft.println(" Altitude: " + (String)gps_obj.getAlt());
display_obj.tft.println(" Datetime: " + gps_obj.getDatetime());
#endif
// Display to serial
Serial.println("==== GPS Data ====");
if (gps_obj.getFixStatus())
Serial.println(" Good Fix: Yes");
else
Serial.println(" Good Fix: No");
Serial.println("Satellites: " + gps_obj.getNumSatsString());
Serial.println(" Latitude: " + gps_obj.getLat());
Serial.println(" Longitude: " + gps_obj.getLon());
Serial.println(" Altitude: " + (String)gps_obj.getAlt());
Serial.println(" Datetime: " + gps_obj.getDatetime());
#endif
}
void WiFiScan::RunInfo()
@@ -833,11 +843,7 @@ void WiFiScan::RunInfo()
String sta_mac = this->getStaMAC();
String ap_mac = this->getApMAC();
String free_ram = this->freeRAM();
//Serial.print("STA MAC: ");
//Serial.println(sta_mac);
//Serial.print("AP MAC: ");
//Serial.println(ap_mac);
Serial.println(free_ram);
#ifdef HAS_SCREEN
@@ -905,55 +911,9 @@ void WiFiScan::RunInfo()
}
#endif
#ifdef HAS_SCREEN
display_obj.tft.println(text_table4[35] + (String)temp_obj.current_temp + " C");
#endif
}
void WiFiScan::RunEspressifScan(uint8_t scan_mode, uint16_t color) {
#ifdef WRITE_PACKETS_SERIAL
buffer_obj.open();
#elif defined(HAS_SD)
sd_obj.openCapture("espressif");
#else
return;
#endif
#ifdef MARAUDER_FLIPPER
flipper_led.sniffLED();
#elif defined(XIAO_ESP32_S3)
xiao_led.sniffLED();
#else
led_obj.setMode(MODE_SNIFF);
#endif
#ifdef HAS_SCREEN
display_obj.TOP_FIXED_AREA_2 = 48;
display_obj.tteBar = true;
display_obj.print_delay_1 = 15;
display_obj.print_delay_2 = 10;
display_obj.initScrollValues(true);
display_obj.tft.setTextWrap(false);
display_obj.tft.setTextColor(TFT_WHITE, color);
#ifndef MARAUDER_MINI
display_obj.tft.fillRect(0,16,240,16, color);
display_obj.tft.drawCentreString(text_table4[36],120,16,2);
display_obj.touchToExit();
#endif
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.setupScrollArea(display_obj.TOP_FIXED_AREA_2, BOT_FIXED_AREA);
#endif
esp_wifi_init(&cfg);
esp_wifi_set_storage(WIFI_STORAGE_RAM);
esp_wifi_set_mode(WIFI_MODE_NULL);
esp_wifi_start();
esp_wifi_set_promiscuous(true);
esp_wifi_set_promiscuous_filter(&filt);
esp_wifi_set_promiscuous_rx_cb(&espressifSnifferCallback);
esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
this->wifi_initialized = true;
initTime = millis();
//#ifdef HAS_SCREEN
// display_obj.tft.println(text_table4[35] + (String)temp_obj.current_temp + " C");
//#endif
}
void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
@@ -1548,78 +1508,6 @@ void WiFiScan::getMAC(char *addr, uint8_t* data, uint16_t offset) {
sprintf(addr, "%02x:%02x:%02x:%02x:%02x:%02x", data[offset+0], data[offset+1], data[offset+2], data[offset+3], data[offset+4], data[offset+5]);
}
void WiFiScan::espressifSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
{
wifi_promiscuous_pkt_t *snifferPacket = (wifi_promiscuous_pkt_t*)buf;
WifiMgmtHdr *frameControl = (WifiMgmtHdr*)snifferPacket->payload;
wifi_pkt_rx_ctrl_t ctrl = (wifi_pkt_rx_ctrl_t)snifferPacket->rx_ctrl;
int len = snifferPacket->rx_ctrl.sig_len;
String display_string = "";
String src_addr_string = "";
if (type == WIFI_PKT_MGMT)
{
len -= 4;
}
int fctl = ntohs(frameControl->fctl);
const wifi_ieee80211_packet_t *ipkt = (wifi_ieee80211_packet_t *)snifferPacket->payload;
const WifiMgmtHdr *hdr = &ipkt->hdr;
// If we dont the buffer size is not 0, don't write or else we get CORRUPT_HEAP
//if ((snifferPacket->payload[0] == 0x80) && (display_obj.display_buffer->size() == 0))
//{
char addr[] = "00:00:00:00:00:00";
getMAC(addr, snifferPacket->payload, 10);
src_addr_string.concat(addr);
bool match = false;
for (int i = 0; i < (sizeof(espressif_macs) / sizeof(espressif_macs[0])); i++) {
if (src_addr_string.startsWith(espressif_macs[i])) {
match = true;
break;
}
}
if (!match)
return;
delay(random(0, 10));
Serial.print("RSSI: ");
Serial.print(snifferPacket->rx_ctrl.rssi);
Serial.print(" Ch: ");
Serial.print(snifferPacket->rx_ctrl.channel);
Serial.print(" BSSID: ");
Serial.print(addr);
//display_string.concat(" RSSI: ");
//display_string.concat(snifferPacket->rx_ctrl.rssi);
display_string.concat("CH: " + (String)snifferPacket->rx_ctrl.channel);
//display_string.concat(" ");
display_string.concat(" -> ");
display_string.concat(addr);
for (int i = 0; i < 19 - snifferPacket->payload[37]; i++)
{
display_string.concat(" ");
}
Serial.print(" ");
#ifdef HAS_SCREEN
display_obj.loading = true;
display_obj.display_buffer->add(display_string);
display_obj.loading = false;
#endif
Serial.println();
addPacket(snifferPacket, len);
}
void WiFiScan::pwnSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
{
wifi_promiscuous_pkt_t *snifferPacket = (wifi_promiscuous_pkt_t*)buf;
@@ -1844,7 +1732,7 @@ void WiFiScan::apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type
ap.bssid[4] = snifferPacket->payload[14];
ap.bssid[5] = snifferPacket->payload[15];
ap.selected = false;
ap.stations = new LinkedList<int>();
ap.stations = new LinkedList<uint8_t>();
ap.beacon = new LinkedList<char>();
@@ -1992,7 +1880,7 @@ void WiFiScan::apSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
false,
NULL,
snifferPacket->rx_ctrl.rssi,
new LinkedList<int>()};
new LinkedList<uint8_t>()};
access_points->add(ap);
@@ -2708,7 +2596,7 @@ void WiFiScan::broadcastCustomBeacon(uint32_t current_time, ssid custom_ssid) {
}
// Function to send beacons with random ESSID length
void WiFiScan::broadcastSetSSID(uint32_t current_time, char* ESSID) {
void WiFiScan::broadcastSetSSID(uint32_t current_time, const char* ESSID) {
set_channel = random(1,12);
esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE);
delay(1);
@@ -2819,7 +2707,6 @@ void WiFiScan::sendProbeAttack(uint32_t currentTime) {
// Set SSID length
int ssidLen = access_points->get(i).essid.length();
//int rand_len = sizeof(rand_reg);
int fullLen = ssidLen;
prob_req_packet[25] = fullLen;
@@ -2829,16 +2716,6 @@ void WiFiScan::sendProbeAttack(uint32_t currentTime) {
for(int i = 0; i < ssidLen; i++)
prob_req_packet[26 + i] = buf[i];
/*
* 0x01, 0x08, 0x8c, 0x12, 0x18, 0x24,
0x30, 0x48, 0x60, 0x6c, 0x2d, 0x1a,
0xad, 0x01, 0x17, 0xff, 0xff, 0x00,
0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
*/
uint8_t postSSID[40] = {0x00, 0x00, 0x01, 0x08, 0x8c, 0x12,
0x18, 0x24, 0x30, 0x48, 0x60, 0x6c,
@@ -2868,7 +2745,7 @@ void WiFiScan::sendProbeAttack(uint32_t currentTime) {
}
}
void WiFiScan::sendDeauthFrame(int bssid[6], int channel, uint8_t mac[6]) {
void WiFiScan::sendDeauthFrame(uint8_t bssid[6], int channel, uint8_t mac[6]) {
WiFiScan::set_channel = channel;
esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE);
delay(1);
@@ -3102,14 +2979,6 @@ void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
if (send_deauth) {
if (snifferPacket->payload[0] == 0x80) {
// Build packet
/*uint8_t new_packet[26] = {
0xc0, 0x00, 0x3a, 0x01,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0x02, 0x00
};*/
wifi_scan_obj.deauth_frame_default[10] = snifferPacket->payload[10];
wifi_scan_obj.deauth_frame_default[11] = snifferPacket->payload[11];
@@ -3126,8 +2995,6 @@ void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
wifi_scan_obj.deauth_frame_default[21] = snifferPacket->payload[15];
// Send packet
//esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
//esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
esp_wifi_80211_tx(WIFI_IF_AP, wifi_scan_obj.deauth_frame_default, sizeof(wifi_scan_obj.deauth_frame_default), false);
delay(1);
}
@@ -3164,19 +3031,6 @@ void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
#else
Serial.println(addr);
#endif
// for (int i = 0; i < len; i++) {
// char hexCar[4];
// sprintf(hexCar, "%02X", snifferPacket->payload[i]);
// Serial.print(hexCar);
//Serial.print(snifferPacket->payload[i], HEX);
// if ((i + 1) % 16 == 0)
// Serial.print("\n");
// else
// Serial.print(" ");
// }
// Serial.print("\n");
}
addPacket(snifferPacket, len);
@@ -3237,17 +3091,6 @@ void WiFiScan::activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t
return;
} // End targeted stuff
// Build packet
//Serial.println("Recieved beacon frame");
/*uint8_t new_packet[26] = {
0xc0, 0x00, 0x3a, 0x01,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xff, 0x02, 0x00
};*/
wifi_scan_obj.deauth_frame_default[10] = snifferPacket->payload[10];
wifi_scan_obj.deauth_frame_default[11] = snifferPacket->payload[11];
@@ -3264,8 +3107,6 @@ void WiFiScan::activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t
wifi_scan_obj.deauth_frame_default[21] = snifferPacket->payload[15];
// Send packet
//esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
//esp_wifi_80211_tx(WIFI_IF_AP, new_packet, sizeof(new_packet), false);
esp_wifi_80211_tx(WIFI_IF_AP, wifi_scan_obj.deauth_frame_default, sizeof(wifi_scan_obj.deauth_frame_default), false);
delay(1);
}
@@ -3276,18 +3117,6 @@ void WiFiScan::activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t
num_eapol++;
Serial.println("Received EAPOL:");
// for (int i = 0; i < len; i++) {
// char hexCar[3];
// snprintf(hexCar, 3, "%02X", snifferPacket->payload[i]);
// Serial.print(hexCar);
//Serial.print(snifferPacket->payload[i], HEX);
// if ((i + 1) % 16 == 0)
// Serial.print("\n");
// else
// Serial.print(" ");
// }
// Serial.print("\n");
}
addPacket(snifferPacket, len);
@@ -3306,22 +3135,6 @@ void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) {
}
}
/*void WiFiScan::addLog(String log, int len) {
uint8_t *buf;
log.getBytes(buf, log.length());
bool save_packet = settings_obj.loadSetting<bool>(text_table4[7]);
if (save_packet) {
Serial.println("Saving data...");
#ifdef WRITE_PACKETS_SERIAL
buffer_obj.addPacket(buf, len);
#elif defined(HAS_SD)
sd_obj.addPacket(buf, len);
#else
return;
#endif
}
}*/
#ifdef HAS_SCREEN
void WiFiScan::eapolMonitorMain(uint32_t currentTime)
{
@@ -3383,8 +3196,6 @@ void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) {
set_channel--;
delay(70);
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
//display_obj.tftDrawXScaleButtons(x_scale);
//display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
changeChannel();
@@ -3399,8 +3210,6 @@ void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) {
set_channel++;
delay(70);
display_obj.tft.fillRect(127, 0, 193, 28, TFT_BLACK);
//display_obj.tftDrawXScaleButtons(x_scale);
//display_obj.tftDrawYScaleButtons(y_scale);
display_obj.tftDrawChannelScaleButtons(set_channel);
display_obj.tftDrawExitScaleButtons();
changeChannel();
@@ -3418,8 +3227,6 @@ void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) {
}
if (currentTime - initTime >= (GRAPH_REFRESH * 5)) {
//Serial.println("-----------------------------------------");
//Serial.println("Time elapsed: " + (String)(currentTime - initTime) + "ms");
x_pos += x_scale;
initTime = millis();
y_pos_x = ((-num_eapol * (y_scale * 3)) + (HEIGHT_1 - 2)); // GREEN
@@ -3427,27 +3234,12 @@ void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) {
Serial.println("Max EAPOL number reached. Adjusting...");
num_eapol = 0;
}
//y_pos_y = ((-num_deauth * (y_scale * 3)) + (HEIGHT_1 - 2)); // RED
//y_pos_z = ((-num_probe * (y_scale * 3)) + (HEIGHT_1 - 2)); // BLUE
//Serial.println("num_beacon: " + (String)num_beacon);
//Serial.println("num_deauth: " + (String)num_deauth);
//Serial.println(" num_probe: " + (String)num_probe);
//num_beacon = 0;
//num_probe = 0;
//num_deauth = 0;
//CODE FOR PLOTTING CONTINUOUS LINES!!!!!!!!!!!!
//Plot "X" value
display_obj.tft.drawLine(x_pos - x_scale, y_pos_x_old, x_pos, y_pos_x, TFT_CYAN);
//Plot "Z" value
//display_obj.tft.drawLine(x_pos - x_scale, y_pos_z_old, x_pos, y_pos_z, TFT_BLUE);
//Plot "Y" value
//display_obj.tft.drawLine(x_pos - x_scale, y_pos_y_old, x_pos, y_pos_y, TFT_RED);
//Draw preceding black 'boxes' to erase old plot lines, !!!WEIRD CODE TO COMPENSATE FOR BUTTONS AND COLOR KEY SO 'ERASER' DOESN'T ERASE BUTTONS AND COLOR KEY!!!
//if ((x_pos <= 90) || ((x_pos >= 198) && (x_pos <= 320))) //above x axis
if ((x_pos <= 90) || ((x_pos >= 117) && (x_pos <= 320))) //above x axis
{
display_obj.tft.fillRect(x_pos+1, 28, 10, 93, TFT_BLACK); //compensate for buttons!
@@ -3456,8 +3248,6 @@ void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) {
{
display_obj.tft.fillRect(x_pos+1, 0, 10, 121, TFT_BLACK); //don't compensate for buttons!
}
//if ((x_pos >= 254) && (x_pos <= 320)) //below x axis
//if (x_pos <= 90)
if (x_pos < 0) // below x axis
{
//tft.fillRect(x_pos+1, 121, 10, 88, TFT_BLACK);
@@ -3771,7 +3561,6 @@ void WiFiScan::main(uint32_t currentTime)
(currentScanMode == WIFI_SCAN_SIG_STREN) ||
(currentScanMode == WIFI_SCAN_TARGET_AP) ||
(currentScanMode == WIFI_SCAN_PWN) ||
(currentScanMode == WIFI_SCAN_ESPRESSIF) ||
(currentScanMode == WIFI_SCAN_DEAUTH) ||
(currentScanMode == WIFI_SCAN_ALL))
{
@@ -3781,6 +3570,12 @@ void WiFiScan::main(uint32_t currentTime)
channelHop();
}
}
else if (currentScanMode == WIFI_SCAN_GPS_DATA) {
if (currentTime - initTime >= 5000) {
this->initTime = millis();
this->RunGPSInfo();
}
}
else if (currentScanMode == WIFI_SCAN_EVIL_PORTAL) {
evil_portal_obj.main(currentScanMode);
}

View File

@@ -3,13 +3,8 @@
#include "configs.h"
//#include <BLEDevice.h>
//#include <BLEUtils.h>
//#include <BLEScan.h>
//#include <BLEAdvertisedDevice.h>
#include <ArduinoJson.h>
// Testing NimBLE
#ifdef HAS_BT
#include <NimBLEDevice.h>
#endif
@@ -32,8 +27,8 @@
#ifdef HAS_BATTERY
#include "BatteryInterface.h"
#endif
#ifdef HAS_TEMP_SENSOR
#include "TemperatureInterface.h"
#ifdef HAS_GPS
#include "GpsInterface.h"
#endif
#include "settings.h"
#include "Assets.h"
@@ -44,7 +39,6 @@
#else
#include "LedInterface.h"
#endif
//#include "MenuFunctions.h"
#define bad_list_length 3
@@ -82,6 +76,7 @@
#define WIFI_SCAN_ACTIVE_LIST_EAPOL 28
#define WIFI_SCAN_SIG_STREN 29
#define WIFI_SCAN_EVIL_PORTAL 30
#define WIFI_SCAN_GPS_DATA 31
#define GRAPH_REFRESH 100
@@ -95,13 +90,13 @@ extern EvilPortal evil_portal_obj;
#ifdef HAS_SD
extern SDInterface sd_obj;
#endif
#ifdef HAS_GPS
extern GpsInterface gps_obj;
#endif
extern Buffer buffer_obj;
#ifdef HAS_BATTERY
extern BatteryInterface battery_obj;
#endif
#ifdef HAS_TEMP_SENSOR
extern TemperatureInterface temp_obj;
#endif
extern Settings settings_obj;
#ifdef MARAUDER_FLIPPER
extern flipperLED flipper_led;
@@ -112,7 +107,6 @@ extern Settings settings_obj;
#endif
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
/*struct ssid {
String essid;
@@ -131,6 +125,12 @@ esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, b
LinkedList<int>* stations;
};*/
#define mac_history_len 86
struct mac_addr {
unsigned char bytes[6];
};
struct Station {
uint8_t mac[6];
bool selected;
@@ -139,8 +139,11 @@ struct Station {
class WiFiScan
{
private:
// Wardriver thanks to https://github.com/JosephHewitt
struct mac_addr mac_history[mac_history_len];
// Settings
int channel_hop_delay = 1;
uint8_t channel_hop_delay = 1;
bool force_pmkid = false;
bool force_probe = false;
bool save_pcap = false;
@@ -167,7 +170,7 @@ class WiFiScan
uint32_t initTime = 0;
bool run_setup = true;
void initWiFi(uint8_t scan_mode);
int bluetoothScanTime = 5;
uint8_t bluetoothScanTime = 5;
int packets_sent = 0;
const wifi_promiscuous_filter_t filt = {.filter_mask=WIFI_PROMIS_FILTER_MASK_MGMT | WIFI_PROMIS_FILTER_MASK_DATA};
#ifdef HAS_BT
@@ -175,9 +178,9 @@ class WiFiScan
#endif
//String connected_network = "";
String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_";
const String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_";
char* rick_roll[8] = {
const char* rick_roll[8] = {
"01 Never gonna give you up",
"02 Never gonna let you down",
"03 Never gonna run around",
@@ -219,32 +222,6 @@ class WiFiScan
/*36*/ 0x00
};
/*uint8_t auth_packet[128] = {0xB0, 0x00, 0x3C, 0x00, // Frame Control, Duration
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, // Dest
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, // Source
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, // Dest BSSID
0x00, 0x01, // Sequence number
0x00, 0x00, // Algo
0x01, 0x00, // Auth sequence number
0x00, 0x00, // Status Code
0x7F, 0x08,
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x40,
0xDD, 0x0B, 0x00, 0x17, 0xF2, 0x0A, 0x00, 0x01, // Say it was Apple
0x04, 0x00, 0x00, 0x00, 0x00, 0xDD, 0x0A, 0x00,
0x10, 0x18, 0x02, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00
};*/
uint8_t auth_packet[65] = {0xb0, 0x00, 0x3c, 0x00,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x7f, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x00, 0x40, 0xdd, 0x0b, 0x00, 0x17, 0xf2, 0x0a,
0x00, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0xdd,
0x0a, 0x00, 0x10, 0x18, 0x02, 0x00, 0x00, 0x10,
0x00, 0x00, 0x00};
uint8_t prob_req_packet[128] = {0x40, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // Destination
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, // Source
@@ -276,19 +253,14 @@ class WiFiScan
void sendProbeAttack(uint32_t currentTime);
void sendDeauthAttack(uint32_t currentTime, String dst_mac_str = "ff:ff:ff:ff:ff:ff");
void sendDeauthFrame(uint8_t bssid[6], int channel, String dst_mac_str = "ff:ff:ff:ff:ff:ff");
void sendDeauthFrame(int bssid[6], int channel, uint8_t mac[6]);
void sendDeauthFrame(uint8_t bssid[6], int channel, uint8_t mac[6]);
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 broadcastSetSSID(uint32_t current_time, const char* ESSID);
void RunAPScan(uint8_t scan_mode, uint16_t color);
//void RunRickRoll(uint8_t scan_mode, uint16_t color);
//void RunBeaconSpam(uint8_t scan_mode, uint16_t color);
//void RunProbeFlood(uint8_t scan_mode, uint16_t color);
//void RunDeauthFlood(uint8_t scan_mode, uint16_t color);
void RunGPSInfo();
void RunMimicFlood(uint8_t scan_mode, uint16_t color);
//void RunBeaconList(uint8_t scan_mode, uint16_t color);
void RunEspressifScan(uint8_t scan_mode, uint16_t color);
void RunPwnScan(uint8_t scan_mode, uint16_t color);
void RunBeaconScan(uint8_t scan_mode, uint16_t color);
void RunRawScan(uint8_t scan_mode, uint16_t color);
@@ -305,7 +277,6 @@ class WiFiScan
static void scanCompleteCB(BLEScanResults scanResults);
#endif
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
public:
WiFiScan();
@@ -314,9 +285,9 @@ class WiFiScan
//LinkedList<ssid>* ssids;
int set_channel = 1;
uint8_t set_channel = 1;
int old_channel = 0;
uint8_t old_channel = 0;
bool orient_display = false;
bool wifi_initialized = false;
@@ -329,7 +300,6 @@ class WiFiScan
String dst_mac = "ff:ff:ff:ff:ff:ff";
byte src_mac[6] = {};
//lv_obj_t * scr = lv_cont_create(NULL, NULL);
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
wifi_config_t ap_config;
@@ -344,15 +314,14 @@ class WiFiScan
bool shutdownWiFi();
bool shutdownBLE();
bool scanning();
void joinWiFi(String ssid, String password);
//void joinWiFi(String ssid, String password);
String getStaMAC();
String getApMAC();
String freeRAM();
void changeChannel();
void changeChannel(int chan);
void RunInfo();
void RunShutdownWiFi();
void RunShutdownBLE();
//void RunShutdownBLE();
void RunGenerateSSIDs(int count = 20);
void RunClearSSIDs();
void RunClearAPs();
@@ -365,7 +334,6 @@ class WiFiScan
//void addLog(String log, int len);
static void getMAC(char *addr, uint8_t* data, uint16_t offset);
static void espressifSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void pwnSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void rawSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);

View File

@@ -1,69 +0,0 @@
#include "a32u4_interface.h"
HardwareSerial MySerial_two(2);
void A32u4Interface::begin() {
MySerial_two.begin(BAUD32U4, SERIAL_8N1, 25, 4);
delay(2000);
Serial.println("Setup A32U4 Serial Interface");
MySerial_two.println("DELAY 1");
delay(1000);
uint8_t a32u4_rep = 0;
if (MySerial_two.available()) {
a32u4_rep = (uint8_t)MySerial_two.read();
}
//display_string.trim();
//Serial.println("\nDisplay string: " + (String)display_string);
if (a32u4_rep != 0) {
this->supported = true;
#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 {
#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);
}
this->initTime = millis();
}
void A32u4Interface::runScript(String script) {
MySerial_two.println(script);
}
void A32u4Interface::test() {
MySerial_two.println("STRING Hello, World!");
}
void A32u4Interface::main(uint32_t current_time) {
if (current_time - this->initTime >= 1000) {
this->initTime = millis();
//MySerial_two.write("PING");
//delay(1);
if (MySerial_two.available()) {
Serial.println("Got A32U4 Serial data");
Serial.println(MySerial_two.read());
}
}
}

View File

@@ -1,30 +0,0 @@
#ifndef a32u4_interface_h
#define a32u4_interface_h
#include "configs.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include <HardwareSerial.h>
#define BAUD32U4 115200
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
class A32u4Interface {
public:
bool supported = false;
uint32_t initTime;
void begin();
void main(uint32_t current_time);
void test();
void runScript(String script);
};
#endif

View File

@@ -21,7 +21,7 @@
//#define XIAO_ESP32_S3
//// END BOARD TARGETS
#define MARAUDER_VERSION "v0.11.0-RC3"
#define MARAUDER_VERSION "v0.11.0"
//// BOARD FEATURES
#ifdef MARAUDER_M5STICKC
@@ -34,6 +34,7 @@
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
//#define HAS_GPS
#endif
#ifdef MARAUDER_MINI
@@ -47,6 +48,7 @@
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
//#define HAS_GPS
#endif
#ifdef MARAUDER_V4
@@ -60,6 +62,7 @@
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
#define HAS_GPS
#endif
#ifdef MARAUDER_V6
@@ -73,6 +76,7 @@
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
#define HAS_GPS
#endif
#ifdef MARAUDER_KIT
@@ -86,6 +90,7 @@
#define HAS_SD
#define USE_SD
#define HAS_TEMP_SENSOR
#define HAS_GPS
#endif
#ifdef GENERIC_ESP32
@@ -98,6 +103,7 @@
//#define HAS_SCREEN
//#define HAS_SD
//#define HAS_TEMP_SENSOR
//#define HAS_GPS
#endif
#ifdef MARAUDER_FLIPPER
@@ -108,6 +114,7 @@
//#define HAS_NEOPIXEL_LED
//#define HAS_PWR_MGMT
//#define HAS_SCREEN
#define HAS_GPS
#ifndef WRITE_PACKETS_SERIAL
#define HAS_SD
#define USE_SD
@@ -126,6 +133,7 @@
#define HAS_SD
#define USE_SD
//#define HAS_TEMP_SENSOR
//#define HAS_GPS
#endif
#ifdef MARAUDER_DEV_BOARD_PRO
@@ -139,6 +147,7 @@
#define HAS_SD
#define USE_SD
//#define HAS_TEMP_SENSOR
#define HAS_GPS
#endif
#ifdef XIAO_ESP32_S3
@@ -151,6 +160,7 @@
//#define HAS_SCREEN
//#define HAS_SD
//#define HAS_TEMP_SENSOR
//#define HAS_GPS
#endif
//// END BOARD FEATURES
@@ -202,6 +212,7 @@
#ifdef HAS_SCREEN
#ifdef MARAUDER_M5STICKC
#define SCREEN_CHAR_WIDTH 40
//#define TFT_MISO 19
#define TFT_MOSI 15
#define TFT_SCLK 13
@@ -268,8 +279,9 @@
#endif
#ifdef MARAUDER_V4
#define SCREEN_CHAR_WIDTH 40
#define HAS_ILI9341
#define BANNER_TEXT_SIZE 2
#define BANNER_TEXT_SIZE 1
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
@@ -323,6 +335,7 @@
#endif
#ifdef MARAUDER_V6
#define SCREEN_CHAR_WIDTH 40
#define HAS_ILI9341
#define BANNER_TEXT_SIZE 2
@@ -379,9 +392,10 @@
#endif
#ifdef MARAUDER_KIT
#define SCREEN_CHAR_WIDTH 40
#define HAS_ILI9341
#define BANNER_TEXT_SIZE 2
#define BANNER_TEXT_SIZE 1
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
@@ -436,6 +450,7 @@
#endif
#ifdef MARAUDER_MINI
#define SCREEN_CHAR_WIDTH 40
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
@@ -746,4 +761,44 @@
#endif
//// END EVIL PORTAL STUFF
//// GPS STUFF
#ifdef HAS_GPS
#ifdef MARAUDER_V6
#define GPS_SERIAL_INDEX 2
#define GPS_TX 4
#define GPS_RX 13
#elif defined(MARAUDER_V4)
#define GPS_SERIAL_INDEX 2
#define GPS_TX 4
#define GPS_RX 13
#elif defined(MARAUDER_KIT)
#define GPS_SERIAL_INDEX 2
#define GPS_TX 4
#define GPS_RX 13
#elif defined(MARAUDER_DEV_BOARD_PRO)
#define GPS_SERIAL_INDEX 2
#define GPS_TX 21
#define GPS_RX 17
#elif defined(MARAUDER_FLIPPER)
#define GPS_SERIAL_INDEX 1
#define GPS_TX 9
#define GPS_RX 21
#endif
#endif
//// END GPS STUFF
//// MARAUDER TITLE STUFF
#ifdef MARAUDER_V4
#define MARAUDER_TITLE_BYTES 13578
#elif defined(MARAUDER_V6)
#define MARAUDER_TITLE_BYTES 13578
#elif defined(MARAUDER_KIT)
#define MARAUDER_TITLE_BYTES 13578
#elif defined(MARAUDER_MINI)
#define MARAUDER_TITLE_BYTES 13578
#else
#define MARAUDER_TITLE_BYTES 13578
#endif
//// END MARAUDER TITLE STUFF
#endif

View File

@@ -24,6 +24,10 @@ https://www.online-utility.org/image/convert/to/XBM
#include "esp_system.h"
#include <Arduino.h>
#ifdef HAS_GPS
#include "GpsInterface.h"
#endif
#include "Assets.h"
#include "WiFiScan.h"
#ifdef HAS_SD
@@ -48,9 +52,9 @@ https://www.online-utility.org/image/convert/to/XBM
#include "BatteryInterface.h"
#endif
#ifdef HAS_TEMP_SENSOR
#include "TemperatureInterface.h"
#endif
//#ifdef HAS_TEMP_SENSOR
// #include "TemperatureInterface.h"
//#endif
#ifdef HAS_SCREEN
#include "Display.h"
@@ -87,13 +91,17 @@ Buffer buffer_obj;
Settings settings_obj;
CommandLine cli_obj;
#ifdef HAS_GPS
GpsInterface gps_obj;
#endif
#ifdef HAS_BATTERY
BatteryInterface battery_obj;
#endif
#ifdef HAS_TEMP_SENSOR
TemperatureInterface temp_obj;
#endif
//#ifdef HAS_TEMP_SENSOR
// TemperatureInterface temp_obj;
//#endif
#ifdef HAS_SCREEN
Display display_obj;
@@ -216,7 +224,11 @@ void setup()
// Draw the title screen
#ifdef HAS_SCREEN
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
#ifndef MARAUDER_MINI
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
#else
display_obj.drawJpeg("/marauder3L.jpg", 0, 0);
#endif
#endif
#ifdef HAS_SCREEN
@@ -295,9 +307,9 @@ void setup()
#endif
// Temperature stuff
#ifdef HAS_TEMP_SENSOR
temp_obj.RunSetup();
#endif
//#ifdef HAS_TEMP_SENSOR
// temp_obj.RunSetup();
//#endif
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[6]));
@@ -328,6 +340,16 @@ void setup()
delay(500);
#endif
#ifdef HAS_GPS
gps_obj.begin();
#ifdef HAS_SCREEN
if (gps_obj.getGpsModuleStatus())
display_obj.tft.println("GPS Module connected");
else
display_obj.tft.println("GPS Module NOT connected");
#endif
#endif
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[8]));
@@ -361,65 +383,62 @@ void loop()
#endif
// Update all of our objects
#ifdef HAS_SCREEN
/*#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))
//{
cli_obj.main(currentTime);
#ifdef HAS_SCREEN
display_obj.main(wifi_scan_obj.currentScanMode);
#endif
wifi_scan_obj.main(currentTime);
//evil_portal_obj.main(wifi_scan_obj.currentScanMode);
#ifdef HAS_GPS
gps_obj.main();
#endif
if ((!do_draw) && (wifi_scan_obj.currentScanMode != ESP_UPDATE))
{
cli_obj.main(currentTime);
#ifdef HAS_SCREEN
display_obj.main(wifi_scan_obj.currentScanMode);
#endif
wifi_scan_obj.main(currentTime);
//evil_portal_obj.main(wifi_scan_obj.currentScanMode);
#ifdef WRITE_PACKETS_SERIAL
buffer_obj.forceSaveSerial();
#elif defined(HAS_SD)
sd_obj.main();
#else
return;
#endif
#ifdef HAS_BATTERY
battery_obj.main(currentTime);
temp_obj.main(currentTime);
#endif
settings_obj.main(currentTime);
if (((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) && (wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL)) ||
(mini)) {
#ifdef HAS_SCREEN
menu_function_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
}
#ifdef MARAUDER_FLIPPER
flipper_led.main();
#elif defined(XIAO_ESP32_S3)
xiao_led.main();
#else
led_obj.main(currentTime);
#endif
//if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
// web_obj.main();
#ifdef HAS_SCREEN
delay(1);
#else
delay(50);
#endif
}
#ifdef HAS_SCREEN
else if ((display_obj.draw_tft) &&
(wifi_scan_obj.currentScanMode != OTA_UPDATE))
{
display_obj.drawStylus();
}
#ifdef WRITE_PACKETS_SERIAL
buffer_obj.forceSaveSerial();
#elif defined(HAS_SD)
sd_obj.main();
#else
return;
#endif
else if (wifi_scan_obj.currentScanMode == ESP_UPDATE) {
#ifdef HAS_BATTERY
battery_obj.main(currentTime);
//temp_obj.main(currentTime);
#endif
settings_obj.main(currentTime);
if (((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) && (wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL)) ||
(mini)) {
#ifdef HAS_SCREEN
menu_function_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
}
#ifdef MARAUDER_FLIPPER
flipper_led.main();
#elif defined(XIAO_ESP32_S3)
xiao_led.main();
#else
led_obj.main(currentTime);
#endif
//if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
// web_obj.main();
#ifdef HAS_SCREEN
delay(1);
#else
delay(50);
#endif
//}
/*else if (wifi_scan_obj.currentScanMode == ESP_UPDATE) {
#ifdef HAS_SCREEN
display_obj.main(wifi_scan_obj.currentScanMode);
menu_function_obj.main(currentTime);
@@ -435,5 +454,5 @@ void loop()
//cli_obj.main(currentTime);
delay(1);
}
}*/
}

View File

@@ -1,135 +0,0 @@
#include "esp_interface.h"
HardwareSerial MySerial(1);
void EspInterface::begin() {
pinMode(ESP_RST, OUTPUT);
pinMode(ESP_ZERO, OUTPUT);
delay(100);
digitalWrite(ESP_ZERO, HIGH);
Serial.println("Checking for ESP8266...");
MySerial.begin(BAUD, SERIAL_8N1, 27, 26);
delay(100);
#ifdef HAS_SCREEN
display_obj.tft.println("Checking for ESP8266...");
#endif
this->bootRunMode();
delay(500);
while (MySerial.available())
MySerial.read();
MySerial.write("PING");
delay(2000);
String display_string = "";
while (MySerial.available()) {
display_string.concat((char)MySerial.read());
}
display_string.trim();
Serial.println("\nDisplay string: " + (String)display_string);
if (display_string == "ESP8266 Pong") {
#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 {
#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();
}
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.println("Waiting for serial data...");
display_obj.tft.setTextColor(TFT_WHITE);
#endif
}
void EspInterface::bootProgramMode() {
Serial.println("[!] Setting ESP12 in program mode...");
digitalWrite(ESP_ZERO, LOW);
delay(100);
digitalWrite(ESP_RST, LOW);
delay(100);
digitalWrite(ESP_RST, HIGH);
delay(100);
digitalWrite(ESP_ZERO, HIGH);
Serial.println("[!] Complete");
Serial.end();
Serial.begin(57600);
}
void EspInterface::bootRunMode() {
Serial.end();
Serial.begin(115200);
Serial.println("[!] Setting ESP12 in run mode...");
digitalWrite(ESP_ZERO, HIGH);
delay(100);
digitalWrite(ESP_RST, LOW);
delay(100);
digitalWrite(ESP_RST, HIGH);
delay(100);
digitalWrite(ESP_ZERO, HIGH);
Serial.println("[!] Complete");
}
void EspInterface::program() {
if (MySerial.available()) {
Serial.write((uint8_t)MySerial.read());
}
if (Serial.available()) {
#ifdef HAS_SCREEN
display_obj.tft.print(".");
#endif
while (Serial.available()) {
MySerial.write((uint8_t)Serial.read());
}
}
}
void EspInterface::main(uint32_t current_time) {
if (current_time - this->initTime >= 1000) {
this->initTime = millis();
//MySerial.write("PING");
}
while (MySerial.available()) {
Serial.print((char)MySerial.read());
}
if (Serial.available()) {
MySerial.write((uint8_t)Serial.read());
}
}

View File

@@ -1,35 +0,0 @@
#ifndef esp_interface_h
#define esp_interface_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
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
class EspInterface {
public:
bool supported = false;
uint32_t initTime;
void RunUpdate();
void bootProgramMode();
void bootRunMode();
void begin();
void program();
void main(uint32_t current_time);
};
#endif

BIN
mechanical/.DS_Store vendored Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
pictures/icons/gps_16.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
pictures/icons/gps_22.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

6
pictures/xbm/gps_16.xbm Normal file
View File

@@ -0,0 +1,6 @@
#define f5dc88022d18492ea6769b98921e0a5aUvT7HPFFeGcrDDT7_width 16
#define f5dc88022d18492ea6769b98921e0a5aUvT7HPFFeGcrDDT7_height 16
static char f5dc88022d18492ea6769b98921e0a5aUvT7HPFFeGcrDDT7_bits[] = {
0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xF5, 0xEF, 0xEE, 0x57, 0xF7, 0x2F, 0xFA,
0x1F, 0xFC, 0x0F, 0xDE, 0x17, 0xD5, 0xBB, 0xD6, 0xDD, 0xDB, 0xEB, 0xEC,
0xF7, 0xF7, 0x7F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, };

9
pictures/xbm/gps_22.xbm Normal file
View File

@@ -0,0 +1,9 @@
#define 824c3668a0844210c964e12f83c144e4dy8xmxKsVnnbTEOb_width 22
#define 824c3668a0844210c964e12f83c144e4dy8xmxKsVnnbTEOb_height 22
static char 824c3668a0844210c964e12f83c144e4dy8xmxKsVnnbTEOb_bits[] = {
0xFF, 0xFF, 0x3F, 0xFF, 0xBF, 0x3F, 0xFF, 0x5F, 0x3F, 0xFF, 0xEF, 0x3E,
0xFF, 0xF7, 0x3D, 0xBF, 0xFA, 0x3E, 0x5F, 0x7C, 0x3F, 0x3F, 0xB8, 0x3F,
0x1F, 0xD0, 0x3F, 0x3F, 0xE0, 0x3F, 0x5F, 0xF0, 0x3F, 0xEF, 0xE8, 0x3F,
0xF7, 0xE5, 0x3B, 0xFB, 0xDE, 0x3A, 0x7D, 0xFF, 0x3A, 0xBB, 0x7F, 0x3B,
0xD7, 0x9F, 0x3D, 0xEF, 0xFF, 0x3E, 0xFF, 0x0F, 0x3F, 0xFF, 0xFF, 0x3F,
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, };