mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-09 06:10:56 -08:00
Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c75bd6a098 | ||
|
|
b5337fcff5 | ||
|
|
24a1862ef6 | ||
|
|
971abc5390 | ||
|
|
43c82dd5a3 | ||
|
|
6e26662209 | ||
|
|
10e913546b | ||
|
|
2af0d2fcc3 | ||
|
|
28c037a19a | ||
|
|
f8a831f916 | ||
|
|
ad3cf7ec7e | ||
|
|
f5d0703432 | ||
|
|
470f3f73c7 | ||
|
|
9d92c5ceb5 | ||
|
|
558fe18d66 | ||
|
|
bddc7e1d9d | ||
|
|
e560a888c3 | ||
|
|
2004a9ecb4 | ||
|
|
c61aaf95cd | ||
|
|
f6c27ed216 | ||
|
|
d0f5d89980 | ||
|
|
fe08c145f6 | ||
|
|
5909158666 | ||
|
|
6ee3a66226 | ||
|
|
4d0594b424 | ||
|
|
a984b2df4a | ||
|
|
4a130edc2f | ||
|
|
2d64045c64 | ||
|
|
41bbcae40c | ||
|
|
f98e41d159 | ||
|
|
b6cf6b600a | ||
|
|
f3e676c8a1 | ||
|
|
3e03d49fc9 | ||
|
|
dc8e76094f | ||
|
|
6564e269e3 | ||
|
|
4868b698ce | ||
|
|
e67c67b990 | ||
|
|
055d2129bb | ||
|
|
dd2274b018 | ||
|
|
f448647c1b | ||
|
|
ade13c9698 | ||
|
|
9a36164dde | ||
|
|
1804a28957 | ||
|
|
c8005f6c52 | ||
|
|
7a15b5b36e | ||
|
|
007819feaa | ||
|
|
a704339cc5 | ||
|
|
5c54137b9e | ||
|
|
f660a66d8e | ||
|
|
ee6defd174 | ||
|
|
47b3a850b9 | ||
|
|
157c1a4a96 | ||
|
|
d940a9874d | ||
|
|
c4af8003de |
41
.github/workflows/build_push.yml
vendored
41
.github/workflows/build_push.yml
vendored
@@ -3,7 +3,6 @@ name: Build and Push
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types: [opened, reopened]
|
||||
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
@@ -205,27 +204,6 @@ jobs:
|
||||
run: |
|
||||
mv ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper.bin
|
||||
|
||||
- name: Configure SD Serial for Flipper Zero SD Serial
|
||||
run: |
|
||||
pwd
|
||||
sed -i 's/^ \/\/#define WRITE_PACKETS_SERIAL/ #define WRITE_PACKETS_SERIAL/' esp32_marauder/configs.h
|
||||
|
||||
- name: Build Marauder SD Serial for Flipper Zero WiFi Dev Board
|
||||
uses: ArminJo/arduino-test-compile@v3.2.1
|
||||
with:
|
||||
sketch-names: esp32_marauder.ino
|
||||
arduino-board-fqbn: esp32:esp32:esp32s2:PartitionScheme=min_spiffs,FlashSize=4M,PSRAM=enabled
|
||||
extra-arduino-cli-args: "--warnings none"
|
||||
|
||||
- name: Rename Marauder Flipper SD Serial bin
|
||||
run: |
|
||||
mv ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper_sd_serial.bin
|
||||
|
||||
- name: Remove SD Serial
|
||||
run: |
|
||||
pwd
|
||||
sed -i 's/^ #define WRITE_PACKETS_SERIAL/ \/\/#define WRITE_PACKETS_SERIAL/' esp32_marauder/configs.h
|
||||
|
||||
- name: Build Marauder for Flipper Zero Multi Board
|
||||
uses: ArminJo/arduino-test-compile@v3.2.1
|
||||
with:
|
||||
@@ -464,13 +442,6 @@ jobs:
|
||||
path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper.bin
|
||||
retention-days: 5
|
||||
|
||||
- name: 'Upload Flipper SD Serial Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: esp32_marauder.flipper_sd_serial.bin
|
||||
path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper_sd_serial.bin
|
||||
retention-days: 5
|
||||
|
||||
- name: 'Upload MultiboardS3 Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
@@ -558,18 +529,6 @@ jobs:
|
||||
asset_content_type: application/bin
|
||||
if: github.event_name != 'pull_request'
|
||||
|
||||
- name: Upload Flipper SD Serial Asset
|
||||
id: upload-flipper-sd-serial-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper_sd_serial.bin
|
||||
asset_name: esp32_marauder.flipper_sd_serial.bin
|
||||
asset_content_type: application/bin
|
||||
if: github.event_name != 'pull_request'
|
||||
|
||||
- name: Upload MultiboardS3 Asset
|
||||
id: upload-multiboardS3-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __AXP192_H__
|
||||
#define __AXP192_H__
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef Assets_h
|
||||
#define Assets_h
|
||||
|
||||
@@ -198,7 +200,10 @@ PROGMEM static const unsigned char menu_icons[][66] = {
|
||||
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}
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
|
||||
{0xFF, 0xFF, 0xFD, 0xBF, 0x0B, 0xD0, 0xE7, 0xE7, 0xEF, 0xF7, 0xCF, 0xF3, // DISABLED TOUCH: 34
|
||||
0xAF, 0xF5, 0x6F, 0xF6, 0x6F, 0xF6, 0xAF, 0xF5, 0xCF, 0xF3, 0x0F, 0xF0,
|
||||
0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF}
|
||||
};
|
||||
|
||||
#ifndef MARAUDER_MINI
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef BatteryInterface_h
|
||||
#define BatteryInterface_h
|
||||
|
||||
|
||||
@@ -6,17 +6,17 @@ Buffer::Buffer(){
|
||||
bufB = (uint8_t*)malloc(BUF_SIZE);
|
||||
}
|
||||
|
||||
void Buffer::createPcapFile(fs::FS* fs, String fn, bool log){
|
||||
void Buffer::createFile(String name, bool is_pcap){
|
||||
int i=0;
|
||||
if (!log) {
|
||||
if (is_pcap) {
|
||||
do{
|
||||
fileName = "/"+fn+"_"+(String)i+".pcap";
|
||||
fileName = "/"+name+"_"+(String)i+".pcap";
|
||||
i++;
|
||||
} while(fs->exists(fileName));
|
||||
}
|
||||
else {
|
||||
do{
|
||||
fileName = "/"+fn+"_"+(String)i+".log";
|
||||
fileName = "/"+name+"_"+(String)i+".log";
|
||||
i++;
|
||||
} while(fs->exists(fileName));
|
||||
}
|
||||
@@ -27,7 +27,7 @@ void Buffer::createPcapFile(fs::FS* fs, String fn, bool log){
|
||||
file.close();
|
||||
}
|
||||
|
||||
void Buffer::open(bool log){
|
||||
void Buffer::open(bool is_pcap){
|
||||
bufSizeA = 0;
|
||||
bufSizeB = 0;
|
||||
|
||||
@@ -35,7 +35,7 @@ void Buffer::open(bool log){
|
||||
|
||||
writing = true;
|
||||
|
||||
if (!log) {
|
||||
if (is_pcap) {
|
||||
write(uint32_t(0xa1b2c3d4)); // magic number
|
||||
write(uint16_t(2)); // major version number
|
||||
write(uint16_t(4)); // minor version number
|
||||
@@ -46,14 +46,35 @@ void Buffer::open(bool log){
|
||||
}
|
||||
}
|
||||
|
||||
void Buffer::close(fs::FS* fs){
|
||||
if(!writing) return;
|
||||
forceSave(fs);
|
||||
writing = false;
|
||||
Serial.println(text01);
|
||||
void Buffer::openFile(String file_name, fs::FS* fs, bool serial, bool is_pcap) {
|
||||
bool save_pcap = settings_obj.loadSetting<bool>("SavePCAP");
|
||||
if (!save_pcap) {
|
||||
this->fs = NULL;
|
||||
this->serial = false;
|
||||
writing = false;
|
||||
return;
|
||||
}
|
||||
this->fs = fs;
|
||||
this->serial = serial;
|
||||
if (this->fs) {
|
||||
createFile(file_name, is_pcap);
|
||||
}
|
||||
if (this->fs || this->serial) {
|
||||
open(is_pcap);
|
||||
} else {
|
||||
writing = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Buffer::addPacket(uint8_t* buf, uint32_t len, bool log){
|
||||
void Buffer::pcapOpen(String file_name, fs::FS* fs, bool serial) {
|
||||
openFile(file_name, fs, serial, true);
|
||||
}
|
||||
|
||||
void Buffer::logOpen(String file_name, fs::FS* fs, bool serial) {
|
||||
openFile(file_name, fs, serial, false);
|
||||
}
|
||||
|
||||
void Buffer::add(const uint8_t* buf, uint32_t len, bool is_pcap){
|
||||
// buffer is full -> drop packet
|
||||
if((useA && bufSizeA + len >= BUF_SIZE && bufSizeB > 0) || (!useA && bufSizeB + len >= BUF_SIZE && bufSizeA > 0)){
|
||||
//Serial.print(";");
|
||||
@@ -74,7 +95,7 @@ void Buffer::addPacket(uint8_t* buf, uint32_t len, bool log){
|
||||
|
||||
microSeconds -= seconds*1000*1000; // e.g. 45200400 - 45*1000*1000 = 45200400 - 45000000 = 400us (because we only need the offset)
|
||||
|
||||
if (!log) {
|
||||
if (is_pcap) {
|
||||
write(seconds); // ts_sec
|
||||
write(microSeconds); // ts_usec
|
||||
write(len); // incl_len
|
||||
@@ -84,6 +105,20 @@ void Buffer::addPacket(uint8_t* buf, uint32_t len, bool log){
|
||||
write(buf, len); // packet payload
|
||||
}
|
||||
|
||||
void Buffer::append(wifi_promiscuous_pkt_t *packet, int len) {
|
||||
bool save_packet = settings_obj.loadSetting<bool>(text_table4[7]);
|
||||
if (save_packet) {
|
||||
add(packet->payload, len, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Buffer::append(String log) {
|
||||
bool save_packet = settings_obj.loadSetting<bool>(text_table4[7]);
|
||||
if (save_packet) {
|
||||
add((const uint8_t*)log.c_str(), log.length(), false);
|
||||
}
|
||||
}
|
||||
|
||||
void Buffer::write(int32_t n){
|
||||
uint8_t buf[4];
|
||||
buf[0] = n;
|
||||
@@ -109,8 +144,9 @@ void Buffer::write(uint16_t n){
|
||||
write(buf,2);
|
||||
}
|
||||
|
||||
void Buffer::write(uint8_t* buf, uint32_t len){
|
||||
void Buffer::write(const uint8_t* buf, uint32_t len){
|
||||
if(!writing) return;
|
||||
while(saving) delay(10);
|
||||
|
||||
if(useA){
|
||||
memcpy(&bufA[bufSizeA], buf, len);
|
||||
@@ -121,127 +157,86 @@ void Buffer::write(uint8_t* buf, uint32_t len){
|
||||
}
|
||||
}
|
||||
|
||||
void Buffer::save(fs::FS* fs){
|
||||
if(saving) return; // makes sure the function isn't called simultaneously on different cores
|
||||
|
||||
// buffers are already emptied, therefor saving is unecessary
|
||||
if((useA && bufSizeB == 0) || (!useA && bufSizeA == 0)){
|
||||
//Serial.printf("useA: %s, bufA %u, bufB %u\n",useA ? "true" : "false",bufSizeA,bufSizeB); // for debug porpuses
|
||||
return;
|
||||
}
|
||||
|
||||
//Serial.println("saving file");
|
||||
|
||||
uint32_t startTime = millis();
|
||||
uint32_t finishTime;
|
||||
|
||||
file = fs->open(fileName, FILE_APPEND);
|
||||
if (!file) {
|
||||
Serial.println(text02 + fileName+"'");
|
||||
//useSD = false;
|
||||
return;
|
||||
}
|
||||
|
||||
saving = true;
|
||||
|
||||
uint32_t len;
|
||||
|
||||
if(useA){
|
||||
file.write(bufB, bufSizeB);
|
||||
len = bufSizeB;
|
||||
bufSizeB = 0;
|
||||
}
|
||||
else{
|
||||
file.write(bufA, bufSizeA);
|
||||
len = bufSizeA;
|
||||
bufSizeA = 0;
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
finishTime = millis() - startTime;
|
||||
|
||||
//Serial.printf("\n%u bytes written for %u ms\n", len, finishTime);
|
||||
|
||||
saving = false;
|
||||
|
||||
}
|
||||
|
||||
void Buffer::forceSave(fs::FS* fs){
|
||||
uint32_t len = bufSizeA + bufSizeB;
|
||||
if(len == 0) return;
|
||||
|
||||
void Buffer::saveFs(){
|
||||
file = fs->open(fileName, FILE_APPEND);
|
||||
if (!file) {
|
||||
Serial.println(text02+fileName+"'");
|
||||
//useSD = false;
|
||||
return;
|
||||
}
|
||||
|
||||
saving = true;
|
||||
writing = false;
|
||||
|
||||
if(useA){
|
||||
|
||||
if(bufSizeB > 0){
|
||||
file.write(bufB, bufSizeB);
|
||||
bufSizeB = 0;
|
||||
}
|
||||
|
||||
if(bufSizeA > 0){
|
||||
file.write(bufA, bufSizeA);
|
||||
bufSizeA = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(bufSizeA > 0){
|
||||
file.write(bufA, bufSizeA);
|
||||
bufSizeA = 0;
|
||||
}
|
||||
|
||||
if(bufSizeB > 0){
|
||||
file.write(bufB, bufSizeB);
|
||||
bufSizeB = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
//Serial.printf("saved %u bytes\n",len);
|
||||
|
||||
saving = false;
|
||||
writing = true;
|
||||
}
|
||||
|
||||
void Buffer::forceSaveSerial() {
|
||||
uint32_t len = bufSizeA + bufSizeB;
|
||||
if(len == 0) return;
|
||||
void Buffer::saveSerial() {
|
||||
// Saves to main console UART, user-facing app will ignore these markers
|
||||
// Uses / and ] in markers as they are illegal characters for SSIDs
|
||||
const char* mark_begin = "[BUF/BEGIN]";
|
||||
const size_t mark_begin_len = strlen(mark_begin);
|
||||
const char* mark_close = "[BUF/CLOSE]";
|
||||
const size_t mark_close_len = strlen(mark_close);
|
||||
|
||||
saving = true;
|
||||
writing = false;
|
||||
// Additional buffer and memcpy's so that a single Serial.write() is called
|
||||
// This is necessary so that other console output isn't mixed into buffer stream
|
||||
uint8_t* buf = (uint8_t*)malloc(mark_begin_len + bufSizeA + bufSizeB + mark_close_len);
|
||||
uint8_t* it = buf;
|
||||
memcpy(it, mark_begin, mark_begin_len);
|
||||
it += mark_begin_len;
|
||||
|
||||
if(useA){
|
||||
if(bufSizeB > 0){
|
||||
Serial1.write(bufB, bufSizeB);
|
||||
bufSizeB = 0;
|
||||
memcpy(it, bufB, bufSizeB);
|
||||
it += bufSizeB;
|
||||
}
|
||||
if(bufSizeA > 0){
|
||||
Serial1.write(bufA, bufSizeA);
|
||||
bufSizeA = 0;
|
||||
memcpy(it, bufA, bufSizeA);
|
||||
it += bufSizeA;
|
||||
}
|
||||
} else {
|
||||
if(bufSizeA > 0){
|
||||
Serial1.write(bufA, bufSizeA);
|
||||
bufSizeA = 0;
|
||||
memcpy(it, bufA, bufSizeA);
|
||||
it += bufSizeA;
|
||||
}
|
||||
if(bufSizeB > 0){
|
||||
Serial1.write(bufB, bufSizeB);
|
||||
bufSizeB = 0;
|
||||
memcpy(it, bufB, bufSizeB);
|
||||
it += bufSizeB;
|
||||
}
|
||||
}
|
||||
|
||||
saving = false;
|
||||
writing = true;
|
||||
memcpy(it, mark_close, mark_close_len);
|
||||
it += mark_close_len;
|
||||
Serial.write(buf, it - buf);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
void Buffer::save() {
|
||||
saving = true;
|
||||
|
||||
if((bufSizeA + bufSizeB) == 0){
|
||||
saving = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if(this->fs) saveFs();
|
||||
if(this->serial) saveSerial();
|
||||
|
||||
bufSizeA = 0;
|
||||
bufSizeB = 0;
|
||||
|
||||
saving = false;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef Buffer_h
|
||||
#define Buffer_h
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "FS.h"
|
||||
#include "settings.h"
|
||||
//#include "SD_MMC.h"
|
||||
#include "esp_wifi_types.h"
|
||||
|
||||
#define BUF_SIZE 3 * 1024 // Had to reduce buffer size to save RAM. GG @spacehuhn
|
||||
#define SNAP_LEN 2324 // max len of each recieved packet
|
||||
@@ -16,18 +18,22 @@ extern Settings settings_obj;
|
||||
class Buffer {
|
||||
public:
|
||||
Buffer();
|
||||
void createPcapFile(fs::FS* fs, String fn = "", bool log = false);
|
||||
void open(bool log = false);
|
||||
void close(fs::FS* fs);
|
||||
void addPacket(uint8_t* buf, uint32_t len, bool log = false);
|
||||
void save(fs::FS* fs);
|
||||
void forceSave(fs::FS* fs);
|
||||
void forceSaveSerial();
|
||||
void pcapOpen(String file_name, fs::FS* fs, bool serial);
|
||||
void logOpen(String file_name, fs::FS* fs, bool serial);
|
||||
void append(wifi_promiscuous_pkt_t *packet, int len);
|
||||
void append(String log);
|
||||
void save();
|
||||
private:
|
||||
void createFile(String name, bool is_pcap);
|
||||
void open(bool is_pcap);
|
||||
void openFile(String file_name, fs::FS* fs, bool serial, bool is_pcap);
|
||||
void add(const uint8_t* buf, uint32_t len, bool is_pcap);
|
||||
void write(int32_t n);
|
||||
void write(uint32_t n);
|
||||
void write(uint16_t n);
|
||||
void write(uint8_t* buf, uint32_t len);
|
||||
void write(const uint8_t* buf, uint32_t len);
|
||||
void saveFs();
|
||||
void saveSerial();
|
||||
|
||||
uint8_t* bufA;
|
||||
uint8_t* bufB;
|
||||
@@ -41,6 +47,8 @@ class Buffer {
|
||||
|
||||
String fileName = "/0.pcap";
|
||||
File file;
|
||||
fs::FS* fs;
|
||||
bool serial;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,9 +9,6 @@ void CommandLine::RunSetup() {
|
||||
Serial.println(F("\n\n--------------------------------\n"));
|
||||
Serial.println(F(" ESP32 Marauder \n"));
|
||||
Serial.println(" " + version_number + "\n");
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
Serial.println(F(" >> Serial \n"));
|
||||
#endif
|
||||
Serial.println(F(" By: justcallmekoko\n"));
|
||||
Serial.println(F("--------------------------------\n\n"));
|
||||
|
||||
@@ -196,15 +193,17 @@ void CommandLine::filterAccessPoints(String filter) {
|
||||
}
|
||||
|
||||
void CommandLine::runCommand(String input) {
|
||||
if (input != "")
|
||||
Serial.println("#" + input);
|
||||
if (input == "") return;
|
||||
|
||||
if(wifi_scan_obj.scanning() && wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_NMEA){
|
||||
if(input != STOPSCAN_CMD) return;
|
||||
}
|
||||
else
|
||||
return;
|
||||
Serial.println("#" + input);
|
||||
|
||||
LinkedList<String> cmd_args = this->parseCommand(input, " ");
|
||||
|
||||
|
||||
//// Admin commands
|
||||
|
||||
// Help
|
||||
if (cmd_args.get(0) == HELP_CMD) {
|
||||
Serial.println(HELP_HEAD);
|
||||
@@ -217,6 +216,7 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.println(HELP_LED_CMD);
|
||||
Serial.println(HELP_GPS_DATA_CMD);
|
||||
Serial.println(HELP_GPS_CMD);
|
||||
Serial.println(HELP_NMEA_CMD);
|
||||
|
||||
// WiFi sniff/scan
|
||||
Serial.println(HELP_EVIL_PORTAL_CMD);
|
||||
@@ -249,10 +249,10 @@ void CommandLine::runCommand(String input) {
|
||||
// Bluetooth sniff/scan
|
||||
#ifdef HAS_BT
|
||||
Serial.println(HELP_BT_SNIFF_CMD);
|
||||
Serial.println(HELP_BT_SOUR_APPLE_CMD);
|
||||
Serial.println(HELP_BT_SWIFTPAIR_SPAM_CMD);
|
||||
Serial.println(HELP_BT_SAMSUNG_SPAM_CMD);
|
||||
Serial.println(HELP_BT_SPAM_ALL_CMD);
|
||||
Serial.println(HELP_BT_SPAM_CMD);
|
||||
//Serial.println(HELP_BT_SWIFTPAIR_SPAM_CMD);
|
||||
//Serial.println(HELP_BT_SAMSUNG_SPAM_CMD);
|
||||
//Serial.println(HELP_BT_SPAM_ALL_CMD);
|
||||
#ifdef HAS_GPS
|
||||
Serial.println(HELP_BT_WARDRIVE_CMD);
|
||||
#endif
|
||||
@@ -274,9 +274,16 @@ void CommandLine::runCommand(String input) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
uint8_t old_scan_mode=wifi_scan_obj.currentScanMode;
|
||||
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
|
||||
|
||||
Serial.println("Stopping WiFi tran/recv");
|
||||
if(old_scan_mode == WIFI_SCAN_GPS_NMEA)
|
||||
Serial.println("END OF NMEA STREAM");
|
||||
else if(old_scan_mode == WIFI_SCAN_GPS_DATA)
|
||||
Serial.println("Stopping GPS data updates");
|
||||
else
|
||||
Serial.println("Stopping WiFi tran/recv");
|
||||
|
||||
// If we don't do this, the text and button coordinates will be off
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -300,6 +307,7 @@ void CommandLine::runCommand(String input) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
int get_arg = this->argSearch(&cmd_args, "-g");
|
||||
int nmea_arg = this->argSearch(&cmd_args, "-n");
|
||||
|
||||
if (get_arg != -1) {
|
||||
String gps_info = cmd_args.get(get_arg + 1);
|
||||
@@ -314,11 +322,63 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.println("Lon: " + gps_obj.getLon());
|
||||
else if (gps_info == "alt")
|
||||
Serial.println("Alt: " + (String)gps_obj.getAlt());
|
||||
else if (gps_info == "accuracy")
|
||||
Serial.println("Accuracy: " + (String)gps_obj.getAccuracy());
|
||||
else if (gps_info == "date")
|
||||
Serial.println("Date/Time: " + gps_obj.getDatetime());
|
||||
else if (gps_info == "text"){
|
||||
Serial.println(gps_obj.getText());
|
||||
}
|
||||
else if (gps_info == "nmea"){
|
||||
int notparsed_arg = this->argSearch(&cmd_args, "-p");
|
||||
int notimp_arg = this->argSearch(&cmd_args, "-i");
|
||||
int recd_arg = this->argSearch(&cmd_args, "-r");
|
||||
if(notparsed_arg == -1 && notimp_arg == -1 && recd_arg == -1){
|
||||
gps_obj.sendSentence(Serial, gps_obj.generateGXgga().c_str());
|
||||
gps_obj.sendSentence(Serial, gps_obj.generateGXrmc().c_str());
|
||||
}
|
||||
else if(notparsed_arg == -1 && notimp_arg == -1)
|
||||
Serial.println(gps_obj.getNmea());
|
||||
else if(notparsed_arg == -1)
|
||||
Serial.println(gps_obj.getNmeaNotimp());
|
||||
else
|
||||
Serial.println(gps_obj.getNmeaNotparsed());
|
||||
}
|
||||
else
|
||||
Serial.println("You did not provide a valid argument");
|
||||
}
|
||||
else if(nmea_arg != -1){
|
||||
String nmea_type = cmd_args.get(nmea_arg + 1);
|
||||
|
||||
if (nmea_type == "native" || nmea_type == "all" || nmea_type == "gps" || nmea_type == "glonass"
|
||||
|| nmea_type == "galileo" || nmea_type == "navic" || nmea_type == "qzss" || nmea_type == "beidou"){
|
||||
if(nmea_type == "beidou"){
|
||||
int beidou_bd_arg = this->argSearch(&cmd_args, "-b");
|
||||
if(beidou_bd_arg != -1)
|
||||
nmea_type="beidou_bd";
|
||||
}
|
||||
gps_obj.setType(nmea_type);
|
||||
Serial.println("GPS Output Type Set To: " + nmea_type);
|
||||
}
|
||||
else
|
||||
Serial.println("You did not provide a valid argument");
|
||||
}
|
||||
else if(cmd_args.size()>1)
|
||||
Serial.println("You did not provide a valid flag");
|
||||
else
|
||||
Serial.println("You did not provide an argument");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (cmd_args.get(0) == NMEA_CMD) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
#ifdef HAS_SCREEN
|
||||
menu_function_obj.changeMenu(&menu_function_obj.gpsInfoMenu);
|
||||
#endif
|
||||
Serial.println("NMEA STREAM FOLLOWS");
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_NMEA;
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_NMEA, TFT_CYAN);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -445,6 +505,9 @@ void CommandLine::runCommand(String input) {
|
||||
|
||||
//// WiFi/Bluetooth Scan/Attack commands
|
||||
if (!wifi_scan_obj.scanning()) {
|
||||
// Dump pcap/log to serial too, valid for all scan/attack commands
|
||||
wifi_scan_obj.save_serial = this->argSearch(&cmd_args, "-serial") != -1;
|
||||
|
||||
// Signal strength scan
|
||||
if (cmd_args.get(0) == SIGSTREN_CMD) {
|
||||
Serial.println("Starting Signal Strength Scan. Stop with " + (String)STOPSCAN_CMD);
|
||||
@@ -791,7 +854,77 @@ void CommandLine::runCommand(String input) {
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
else if (cmd_args.get(0) == BT_SOUR_APPLE_CMD) {
|
||||
else if (cmd_args.get(0) == BT_SPAM_CMD) {
|
||||
int bt_type_sw = this->argSearch(&cmd_args, "-t");
|
||||
if (bt_type_sw != -1) {
|
||||
String bt_type = cmd_args.get(bt_type_sw + 1);
|
||||
|
||||
if (bt_type == "apple") {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting Sour Apple attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_SOUR_APPLE, TFT_GREEN);
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
else if (bt_type == "windows") {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting Swiftpair Spam attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_SWIFTPAIR_SPAM, TFT_CYAN);
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
else if (bt_type == "samsung") {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting Samsung Spam attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_SAMSUNG_SPAM, TFT_CYAN);
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
else if (bt_type == "google") {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting Google Spam attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_GOOGLE_SPAM, TFT_CYAN);
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
else if (bt_type == "all") {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting BT Spam All attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.clearScreen();
|
||||
menu_function_obj.drawStatusBar();
|
||||
#endif
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_SPAM_ALL, TFT_MAGENTA);
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
Serial.println("You did not specify a correct spam type");
|
||||
}
|
||||
}
|
||||
}
|
||||
/*else if (cmd_args.get(0) == BT_SOUR_APPLE_CMD) {
|
||||
#ifdef HAS_BT
|
||||
Serial.println("Starting Sour Apple attack. Stop with " + (String)STOPSCAN_CMD);
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -838,7 +971,7 @@ void CommandLine::runCommand(String input) {
|
||||
#else
|
||||
Serial.println("Bluetooth not supported");
|
||||
#endif
|
||||
}
|
||||
}*/
|
||||
// Wardrive
|
||||
else if (cmd_args.get(0) == BT_WARDRIVE_CMD) {
|
||||
#ifdef HAS_BT
|
||||
@@ -902,21 +1035,17 @@ void CommandLine::runCommand(String input) {
|
||||
//}
|
||||
// Update via SD
|
||||
if (sd_sw != -1) {
|
||||
#ifdef HAS_SD
|
||||
#ifndef WRITE_PACKETS_SERIAL
|
||||
if (!sd_obj.supported) {
|
||||
Serial.println("SD card is not connected. Cannot perform SD Update");
|
||||
return;
|
||||
}
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
sd_obj.runUpdate();
|
||||
#else
|
||||
Serial.println("SD card not initialized. Cannot perform SD Update");
|
||||
#endif
|
||||
#else
|
||||
Serial.println("SD card support disabled. Cannot perform SD Update");
|
||||
return;
|
||||
#endif
|
||||
#ifdef HAS_SD
|
||||
if (!sd_obj.supported) {
|
||||
Serial.println("SD card is not connected. Cannot perform SD Update");
|
||||
return;
|
||||
}
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
sd_obj.runUpdate();
|
||||
#else
|
||||
Serial.println("SD card support disabled. Cannot perform SD Update");
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef CommandLine_h
|
||||
#define CommandLine_h
|
||||
|
||||
@@ -47,6 +49,7 @@ const char PROGMEM LS_CMD[] = "ls";
|
||||
const char PROGMEM LED_CMD[] = "led";
|
||||
const char PROGMEM GPS_DATA_CMD[] = "gpsdata";
|
||||
const char PROGMEM GPS_CMD[] = "gps";
|
||||
const char PROGMEM NMEA_CMD[] = "nmea";
|
||||
|
||||
// WiFi sniff/scan
|
||||
const char PROGMEM EVIL_PORTAL_CMD[] = "evilportal";
|
||||
@@ -76,11 +79,12 @@ const char PROGMEM SEL_CMD[] = "select";
|
||||
const char PROGMEM SSID_CMD[] = "ssid";
|
||||
|
||||
// Bluetooth sniff/scan
|
||||
const char PROGMEM BT_SPAM_CMD[] = "blespam";
|
||||
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
|
||||
const char PROGMEM BT_SOUR_APPLE_CMD[] = "sourapple";
|
||||
const char PROGMEM BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
|
||||
const char PROGMEM BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
|
||||
const char PROGMEM BT_SPAM_ALL_CMD[] = "btspamall";
|
||||
//const char PROGMEM BT_SOUR_APPLE_CMD[] = "sourapple";
|
||||
//const char PROGMEM BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
|
||||
//const char PROGMEM BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
|
||||
//onst char PROGMEM BT_SPAM_ALL_CMD[] = "btspamall";
|
||||
const char PROGMEM BT_WARDRIVE_CMD[] = "btwardrive";
|
||||
const char PROGMEM BT_SKIM_CMD[] = "sniffskim";
|
||||
|
||||
@@ -96,7 +100,8 @@ const char PROGMEM HELP_SETTINGS_CMD[] = "settings [-s <setting> enable/disable>
|
||||
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";
|
||||
const char PROGMEM HELP_GPS_CMD[] = "gps [-g] <fix/sat/lon/lat/alt/date>";
|
||||
const char PROGMEM HELP_GPS_CMD[] = "gps [-g] <fix/sat/lon/lat/alt/date/accuracy/text/nmea>\r\n [-n] <native/all/gps/glonass/galileo/navic/qzss/beidou>\r\n [-b = use BD vs GB for beidou]";
|
||||
const char PROGMEM HELP_NMEA_CMD[] = "nmea";
|
||||
|
||||
// WiFi sniff/scan
|
||||
const char PROGMEM HELP_EVIL_PORTAL_CMD[] = "evilportal [-c start [-w html.html]/sethtml <html.html>]";
|
||||
@@ -126,10 +131,11 @@ 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_SOUR_APPLE_CMD[] = "sourapple";
|
||||
const char PROGMEM HELP_BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
|
||||
const char PROGMEM HELP_BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
|
||||
const char PROGMEM HELP_BT_SPAM_ALL_CMD[] = "btspamall";
|
||||
const char PROGMEM HELP_BT_SPAM_CMD[] = "blespam -t <apple/google/samsung/windows/all>";
|
||||
//const char PROGMEM HELP_BT_SOUR_APPLE_CMD[] = "sourapple";
|
||||
//const char PROGMEM HELP_BT_SWIFTPAIR_SPAM_CMD[] = "swiftpair";
|
||||
//const char PROGMEM HELP_BT_SAMSUNG_SPAM_CMD[] = "samsungblespam";
|
||||
//onst char PROGMEM HELP_BT_SPAM_ALL_CMD[] = "btspamall";
|
||||
const char PROGMEM HELP_BT_WARDRIVE_CMD[] = "btwardrive [-c]";
|
||||
const char PROGMEM HELP_BT_SKIM_CMD[] = "sniffskim";
|
||||
const char PROGMEM HELP_FOOT[] = "==================================";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef Display_h
|
||||
#define Display_h
|
||||
|
||||
|
||||
@@ -92,41 +92,37 @@ bool EvilPortal::setHtml() {
|
||||
return true;
|
||||
}
|
||||
Serial.println("Setting HTML...");
|
||||
#ifndef WRITE_PACKETS_SERIAL
|
||||
File html_file = sd_obj.getFile("/" + this->target_html_name);
|
||||
if (!html_file) {
|
||||
File html_file = sd_obj.getFile("/" + this->target_html_name);
|
||||
if (!html_file) {
|
||||
#ifdef HAS_SCREEN
|
||||
this->sendToDisplay("Could not find /" + this->target_html_name);
|
||||
this->sendToDisplay("Touch to exit...");
|
||||
#endif
|
||||
Serial.println("Could not find /" + this->target_html_name + ". Use stopscan...");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if (html_file.size() > MAX_HTML_SIZE) {
|
||||
#ifdef HAS_SCREEN
|
||||
this->sendToDisplay("Could not find /" + this->target_html_name);
|
||||
this->sendToDisplay("The given HTML is too large.");
|
||||
this->sendToDisplay("The Byte limit is " + (String)MAX_HTML_SIZE);
|
||||
this->sendToDisplay("Touch to exit...");
|
||||
#endif
|
||||
Serial.println("Could not find /" + this->target_html_name + ". Use stopscan...");
|
||||
Serial.println("The provided HTML is too large. Byte limit is " + (String)MAX_HTML_SIZE + "\nUse stopscan...");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if (html_file.size() > MAX_HTML_SIZE) {
|
||||
#ifdef HAS_SCREEN
|
||||
this->sendToDisplay("The given HTML is too large.");
|
||||
this->sendToDisplay("The Byte limit is " + (String)MAX_HTML_SIZE);
|
||||
this->sendToDisplay("Touch to exit...");
|
||||
#endif
|
||||
Serial.println("The provided HTML is too large. Byte limit is " + (String)MAX_HTML_SIZE + "\nUse stopscan...");
|
||||
return false;
|
||||
}
|
||||
String html = "";
|
||||
while (html_file.available()) {
|
||||
char c = html_file.read();
|
||||
if (isPrintable(c))
|
||||
html.concat(c);
|
||||
}
|
||||
strncpy(index_html, html.c_str(), strlen(html.c_str()));
|
||||
this->has_html = true;
|
||||
Serial.println("html set");
|
||||
html_file.close();
|
||||
return true;
|
||||
String html = "";
|
||||
while (html_file.available()) {
|
||||
char c = html_file.read();
|
||||
if (isPrintable(c))
|
||||
html.concat(c);
|
||||
}
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
strncpy(index_html, html.c_str(), strlen(html.c_str()));
|
||||
this->has_html = true;
|
||||
Serial.println("html set");
|
||||
html_file.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -143,47 +139,43 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
|
||||
// If there are no SSIDs and there are no APs selected, pull from file
|
||||
// This means the file is last resort
|
||||
if ((ssids->size() <= 0) && (temp_ap_name == "")) {
|
||||
#ifndef WRITE_PACKETS_SERIAL
|
||||
File ap_config_file = sd_obj.getFile("/ap.config.txt");
|
||||
// Could not open config file. return false
|
||||
if (!ap_config_file) {
|
||||
File ap_config_file = sd_obj.getFile("/ap.config.txt");
|
||||
// Could not open config file. return false
|
||||
if (!ap_config_file) {
|
||||
#ifdef HAS_SCREEN
|
||||
this->sendToDisplay("Could not find /ap.config.txt.");
|
||||
this->sendToDisplay("Touch to exit...");
|
||||
#endif
|
||||
Serial.println("Could not find /ap.config.txt. Use stopscan...");
|
||||
return false;
|
||||
}
|
||||
// Config file good. Proceed
|
||||
else {
|
||||
// ap name too long. return false
|
||||
if (ap_config_file.size() > MAX_AP_NAME_SIZE) {
|
||||
#ifdef HAS_SCREEN
|
||||
this->sendToDisplay("Could not find /ap.config.txt.");
|
||||
this->sendToDisplay("The given AP name is too large.");
|
||||
this->sendToDisplay("The Byte limit is " + (String)MAX_AP_NAME_SIZE);
|
||||
this->sendToDisplay("Touch to exit...");
|
||||
#endif
|
||||
Serial.println("Could not find /ap.config.txt. Use stopscan...");
|
||||
Serial.println("The provided AP name is too large. Byte limit is " + (String)MAX_AP_NAME_SIZE + "\nUse stopscan...");
|
||||
return false;
|
||||
}
|
||||
// Config file good. Proceed
|
||||
else {
|
||||
// ap name too long. return false
|
||||
if (ap_config_file.size() > MAX_AP_NAME_SIZE) {
|
||||
#ifdef HAS_SCREEN
|
||||
this->sendToDisplay("The given AP name is too large.");
|
||||
this->sendToDisplay("The Byte limit is " + (String)MAX_AP_NAME_SIZE);
|
||||
this->sendToDisplay("Touch to exit...");
|
||||
#endif
|
||||
Serial.println("The provided AP name is too large. Byte limit is " + (String)MAX_AP_NAME_SIZE + "\nUse stopscan...");
|
||||
return false;
|
||||
// AP name length good. Read from file into var
|
||||
while (ap_config_file.available()) {
|
||||
char c = ap_config_file.read();
|
||||
Serial.print(c);
|
||||
if (isPrintable(c)) {
|
||||
ap_config.concat(c);
|
||||
}
|
||||
// AP name length good. Read from file into var
|
||||
while (ap_config_file.available()) {
|
||||
char c = ap_config_file.read();
|
||||
Serial.print(c);
|
||||
if (isPrintable(c)) {
|
||||
ap_config.concat(c);
|
||||
}
|
||||
}
|
||||
#ifdef HAS_SCREEN
|
||||
this->sendToDisplay("AP name from config file");
|
||||
this->sendToDisplay("AP name: " + ap_config);
|
||||
#endif
|
||||
Serial.println("AP name from config file: " + ap_config);
|
||||
ap_config_file.close();
|
||||
}
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
#ifdef HAS_SCREEN
|
||||
this->sendToDisplay("AP name from config file");
|
||||
this->sendToDisplay("AP name: " + ap_config);
|
||||
#endif
|
||||
Serial.println("AP name from config file: " + ap_config);
|
||||
ap_config_file.close();
|
||||
}
|
||||
}
|
||||
// There are SSIDs in the list but there could also be an AP selected
|
||||
// Priority is SSID list before AP selected and config file
|
||||
@@ -272,37 +264,6 @@ void EvilPortal::startPortal() {
|
||||
this->runServer = true;
|
||||
}
|
||||
|
||||
void EvilPortal::convertStringToUint8Array(const String& str, uint8_t*& buf, uint32_t& len) {
|
||||
len = str.length(); // Obtain the length of the string
|
||||
|
||||
buf = new uint8_t[len]; // Dynamically allocate the buffer
|
||||
|
||||
// Copy each character from the string to the buffer
|
||||
for (uint32_t i = 0; i < len; i++) {
|
||||
buf[i] = static_cast<uint8_t>(str.charAt(i));
|
||||
}
|
||||
}
|
||||
|
||||
void EvilPortal::addLog(String log, int len) {
|
||||
bool save_packet = settings_obj.loadSetting<bool>(text_table4[7]);
|
||||
if (save_packet) {
|
||||
uint8_t* logBuffer = nullptr;
|
||||
uint32_t logLength = 0;
|
||||
this->convertStringToUint8Array(log, logBuffer, logLength);
|
||||
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.addPacket(logBuffer, logLength, true);
|
||||
delete[] logBuffer;
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.addPacket(logBuffer, logLength, true);
|
||||
delete[] logBuffer;
|
||||
#else
|
||||
delete[] logBuffer;
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void EvilPortal::sendToDisplay(String msg) {
|
||||
#ifdef HAS_SCREEN
|
||||
String display_string = "";
|
||||
@@ -329,7 +290,7 @@ void EvilPortal::main(uint8_t scan_mode) {
|
||||
String logValue2 = "p: " + this->password;
|
||||
String full_string = logValue1 + " " + logValue2 + "\n";
|
||||
Serial.print(full_string);
|
||||
this->addLog(full_string, full_string.length());
|
||||
buffer_obj.append(full_string);
|
||||
#ifdef HAS_SCREEN
|
||||
this->sendToDisplay(full_string);
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef EvilPortal_h
|
||||
#define EvilPortal_h
|
||||
|
||||
@@ -11,17 +13,12 @@
|
||||
#include "Display.h"
|
||||
#include <LinkedList.h>
|
||||
#endif
|
||||
#ifndef WRITE_PACKETS_SERIAL
|
||||
#include "SDInterface.h"
|
||||
#else
|
||||
#include "Buffer.h"
|
||||
#endif
|
||||
#include "SDInterface.h"
|
||||
#include "Buffer.h"
|
||||
#include "lang_var.h"
|
||||
|
||||
extern Settings settings_obj;
|
||||
#ifndef WRITE_PACKETS_SERIAL
|
||||
extern SDInterface sd_obj;
|
||||
#endif
|
||||
extern SDInterface sd_obj;
|
||||
#ifdef HAS_SCREEN
|
||||
extern Display display_obj;
|
||||
#endif
|
||||
@@ -93,7 +90,6 @@ class EvilPortal {
|
||||
void setupServer();
|
||||
void startPortal();
|
||||
void startAP();
|
||||
void convertStringToUint8Array(const String& str, uint8_t*& buf, uint32_t& len);
|
||||
void sendToDisplay(String msg);
|
||||
|
||||
public:
|
||||
@@ -109,7 +105,6 @@ class EvilPortal {
|
||||
String get_user_name();
|
||||
String get_password();
|
||||
void setup();
|
||||
void addLog(String log, int len);
|
||||
bool begin(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_points);
|
||||
void main(uint8_t scan_mode);
|
||||
void setHtmlFromSerial();
|
||||
|
||||
@@ -2,30 +2,37 @@
|
||||
|
||||
#ifdef HAS_GPS
|
||||
|
||||
extern GpsInterface gps_obj;
|
||||
|
||||
char nmeaBuffer[100];
|
||||
|
||||
MicroNMEA nmea(nmeaBuffer, sizeof(nmeaBuffer));
|
||||
|
||||
#ifndef GPS_SOFTWARE_SERIAL
|
||||
HardwareSerial Serial2(GPS_SERIAL_INDEX);
|
||||
#else
|
||||
EspSoftwareSerial::UART Serial2;
|
||||
#endif
|
||||
HardwareSerial Serial2(GPS_SERIAL_INDEX);
|
||||
|
||||
void GpsInterface::begin() {
|
||||
|
||||
#ifndef GPS_SOFTWARE_SERIAL
|
||||
Serial2.begin(9600, SERIAL_8N1, GPS_TX, GPS_RX);
|
||||
#else
|
||||
Serial2.begin(9600, SWSERIAL_8N1, GPS_TX, GPS_RX);
|
||||
#ifdef MARAUDER_MINI
|
||||
pinMode(26, OUTPUT);
|
||||
|
||||
delay(1);
|
||||
|
||||
analogWrite(26, 243);
|
||||
delay(1);
|
||||
|
||||
Serial.println("Activated GPS");
|
||||
delay(100);
|
||||
#endif
|
||||
|
||||
|
||||
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);
|
||||
delay(3900);
|
||||
|
||||
if (Serial2.available()) {
|
||||
Serial.println("GPS Attached Successfully");
|
||||
@@ -33,6 +40,422 @@ void GpsInterface::begin() {
|
||||
while (Serial2.available())
|
||||
Serial2.read();
|
||||
}
|
||||
else {
|
||||
this->gps_enabled = false;
|
||||
Serial.println("GPS Not Found");
|
||||
}
|
||||
|
||||
|
||||
this->type_flag=GPSTYPE_NATIVE; //enforce default
|
||||
this->disable_queue(); //init the queue, disabled, kill NULLs
|
||||
|
||||
nmea.setUnknownSentenceHandler(gps_nmea_notimp);
|
||||
|
||||
}
|
||||
|
||||
//passthrough for other objects
|
||||
void gps_nmea_notimp(MicroNMEA& nmea){
|
||||
gps_obj.enqueue(nmea);
|
||||
}
|
||||
|
||||
void GpsInterface::enqueue(MicroNMEA& nmea){
|
||||
std::string nmea_sentence = std::string(nmea.getSentence());
|
||||
|
||||
if(nmea_sentence.length()){
|
||||
this->notimp_nmea_sentence = nmea_sentence.c_str();
|
||||
|
||||
bool unparsed=1;
|
||||
bool enqueue=1;
|
||||
|
||||
char system=nmea.getTalkerID();
|
||||
String msg_id=nmea.getMessageID();
|
||||
int length=nmea_sentence.length();
|
||||
|
||||
if(length>0&&length<256){
|
||||
if(system){
|
||||
if(msg_id=="TXT"){
|
||||
if(length>8){
|
||||
std::string content=nmea_sentence.substr(7,std::string::npos);
|
||||
|
||||
int tot_brk=content.find(',');
|
||||
int num_brk=content.find(',',tot_brk+1);
|
||||
int txt_brk=content.find(',',num_brk+1);
|
||||
int chk_brk=content.rfind('*');
|
||||
|
||||
if(tot_brk!=std::string::npos && num_brk!=std::string::npos && txt_brk!=std::string::npos && chk_brk!=std::string::npos
|
||||
&& chk_brk>txt_brk && txt_brk>num_brk && num_brk>tot_brk && tot_brk>=0){
|
||||
std::string total_str=content.substr(0,tot_brk);
|
||||
std::string num_str=content.substr(tot_brk+1,num_brk-tot_brk-1);
|
||||
std::string type_str=content.substr(num_brk+1,txt_brk-num_brk-1);
|
||||
std::string text_str=content.substr(txt_brk+1,chk_brk-txt_brk-1);
|
||||
std::string checksum=content.substr(chk_brk+1,std::string::npos);
|
||||
|
||||
int total=0;
|
||||
if(total_str.length()) total=atoi(total_str.c_str());
|
||||
|
||||
int num=0;
|
||||
if(num_str.length()) num=atoi(num_str.c_str());
|
||||
|
||||
int type=0;
|
||||
if(type_str.length()) type=atoi(type_str.c_str());
|
||||
|
||||
if(text_str.length() && checksum.length()){
|
||||
String text=text_str.c_str();
|
||||
if(type>1){
|
||||
char type_cstr[4];
|
||||
snprintf(type_cstr, 4, "%02d ", type);
|
||||
type_cstr[3]='\0';
|
||||
text=type_cstr+text;
|
||||
}
|
||||
|
||||
if((num<=1||total<=1) && this->queue_enabled_flag){
|
||||
if(this->text){
|
||||
if(this->text_in){
|
||||
int size=text_in->size();
|
||||
if(size){
|
||||
#ifdef GPS_TEXT_MAXCYCLES
|
||||
if(this->text_cycles>=GPS_TEXT_MAXCYCLES){
|
||||
#else
|
||||
if(this->text_cycles){
|
||||
#endif
|
||||
if(this->text->size()){
|
||||
LinkedList<String> *delme=this->text;
|
||||
this->text=new LinkedList<String>;
|
||||
delete delme;
|
||||
this->text_cycles=0;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0;i<size;i++){
|
||||
this->text->add(this->text_in->get(i));
|
||||
}
|
||||
LinkedList<String> *delme=this->text_in;
|
||||
this->text_in=new LinkedList<String>;
|
||||
delete delme;
|
||||
this->text_cycles++;
|
||||
|
||||
this->gps_text=text;
|
||||
}
|
||||
}
|
||||
else
|
||||
this->text_in=new LinkedList<String>;
|
||||
}
|
||||
else{
|
||||
if(this->text_in){
|
||||
this->text_cycles=0;
|
||||
this->text=this->text_in;
|
||||
if(this->text->size()){
|
||||
if(this->gps_text=="") this->gps_text=this->text->get(0);
|
||||
this->text_cycles++;
|
||||
}
|
||||
this->text_in=new LinkedList<String>;
|
||||
}
|
||||
else {
|
||||
this->text_cycles=0;
|
||||
this->text=new LinkedList<String>;
|
||||
this->text_in=new LinkedList<String>;
|
||||
}
|
||||
}
|
||||
|
||||
this->text_in->add(text);
|
||||
}
|
||||
else if(this->queue_enabled_flag){
|
||||
if(!this->text_in) this->text_in=new LinkedList<String>;
|
||||
this->text_in->add(text);
|
||||
int size=this->text_in->size();
|
||||
|
||||
#ifdef GPS_TEXT_MAXLINES
|
||||
if(size>=GPS_TEXT_MAXLINES){
|
||||
#else
|
||||
if(size>=5){
|
||||
#endif
|
||||
#ifdef GPS_TEXT_MAXCYCLES
|
||||
if(this->text_cycles>=GPS_TEXT_MAXCYCLES){
|
||||
#else
|
||||
if(this->text_cycles){
|
||||
#endif
|
||||
if(this->text->size()){
|
||||
LinkedList<String> *delme=this->text;
|
||||
this->text=new LinkedList<String>;
|
||||
delete delme;
|
||||
this->text_cycles=0;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0;i<size;i++)
|
||||
this->text->add(this->text_in->get(i));
|
||||
|
||||
LinkedList<String> *delme=this->text_in;
|
||||
this->text_in=new LinkedList<String>;
|
||||
delete delme;
|
||||
this->text_cycles++;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(num<=1||total<=1) this->gps_text=text;
|
||||
|
||||
if(this->gps_text=="") this->gps_text=text;
|
||||
unparsed=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(unparsed)
|
||||
this->notparsed_nmea_sentence = nmea_sentence.c_str();
|
||||
|
||||
if(this->queue_enabled_flag){
|
||||
if(enqueue){
|
||||
nmea_sentence_t line = { unparsed, msg_id, nmea_sentence.c_str() };
|
||||
|
||||
if(this->queue){
|
||||
#ifdef GPS_NMEA_MAXQUEUE
|
||||
if(this->queue->size()>=GPS_NMEA_MAXQUEUE)
|
||||
#else
|
||||
if(this->queue->size()>=30)
|
||||
#endif
|
||||
this->flush_queue();
|
||||
}
|
||||
else
|
||||
this->new_queue();
|
||||
|
||||
this->queue->add(line);
|
||||
}
|
||||
else
|
||||
if(!this->queue)
|
||||
this->new_queue();
|
||||
}
|
||||
else
|
||||
this->flush_queue();
|
||||
}
|
||||
else
|
||||
if(!this->queue_enabled_flag)
|
||||
this->flush_queue();
|
||||
}
|
||||
|
||||
void GpsInterface::enable_queue(){
|
||||
if(this->queue_enabled_flag){
|
||||
if(!this->queue)
|
||||
this->new_queue();
|
||||
if(!this->text)
|
||||
this->text=new LinkedList<String>;
|
||||
if(!this->text_in)
|
||||
this->text_in=new LinkedList<String>;
|
||||
}
|
||||
else {
|
||||
this->flush_queue();
|
||||
this->queue_enabled_flag=1;
|
||||
}
|
||||
}
|
||||
|
||||
void GpsInterface::disable_queue(){
|
||||
this->queue_enabled_flag=0;
|
||||
this->flush_queue();
|
||||
}
|
||||
|
||||
bool GpsInterface::queue_enabled(){
|
||||
return this->queue_enabled_flag;
|
||||
}
|
||||
|
||||
LinkedList<nmea_sentence_t>* GpsInterface::get_queue(){
|
||||
return this->queue;
|
||||
}
|
||||
|
||||
void GpsInterface::new_queue(){
|
||||
this->queue=new LinkedList<nmea_sentence_t>;
|
||||
}
|
||||
|
||||
void GpsInterface::flush_queue(){
|
||||
this->flush_queue_nmea();
|
||||
this->flush_text();
|
||||
}
|
||||
|
||||
void GpsInterface::flush_queue_nmea(){
|
||||
if(this->queue){
|
||||
if(this->queue->size()){
|
||||
LinkedList<nmea_sentence_t> *delme=this->queue;
|
||||
this->new_queue();
|
||||
delete delme;
|
||||
}
|
||||
}
|
||||
else
|
||||
this->new_queue();
|
||||
}
|
||||
|
||||
void GpsInterface::flush_text(){
|
||||
this->flush_queue_text();
|
||||
this->flush_queue_textin();
|
||||
}
|
||||
|
||||
void GpsInterface::flush_queue_text(){
|
||||
this->text_cycles=0;
|
||||
|
||||
if(this->text){
|
||||
if(this->text->size()){
|
||||
LinkedList<String> *delme=this->text;
|
||||
this->text=new LinkedList<String>;
|
||||
delete delme;
|
||||
}
|
||||
}
|
||||
else
|
||||
this->text=new LinkedList<String>;
|
||||
}
|
||||
|
||||
void GpsInterface::flush_queue_textin(){
|
||||
if(this->text_in){
|
||||
if(this->text_in->size()){
|
||||
LinkedList<String> *delme=this->text_in;
|
||||
this->text_in=new LinkedList<String>;
|
||||
delete delme;
|
||||
}
|
||||
}
|
||||
else
|
||||
this->text_in=new LinkedList<String>;
|
||||
}
|
||||
|
||||
void GpsInterface::sendSentence(const char* sentence){
|
||||
MicroNMEA::sendSentence(Serial2, sentence);
|
||||
}
|
||||
|
||||
void GpsInterface::sendSentence(Stream &s, const char* sentence){
|
||||
MicroNMEA::sendSentence(s, sentence);
|
||||
}
|
||||
|
||||
void GpsInterface::setType(String t){
|
||||
if(t == "native")
|
||||
this->type_flag=GPSTYPE_NATIVE;
|
||||
else if(t == "gps")
|
||||
this->type_flag=GPSTYPE_GPS;
|
||||
else if(t == "glonass")
|
||||
this->type_flag=GPSTYPE_GLONASS;
|
||||
else if(t == "galileo")
|
||||
this->type_flag=GPSTYPE_GALILEO;
|
||||
else if(t == "navic")
|
||||
this->type_flag=GPSTYPE_NAVIC;
|
||||
else if(t == "qzss")
|
||||
this->type_flag=GPSTYPE_QZSS;
|
||||
else if(t == "beidou")
|
||||
this->type_flag=GPSTYPE_BEIDOU;
|
||||
else if(t == "beidou_bd")
|
||||
this->type_flag=GPSTYPE_BEIDOU_BD;
|
||||
else
|
||||
this->type_flag=GPSTYPE_ALL;
|
||||
}
|
||||
|
||||
String GpsInterface::generateGXgga(){
|
||||
String msg_type="$"+this->generateType()+"GGA,";
|
||||
|
||||
char timeStr[8];
|
||||
snprintf(timeStr, 8, "%02d%02d%02d,", (int)(nmea.getHour()), (int)(nmea.getMinute()), (int)(nmea.getSecond()));
|
||||
|
||||
long lat = nmea.getLatitude();
|
||||
char latDir = lat < 0 ? 'S' : 'N';
|
||||
lat = abs(lat);
|
||||
char latStr[12];
|
||||
snprintf(latStr, 12, "%02ld%08.5f,", lat / 1000000, ((lat % 1000000)*60) / 1000000.0);
|
||||
|
||||
long lon = nmea.getLongitude();
|
||||
char lonDir = lon < 0 ? 'W' : 'E';
|
||||
lon = abs(lon);
|
||||
char lonStr[13];
|
||||
snprintf(lonStr, 13, "%03ld%08.5f,", lon / 1000000, ((lon % 1000000)*60) / 1000000.0);
|
||||
|
||||
int fixQuality = nmea.isValid() ? 1 : 0;
|
||||
char fixStr[3];
|
||||
snprintf(fixStr, 3, "%01d,", fixQuality);
|
||||
|
||||
int numSatellites = nmea.getNumSatellites();
|
||||
char satStr[4];
|
||||
snprintf(satStr, 4, "%02d,", numSatellites);
|
||||
|
||||
unsigned long hdop = nmea.getHDOP();
|
||||
char hdopStr[13];
|
||||
snprintf(hdopStr, 13, "%01.2f,", 2.5 * (((float)(hdop))/10));
|
||||
|
||||
long altitude;
|
||||
if(!nmea.getAltitude(altitude)) altitude=0;
|
||||
char altStr[9];
|
||||
snprintf(altStr, 9, "%01.1f,", altitude/1000.0);
|
||||
|
||||
String message = msg_type + timeStr + latStr + latDir + ',' + lonStr + lonDir +
|
||||
',' + fixStr + satStr + hdopStr + altStr + "M,,M,,";
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
String GpsInterface::generateGXrmc(){
|
||||
String msg_type="$"+this->generateType()+"RMC,";
|
||||
|
||||
char timeStr[8];
|
||||
snprintf(timeStr, 8, "%02d%02d%02d,", (int)(nmea.getHour()), (int)(nmea.getMinute()), (int)(nmea.getSecond()));
|
||||
|
||||
char dateStr[8];
|
||||
snprintf(dateStr, 8, "%02d%02d%02d,", (int)(nmea.getDay()), (int)(nmea.getMonth()), (int)(nmea.getYear()%100));
|
||||
|
||||
char status = nmea.isValid() ? 'A' : 'V';
|
||||
char mode = nmea.isValid() ? 'A' : 'N';
|
||||
|
||||
long lat = nmea.getLatitude();
|
||||
char latDir = lat < 0 ? 'S' : 'N';
|
||||
lat = abs(lat);
|
||||
char latStr[12];
|
||||
snprintf(latStr, 12, "%02ld%08.5f,", lat / 1000000, ((lat % 1000000)*60) / 1000000.0);
|
||||
|
||||
long lon = nmea.getLongitude();
|
||||
char lonDir = lon < 0 ? 'W' : 'E';
|
||||
lon = abs(lon);
|
||||
char lonStr[13];
|
||||
snprintf(lonStr, 13, "%03ld%08.5f,", lon / 1000000, ((lon % 1000000)*60) / 1000000.0);
|
||||
|
||||
char speedStr[8];
|
||||
snprintf(speedStr, 8, "%01.1f,", nmea.getSpeed() / 1000.0);
|
||||
|
||||
char courseStr[7];
|
||||
snprintf(courseStr, 7, "%01.1f,", nmea.getCourse() / 1000.0);
|
||||
|
||||
String message = msg_type + timeStr + status + ',' + latStr + latDir + ',' +
|
||||
lonStr + lonDir + ',' + speedStr + courseStr + dateStr + ',' + ',' + mode;
|
||||
return message;
|
||||
}
|
||||
|
||||
String GpsInterface::generateType(){
|
||||
String msg_type="";
|
||||
|
||||
if(this->type_flag<8) //8=BeiDou in BD mode
|
||||
msg_type+='G';
|
||||
|
||||
if(this->type_flag == GPSTYPE_NATIVE){ //type_flag=0
|
||||
char system=this->nav_system;
|
||||
if(system)
|
||||
msg_type+=system;
|
||||
else
|
||||
msg_type+='N';
|
||||
}
|
||||
else if(this->type_flag == GPSTYPE_GPS) //type_flag=2
|
||||
msg_type+='P';
|
||||
else if(this->type_flag == GPSTYPE_GLONASS) //type_flag=3
|
||||
msg_type+='L';
|
||||
else if(this->type_flag == GPSTYPE_GALILEO) //type_flag=4
|
||||
msg_type+='A';
|
||||
else if(this->type_flag == GPSTYPE_NAVIC) //type_flag=5
|
||||
msg_type+='I';
|
||||
else if(this->type_flag == GPSTYPE_QZSS) //type_flag=6
|
||||
msg_type+='Q';
|
||||
else if(this->type_flag == GPSTYPE_BEIDOU) //type_flag=7
|
||||
msg_type+='B';
|
||||
else if(this->type_flag == GPSTYPE_BEIDOU_BD){ //type_flag=8
|
||||
msg_type+='B';
|
||||
msg_type+='D';
|
||||
}
|
||||
else{ //type_flag=1=all ... also default if unset/wrong (obj default is type_flag=0=native)
|
||||
if(this->type_flag>=8) //catch uncaught first char, assume G if not already output
|
||||
msg_type+='G';
|
||||
msg_type+='N';
|
||||
}
|
||||
|
||||
return msg_type;
|
||||
}
|
||||
|
||||
// Thanks JosephHewitt
|
||||
@@ -56,7 +479,11 @@ String GpsInterface::dt_string_from_gps(){
|
||||
}
|
||||
|
||||
void GpsInterface::setGPSInfo() {
|
||||
String nmea_sentence = String(nmea.getSentence());
|
||||
if(nmea_sentence != "") this->nmea_sentence = nmea_sentence;
|
||||
|
||||
this->good_fix = nmea.isValid();
|
||||
this->nav_system = nmea.getNavSystem();
|
||||
this->num_sats = nmea.getNumSatellites();
|
||||
|
||||
this->datetime = this->dt_string_from_gps();
|
||||
@@ -113,6 +540,108 @@ bool GpsInterface::getGpsModuleStatus() {
|
||||
return this->gps_enabled;
|
||||
}
|
||||
|
||||
String GpsInterface::getText() {
|
||||
return this->gps_text;
|
||||
}
|
||||
|
||||
int GpsInterface::getTextQueueSize() {
|
||||
if(this->queue_enabled_flag){
|
||||
bool exists=0;
|
||||
if(this->text){
|
||||
int size=this->text->size();
|
||||
if(size) return size;
|
||||
exists=1;
|
||||
}
|
||||
if(this->text_in){
|
||||
int size=this->text_in->size();
|
||||
if(size) return size;
|
||||
exists=1;
|
||||
}
|
||||
if(exists)
|
||||
return 0;
|
||||
else
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
String GpsInterface::getTextQueue(bool flush) {
|
||||
if(this->queue_enabled_flag){
|
||||
if(this->text){
|
||||
int size=this->text->size();
|
||||
if(size){
|
||||
String text;
|
||||
for(int i=0;i<size;i++){
|
||||
String now=this->text_in->get(i);
|
||||
if(now!=""){
|
||||
if(text!=""){
|
||||
text+='\r';
|
||||
text+='\n';
|
||||
}
|
||||
text+=now;
|
||||
}
|
||||
}
|
||||
if(flush){
|
||||
LinkedList<String> *delme=this->text;
|
||||
this->text_cycles=0;
|
||||
this->text=this->text_in;
|
||||
if(!this->text) this->text=new LinkedList<String>;
|
||||
if(this->text->size()) this->text_cycles++;
|
||||
this->text_in=new LinkedList<String>;
|
||||
delete delme;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
else{
|
||||
this->text=new LinkedList<String>;
|
||||
this->text_cycles=0;
|
||||
}
|
||||
|
||||
if(this->text_in){
|
||||
int size=this->text_in->size();
|
||||
if(size){
|
||||
LinkedList<String> *buffer=this->text_in;
|
||||
if(flush)
|
||||
this->text_in=new LinkedList<String>;
|
||||
String text;
|
||||
for(int i=0;i<size;i++){
|
||||
String now=buffer->get(i);
|
||||
if(now!=""){
|
||||
if(text!=""){
|
||||
text+='\r';
|
||||
text+='\n';
|
||||
}
|
||||
text+=now;
|
||||
}
|
||||
}
|
||||
if(flush)
|
||||
delete buffer;
|
||||
return text;
|
||||
}
|
||||
}
|
||||
else
|
||||
this->text_in=new LinkedList<String>;
|
||||
|
||||
return this->gps_text;
|
||||
}
|
||||
else
|
||||
return this->gps_text;
|
||||
}
|
||||
|
||||
String GpsInterface::getNmea() {
|
||||
return this->nmea_sentence;
|
||||
}
|
||||
|
||||
String GpsInterface::getNmeaNotimp() {
|
||||
return this->notimp_nmea_sentence;
|
||||
}
|
||||
|
||||
String GpsInterface::getNmeaNotparsed() {
|
||||
return this->notparsed_nmea_sentence;
|
||||
}
|
||||
|
||||
void GpsInterface::main() {
|
||||
while (Serial2.available()) {
|
||||
//Fetch the character one by one
|
||||
@@ -131,4 +660,4 @@ void GpsInterface::main() {
|
||||
this->setGPSInfo();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef GpsInterface_h
|
||||
#define GpsInterface_h
|
||||
|
||||
#include <MicroNMEA.h>
|
||||
#include <SoftwareSerial.h>
|
||||
#include <LinkedList.h>
|
||||
|
||||
#include "configs.h"
|
||||
|
||||
//#define GPS_TEXT_MAXLINES 5 //default:5 lines in the buffer maximum
|
||||
//#define GPS_TEXT_MAXCYCLES 1 //default:1
|
||||
|
||||
//#define GPS_NMEA_SCRNLINES TEXT_HEIGHT //default: defined TEXT_HEIGHT from configs.h
|
||||
//#define GPS_NMEA_SCRNWRAP true //default:true, except on MARAUDER_MINI where false
|
||||
//#define GPS_NMEA_MAXQUEUE 30 //default:30 messages max in queue
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
#ifndef GPS_NMEA_SCRNWRAP
|
||||
#define GPS_NMEA_SCRNWRAP false
|
||||
#endif
|
||||
#else
|
||||
#ifndef GPS_NMEA_SCRNWRAP
|
||||
#define GPS_NMEA_SCRNWRAP true
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct nmea_sentence_t {
|
||||
bool unparsed;
|
||||
String type;
|
||||
String sentence;
|
||||
};
|
||||
|
||||
void gps_nmea_notimp(MicroNMEA& nmea);
|
||||
|
||||
class GpsInterface {
|
||||
public:
|
||||
void begin();
|
||||
@@ -20,9 +48,48 @@ class GpsInterface {
|
||||
float getAlt();
|
||||
float getAccuracy();
|
||||
String getDatetime();
|
||||
String getText();
|
||||
int getTextQueueSize();
|
||||
String getTextQueue(bool flush=1);
|
||||
String getNmea();
|
||||
String getNmeaNotimp();
|
||||
String getNmeaNotparsed();
|
||||
|
||||
void setType(String t);
|
||||
|
||||
void enqueue(MicroNMEA& nmea);
|
||||
LinkedList<nmea_sentence_t>* get_queue();
|
||||
void flush_queue();
|
||||
void flush_text();
|
||||
void new_queue();
|
||||
void enable_queue();
|
||||
void disable_queue();
|
||||
bool queue_enabled();
|
||||
|
||||
void sendSentence(const char* sentence);
|
||||
void sendSentence(Stream &s, const char* sentence);
|
||||
|
||||
String generateGXgga();
|
||||
String generateGXrmc();
|
||||
|
||||
private:
|
||||
enum type_t {
|
||||
GPSTYPE_NATIVE = 0,
|
||||
GPSTYPE_ALL = 1,
|
||||
GPSTYPE_GPS = 2,
|
||||
GPSTYPE_GLONASS = 3,
|
||||
GPSTYPE_GALILEO = 4,
|
||||
GPSTYPE_NAVIC = 5,
|
||||
GPSTYPE_QZSS = 6,
|
||||
GPSTYPE_BEIDOU = 7,
|
||||
GPSTYPE_BEIDOU_BD = 8
|
||||
};
|
||||
|
||||
// GPS Info
|
||||
String gps_text = "";
|
||||
String nmea_sentence = "";
|
||||
String notimp_nmea_sentence = "";
|
||||
String notparsed_nmea_sentence = "";
|
||||
String lat = "";
|
||||
String lon = "";
|
||||
float altf = 0.0;
|
||||
@@ -31,10 +98,24 @@ class GpsInterface {
|
||||
|
||||
bool gps_enabled = false;
|
||||
bool good_fix = false;
|
||||
char nav_system='\0';
|
||||
uint8_t num_sats = 0;
|
||||
|
||||
type_t type_flag = GPSTYPE_NATIVE;
|
||||
|
||||
bool queue_enabled_flag=0;
|
||||
LinkedList<nmea_sentence_t> *queue=NULL;
|
||||
|
||||
unsigned int text_cycles=0;
|
||||
LinkedList<String> *text_in=NULL;
|
||||
LinkedList<String> *text=NULL;
|
||||
|
||||
String generateType();
|
||||
void flush_queue_text();
|
||||
void flush_queue_textin();
|
||||
void flush_queue_nmea();
|
||||
String dt_string_from_gps();
|
||||
void setGPSInfo();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef LedInterface_h
|
||||
#define LedInterface_h
|
||||
|
||||
|
||||
@@ -500,7 +500,8 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == OTA_UPDATE) ||
|
||||
(wifi_scan_obj.currentScanMode == ESP_UPDATE) ||
|
||||
(wifi_scan_obj.currentScanMode == SHOW_INFO) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_DATA)) {
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_DATA) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_GPS_NMEA)) {
|
||||
if (wifi_scan_obj.orient_display) {
|
||||
this->orientDisplay();
|
||||
wifi_scan_obj.orient_display = false;
|
||||
@@ -547,7 +548,8 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
|
||||
// getTouch causes a 10ms delay which makes beacon spam less effective
|
||||
#ifdef HAS_ILI9341
|
||||
pressed = this->updateTouch(&t_x, &t_y);
|
||||
if (!this->disable_touch)
|
||||
pressed = this->updateTouch(&t_x, &t_y);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -558,7 +560,8 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode != OTA_UPDATE) &&
|
||||
(wifi_scan_obj.currentScanMode != ESP_UPDATE) &&
|
||||
(wifi_scan_obj.currentScanMode != SHOW_INFO) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA))
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA))
|
||||
{
|
||||
// Stop the current scan
|
||||
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) ||
|
||||
@@ -589,6 +592,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_GOOGLE_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS))
|
||||
@@ -612,65 +616,70 @@ void MenuFunctions::main(uint32_t currentTime)
|
||||
#ifdef HAS_BUTTONS
|
||||
|
||||
bool c_btn_press = c_btn.justPressed();
|
||||
|
||||
#ifndef HAS_ILI9341
|
||||
|
||||
if ((c_btn_press) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) &&
|
||||
(wifi_scan_obj.currentScanMode != OTA_UPDATE) &&
|
||||
(wifi_scan_obj.currentScanMode != ESP_UPDATE) &&
|
||||
(wifi_scan_obj.currentScanMode != SHOW_INFO) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA))
|
||||
{
|
||||
// Stop the current scan
|
||||
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ESPRESSIF) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_DEAUTH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_AP_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_AUTH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_TARGETED) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_MIMIC) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_RICK_ROLL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_LIST) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_ALL) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR))
|
||||
if ((c_btn_press) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) &&
|
||||
(wifi_scan_obj.currentScanMode != OTA_UPDATE) &&
|
||||
(wifi_scan_obj.currentScanMode != ESP_UPDATE) &&
|
||||
(wifi_scan_obj.currentScanMode != SHOW_INFO) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) &&
|
||||
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA))
|
||||
{
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
|
||||
|
||||
// If we don't do this, the text and button coordinates will be off
|
||||
display_obj.tft.init();
|
||||
|
||||
// Take us back to the menu
|
||||
changeMenu(current_menu);
|
||||
// Stop the current scan
|
||||
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ESPRESSIF) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_DEAUTH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_AP_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_AUTH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_TARGETED) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_MIMIC) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_RICK_ROLL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_LIST) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_ALL) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_ATTACK_GOOGLE_SPAM) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
|
||||
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) ||
|
||||
(wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR))
|
||||
{
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
|
||||
|
||||
// If we don't do this, the text and button coordinates will be off
|
||||
display_obj.tft.init();
|
||||
|
||||
// Take us back to the menu
|
||||
changeMenu(current_menu);
|
||||
}
|
||||
|
||||
x = -1;
|
||||
y = -1;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
x = -1;
|
||||
y = -1;
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -886,29 +895,31 @@ void MenuFunctions::battery2(bool initial)
|
||||
#else
|
||||
void MenuFunctions::battery(bool initial)
|
||||
{
|
||||
uint16_t the_color;
|
||||
if (battery_obj.i2c_supported)
|
||||
{
|
||||
// Could use int compare maybe idk
|
||||
if (((String)battery_obj.battery_level != "25") && ((String)battery_obj.battery_level != "0"))
|
||||
the_color = TFT_GREEN;
|
||||
else
|
||||
the_color = TFT_RED;
|
||||
#ifdef HAS_BATTERY
|
||||
uint16_t the_color;
|
||||
if (battery_obj.i2c_supported)
|
||||
{
|
||||
// Could use int compare maybe idk
|
||||
if (((String)battery_obj.battery_level != "25") && ((String)battery_obj.battery_level != "0"))
|
||||
the_color = TFT_GREEN;
|
||||
else
|
||||
the_color = TFT_RED;
|
||||
|
||||
if ((battery_obj.battery_level != battery_obj.old_level) || (initial)) {
|
||||
battery_obj.old_level = battery_obj.battery_level;
|
||||
display_obj.tft.fillRect(204, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
display_obj.tft.setCursor(0, 1);
|
||||
display_obj.tft.drawXBitmap(186,
|
||||
0,
|
||||
menu_icons[STATUS_BAT],
|
||||
16,
|
||||
16,
|
||||
STATUSBAR_COLOR,
|
||||
the_color);
|
||||
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 204, 0, 2);
|
||||
if ((battery_obj.battery_level != battery_obj.old_level) || (initial)) {
|
||||
battery_obj.old_level = battery_obj.battery_level;
|
||||
display_obj.tft.fillRect(204, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
display_obj.tft.setCursor(0, 1);
|
||||
display_obj.tft.drawXBitmap(186,
|
||||
0,
|
||||
menu_icons[STATUS_BAT],
|
||||
16,
|
||||
16,
|
||||
STATUSBAR_COLOR,
|
||||
the_color);
|
||||
display_obj.tft.drawString((String)battery_obj.battery_level + "%", 204, 0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void MenuFunctions::battery2(bool initial)
|
||||
{
|
||||
@@ -982,18 +993,30 @@ void MenuFunctions::updateStatusBar()
|
||||
}
|
||||
|
||||
// Draw battery info
|
||||
MenuFunctions::battery(false);
|
||||
//MenuFunctions::battery(false);
|
||||
display_obj.tft.fillRect(190, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
#ifdef HAS_BUTTONS
|
||||
if (this->disable_touch) {
|
||||
display_obj.tft.setCursor(0, 1);
|
||||
display_obj.tft.drawXBitmap(190,
|
||||
0,
|
||||
menu_icons[DISABLE_TOUCH],
|
||||
16,
|
||||
16,
|
||||
STATUSBAR_COLOR,
|
||||
TFT_RED);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// Draw SD info
|
||||
#ifndef WRITE_PACKETS_SERIAL
|
||||
if (sd_obj.supported)
|
||||
the_color = TFT_GREEN;
|
||||
else
|
||||
the_color = TFT_RED;
|
||||
#else
|
||||
if (sd_obj.supported)
|
||||
the_color = TFT_GREEN;
|
||||
else
|
||||
the_color = TFT_RED;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
display_obj.tft.drawXBitmap(170,
|
||||
@@ -1072,17 +1095,29 @@ void MenuFunctions::drawStatusBar()
|
||||
#endif
|
||||
|
||||
|
||||
MenuFunctions::battery2(true);
|
||||
//MenuFunctions::battery2(true);
|
||||
display_obj.tft.fillRect(190, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
#ifdef HAS_BUTTONS
|
||||
if (this->disable_touch) {
|
||||
display_obj.tft.setCursor(0, 1);
|
||||
display_obj.tft.drawXBitmap(190,
|
||||
0,
|
||||
menu_icons[DISABLE_TOUCH],
|
||||
16,
|
||||
16,
|
||||
STATUSBAR_COLOR,
|
||||
TFT_RED);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Draw SD info
|
||||
#ifndef WRITE_PACKETS_SERIAL
|
||||
if (sd_obj.supported)
|
||||
the_color = TFT_GREEN;
|
||||
else
|
||||
the_color = TFT_RED;
|
||||
#else
|
||||
if (sd_obj.supported)
|
||||
the_color = TFT_GREEN;
|
||||
else
|
||||
the_color = TFT_RED;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
display_obj.tft.drawXBitmap(170,
|
||||
@@ -1169,6 +1204,8 @@ void MenuFunctions::displaySetting(String key, Menu* menu, int index) {
|
||||
void MenuFunctions::RunSetup()
|
||||
{
|
||||
extern LinkedList<AccessPoint>* access_points;
|
||||
|
||||
this->disable_touch = false;
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
this->initLVGL();
|
||||
@@ -1630,6 +1667,11 @@ void MenuFunctions::RunSetup()
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_SAMSUNG_SPAM, TFT_RED);
|
||||
});
|
||||
this->addNodes(&bluetoothAttackMenu, "Google BLE Spam", TFT_PURPLE, NULL, LANGUAGE, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
wifi_scan_obj.StartScan(BT_ATTACK_GOOGLE_SPAM, TFT_RED);
|
||||
});
|
||||
this->addNodes(&bluetoothAttackMenu, "BLE Spam All", TFT_MAGENTA, NULL, DEAUTH_SNIFF, [this]() {
|
||||
display_obj.clearScreen();
|
||||
this->drawStatusBar();
|
||||
@@ -1668,10 +1710,17 @@ void MenuFunctions::RunSetup()
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_DATA, TFT_CYAN);
|
||||
});
|
||||
|
||||
this->addNodes(&deviceMenu, "NMEA Stream", TFT_ORANGE, NULL, GPS_MENU, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_GPS_NMEA;
|
||||
this->changeMenu(&gpsInfoMenu);
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_GPS_NMEA, TFT_ORANGE);
|
||||
});
|
||||
|
||||
// GPS Info Menu
|
||||
gpsInfoMenu.parentMenu = &deviceMenu;
|
||||
this->addNodes(&gpsInfoMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
|
||||
this->changeMenu(gpsInfoMenu.parentMenu);
|
||||
});
|
||||
}
|
||||
@@ -1704,12 +1753,10 @@ void MenuFunctions::RunSetup()
|
||||
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
|
||||
this->changeMenu(whichUpdateMenu.parentMenu);
|
||||
});
|
||||
#ifndef WRITE_PACKETS_SERIAL
|
||||
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
this->changeMenu(&confirmMenu);
|
||||
});
|
||||
#endif
|
||||
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
|
||||
wifi_scan_obj.currentScanMode = OTA_UPDATE;
|
||||
this->changeMenu(&confirmMenu);
|
||||
});
|
||||
|
||||
// Confirm SD update menu
|
||||
confirmMenu.parentMenu = &whichUpdateMenu;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef MenuFunctions_h
|
||||
#define MenuFunctions_h
|
||||
|
||||
@@ -69,6 +71,7 @@ extern Settings settings_obj;
|
||||
#define LANGUAGE 31
|
||||
#define STATUS_GPS 32
|
||||
#define GPS_MENU 33
|
||||
#define DISABLE_TOUCH 34
|
||||
|
||||
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);
|
||||
@@ -119,7 +122,6 @@ class MenuFunctions
|
||||
uint32_t initTime = 0;
|
||||
uint8_t menu_start_index = 0;
|
||||
|
||||
|
||||
// Main menu stuff
|
||||
Menu mainMenu;
|
||||
|
||||
@@ -161,7 +163,6 @@ class MenuFunctions
|
||||
|
||||
|
||||
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);
|
||||
void showMenuList(Menu* menu, int layer);
|
||||
@@ -190,11 +191,14 @@ class MenuFunctions
|
||||
uint16_t x = -1, y = -1;
|
||||
boolean pressed = false;
|
||||
|
||||
bool disable_touch;
|
||||
|
||||
String loaded_file = "";
|
||||
|
||||
void initLVGL();
|
||||
void deinitLVGL();
|
||||
void selectEPHTMLGFX();
|
||||
void updateStatusBar();
|
||||
void addSSIDGFX();
|
||||
void addAPGFX();
|
||||
void addStationGFX();
|
||||
|
||||
@@ -32,9 +32,9 @@ bool SDInterface::initSD() {
|
||||
- CS (jumper to SD Card GND Pin)
|
||||
*/
|
||||
enum { SPI_SCK = 0, SPI_MISO = 36, SPI_MOSI = 26 };
|
||||
SPIClass SPI_EXT;
|
||||
SPI_EXT.begin(SPI_SCK, SPI_MISO, SPI_MOSI, SD_CS);
|
||||
if (!SD.begin(SD_CS, SPI_EXT)) {
|
||||
this->spiExt = new SPIClass();
|
||||
this->spiExt->begin(SPI_SCK, SPI_MISO, SPI_MOSI, SD_CS);
|
||||
if (!SD.begin(SD_CS, *(this->spiExt))) {
|
||||
#else
|
||||
if (!SD.begin(SD_CS)) {
|
||||
#endif
|
||||
@@ -73,8 +73,6 @@ bool SDInterface::initSD() {
|
||||
this->card_sz = sz;
|
||||
}
|
||||
|
||||
buffer_obj = Buffer();
|
||||
|
||||
if (!SD.exists("/SCRIPTS")) {
|
||||
Serial.println("/SCRIPTS does not exist. Creating...");
|
||||
|
||||
@@ -142,28 +140,6 @@ void SDInterface::listDir(String str_dir){
|
||||
}
|
||||
}
|
||||
|
||||
void SDInterface::addPacket(uint8_t* buf, uint32_t len, bool log) {
|
||||
if ((this->supported) && (this->do_save)) {
|
||||
buffer_obj.addPacket(buf, len, log);
|
||||
}
|
||||
}
|
||||
|
||||
void SDInterface::openCapture(String file_name) {
|
||||
bool save_pcap = settings_obj.loadSetting<bool>("SavePCAP");
|
||||
if ((this->supported) && (save_pcap)) {
|
||||
buffer_obj.createPcapFile(&SD, file_name);
|
||||
buffer_obj.open();
|
||||
}
|
||||
}
|
||||
|
||||
void SDInterface::openLog(String file_name) {
|
||||
bool save_pcap = settings_obj.loadSetting<bool>("SavePCAP");
|
||||
if ((this->supported) && (save_pcap)) {
|
||||
buffer_obj.createPcapFile(&SD, file_name, true);
|
||||
buffer_obj.open(true);
|
||||
}
|
||||
}
|
||||
|
||||
void SDInterface::runUpdate() {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.setTextWrap(false);
|
||||
@@ -300,11 +276,7 @@ bool SDInterface::checkDetectPin() {
|
||||
}
|
||||
|
||||
void SDInterface::main() {
|
||||
if ((this->supported) && (this->do_save)) {
|
||||
//Serial.println("Saving packet...");
|
||||
buffer_obj.forceSave(&SD);
|
||||
}
|
||||
else if (!this->supported) {
|
||||
if (!this->supported) {
|
||||
if (checkDetectPin()) {
|
||||
delay(100);
|
||||
this->initSD();
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef SDInterface_h
|
||||
#define SDInterface_h
|
||||
|
||||
@@ -24,6 +26,9 @@ extern Settings settings_obj;
|
||||
class SDInterface {
|
||||
|
||||
private:
|
||||
#if defined(MARAUDER_M5STICKC)
|
||||
SPIClass *spiExt;
|
||||
#endif
|
||||
bool checkDetectPin();
|
||||
|
||||
public:
|
||||
@@ -33,7 +38,6 @@ class SDInterface {
|
||||
uint64_t cardSizeMB;
|
||||
//uint64_t cardSizeGB;
|
||||
bool supported = false;
|
||||
bool do_save = true;
|
||||
|
||||
String card_sz;
|
||||
|
||||
@@ -42,13 +46,9 @@ class SDInterface {
|
||||
void listDir(String str_dir);
|
||||
void listDirToLinkedList(LinkedList<String>* file_names, String str_dir = "/", String ext = "");
|
||||
File getFile(String path);
|
||||
void addPacket(uint8_t* buf, uint32_t len, bool log = false);
|
||||
void openCapture(String file_name = "");
|
||||
void openLog(String file_name = "");
|
||||
void runUpdate();
|
||||
void performUpdate(Stream &updateSource, size_t updateSize);
|
||||
void main();
|
||||
//void savePacket(uint8_t* buf, uint32_t len);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -105,7 +105,25 @@ extern "C" {
|
||||
break;
|
||||
}
|
||||
case Google: {
|
||||
// TODO Google
|
||||
AdvData_Raw = new uint8_t[14];
|
||||
AdvData_Raw[i++] = 3;
|
||||
AdvData_Raw[i++] = 0x03;
|
||||
AdvData_Raw[i++] = 0x2C; // Fast Pair ID
|
||||
AdvData_Raw[i++] = 0xFE;
|
||||
|
||||
AdvData_Raw[i++] = 6;
|
||||
AdvData_Raw[i++] = 0x16;
|
||||
AdvData_Raw[i++] = 0x2C; // Fast Pair ID
|
||||
AdvData_Raw[i++] = 0xFE;
|
||||
AdvData_Raw[i++] = 0x00; // Smart Controller Model ID
|
||||
AdvData_Raw[i++] = 0xB7;
|
||||
AdvData_Raw[i++] = 0x27;
|
||||
|
||||
AdvData_Raw[i++] = 2;
|
||||
AdvData_Raw[i++] = 0x0A;
|
||||
AdvData_Raw[i++] = (rand() % 120) - 100; // -100 to +20 dBm
|
||||
|
||||
AdvData.addData(std::string((char *)AdvData_Raw, 14));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -224,7 +242,7 @@ extern "C" {
|
||||
Serial.print(wardrive_line);
|
||||
|
||||
if (do_save)
|
||||
evil_portal_obj.addLog(wardrive_line, wardrive_line.length());
|
||||
buffer_obj.append(wardrive_line);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -551,7 +569,8 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
|
||||
}
|
||||
else if ((scan_mode == BT_ATTACK_SWIFTPAIR_SPAM) ||
|
||||
(scan_mode == BT_ATTACK_SPAM_ALL) ||
|
||||
(scan_mode == BT_ATTACK_SAMSUNG_SPAM)) {
|
||||
(scan_mode == BT_ATTACK_SAMSUNG_SPAM) ||
|
||||
(scan_mode == BT_ATTACK_GOOGLE_SPAM)) {
|
||||
#ifdef HAS_BT
|
||||
RunSwiftpairSpam(scan_mode, color);
|
||||
#endif
|
||||
@@ -572,6 +591,11 @@ void WiFiScan::StartScan(uint8_t scan_mode, uint16_t color)
|
||||
RunLvJoinWiFi(scan_mode, color);
|
||||
#endif
|
||||
}
|
||||
else if (scan_mode == WIFI_SCAN_GPS_NMEA){
|
||||
#ifdef HAS_GPS
|
||||
gps_obj.enable_queue();
|
||||
#endif
|
||||
}
|
||||
|
||||
WiFiScan::currentScanMode = scan_mode;
|
||||
}
|
||||
@@ -731,6 +755,7 @@ void WiFiScan::StopScan(uint8_t scan_mode)
|
||||
(currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
|
||||
(currentScanMode == BT_ATTACK_SPAM_ALL) ||
|
||||
(currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
|
||||
(currentScanMode == BT_ATTACK_GOOGLE_SPAM) ||
|
||||
(currentScanMode == BT_SCAN_WAR_DRIVE) ||
|
||||
(currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
|
||||
(currentScanMode == BT_SCAN_SKIMMERS))
|
||||
@@ -750,6 +775,10 @@ void WiFiScan::StopScan(uint8_t scan_mode)
|
||||
|
||||
display_obj.tteBar = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_GPS
|
||||
gps_obj.disable_queue();
|
||||
#endif
|
||||
}
|
||||
|
||||
String WiFiScan::getStaMAC()
|
||||
@@ -901,15 +930,31 @@ String WiFiScan::freeRAM()
|
||||
return String(s);
|
||||
}
|
||||
|
||||
void WiFiScan::startPcap(String file_name) {
|
||||
buffer_obj.pcapOpen(
|
||||
file_name,
|
||||
#if defined(HAS_SD)
|
||||
sd_obj.supported ? &SD :
|
||||
#endif
|
||||
NULL,
|
||||
save_serial // Set with commandline options
|
||||
);
|
||||
}
|
||||
|
||||
void WiFiScan::startLog(String file_name) {
|
||||
buffer_obj.logOpen(
|
||||
file_name,
|
||||
#if defined(HAS_SD)
|
||||
sd_obj.supported ? &SD :
|
||||
#endif
|
||||
NULL,
|
||||
save_serial // Set with commandline options
|
||||
);
|
||||
}
|
||||
|
||||
void WiFiScan::RunEvilPortal(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.openLog("evil_portal");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
startLog("evil_portal");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
@@ -952,13 +997,7 @@ void WiFiScan::RunEvilPortal(uint8_t scan_mode, uint16_t color)
|
||||
// Function to start running a beacon scan
|
||||
void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.openCapture("ap");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
startPcap("ap");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
@@ -1122,6 +1161,8 @@ void WiFiScan::RunGenerateSSIDs(int count) {
|
||||
|
||||
void WiFiScan::RunGPSInfo() {
|
||||
#ifdef HAS_GPS
|
||||
String text=gps_obj.getText();
|
||||
|
||||
Serial.println("Refreshing GPS Data on screen...");
|
||||
#ifdef HAS_SCREEN
|
||||
|
||||
@@ -1143,7 +1184,10 @@ void WiFiScan::RunGPSInfo() {
|
||||
else
|
||||
display_obj.tft.println(" Good Fix: No");
|
||||
|
||||
if(text != "") display_obj.tft.println(" Text: " + text);
|
||||
|
||||
display_obj.tft.println("Satellites: " + gps_obj.getNumSatsString());
|
||||
display_obj.tft.println(" Accuracy: " + (String)gps_obj.getAccuracy());
|
||||
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());
|
||||
@@ -1157,7 +1201,10 @@ void WiFiScan::RunGPSInfo() {
|
||||
else
|
||||
Serial.println(" Good Fix: No");
|
||||
|
||||
if(text != "") Serial.println(" Text: " + text);
|
||||
|
||||
Serial.println("Satellites: " + gps_obj.getNumSatsString());
|
||||
Serial.println(" Accuracy: " + (String)gps_obj.getAccuracy());
|
||||
Serial.println(" Latitude: " + gps_obj.getLat());
|
||||
Serial.println(" Longitude: " + gps_obj.getLon());
|
||||
Serial.println(" Altitude: " + (String)gps_obj.getAlt());
|
||||
@@ -1165,6 +1212,141 @@ void WiFiScan::RunGPSInfo() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void WiFiScan::RunGPSNmea() {
|
||||
#ifdef HAS_GPS
|
||||
LinkedList<nmea_sentence_t> *buffer=gps_obj.get_queue();
|
||||
bool queue_enabled=gps_obj.queue_enabled();
|
||||
|
||||
String gxgga = gps_obj.generateGXgga();
|
||||
String gxrmc = gps_obj.generateGXrmc();
|
||||
|
||||
if(!buffer||!queue_enabled)
|
||||
gps_obj.flush_queue();
|
||||
#ifndef HAS_SCREEN
|
||||
else
|
||||
gps_obj.flush_text();
|
||||
#else
|
||||
// Get screen position ready
|
||||
int offset=100;
|
||||
if((SCREEN_HEIGHT / 3)<offset)
|
||||
offset=SCREEN_HEIGHT/3; //for smaller screens
|
||||
if(offset<(TOP_FIXED_AREA+6))
|
||||
offset=TOP_FIXED_AREA+6; //absolute minimium
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
display_obj.tft.setCursor(0, offset);
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_GREEN);
|
||||
|
||||
// Clean up screen first
|
||||
display_obj.tft.fillRect(0, offset-6, SCREEN_WIDTH, SCREEN_HEIGHT - (offset-6), TFT_BLACK);
|
||||
|
||||
#ifdef GPS_NMEA_SCRNLINES
|
||||
int lines=GPS_NMEA_SCRNLINES;
|
||||
#else
|
||||
int lines=TEXT_HEIGHT;
|
||||
if(lines>((TFT_HEIGHT-offset-BOT_FIXED_AREA)/10))
|
||||
lines=(TFT_HEIGHT-offset-BOT_FIXED_AREA)/10;
|
||||
#endif
|
||||
|
||||
String text=gps_obj.getText();
|
||||
if(queue_enabled){
|
||||
int queue=gps_obj.getTextQueueSize();
|
||||
if(queue>0){
|
||||
display_obj.tft.println(gps_obj.getTextQueue());
|
||||
lines-=queue; //used lines for text display
|
||||
}
|
||||
else
|
||||
if(text != ""){
|
||||
display_obj.tft.println(text);
|
||||
lines--;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(text != ""){
|
||||
display_obj.tft.println(text);
|
||||
lines--;
|
||||
}
|
||||
|
||||
#if GPS_NMEA_SCRNWRAP
|
||||
lines-=((gxgga.length()-1)/STANDARD_FONT_CHAR_LIMIT) + 1;
|
||||
lines-=((gxrmc.length()-1)/STANDARD_FONT_CHAR_LIMIT) + 1;
|
||||
display_obj.tft.setTextWrap(GPS_NMEA_SCRNWRAP);
|
||||
#else
|
||||
lines-=2; //two self-genned messages
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if(buffer && queue_enabled){
|
||||
int size=buffer->size();
|
||||
if(size){
|
||||
gps_obj.new_queue();
|
||||
for(int i=0;i<size;i++){
|
||||
nmea_sentence_t line=buffer->get(i);
|
||||
Serial.println(line.sentence);
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
if(lines>0){
|
||||
if(line.unparsed){
|
||||
if(line.type != "" && line.type != "TXT" && line.type != "GGA" && line.type != "RMC"){
|
||||
int length=line.sentence.length();
|
||||
if(length){
|
||||
#if GPS_NMEA_SCRNWRAP
|
||||
if((((length-1)/STANDARD_FONT_CHAR_LIMIT) + 1)<=lines){
|
||||
#endif
|
||||
display_obj.tft.println(line.sentence);
|
||||
#if GPS_NMEA_SCRNWRAP
|
||||
lines-=((length-1)/STANDARD_FONT_CHAR_LIMIT) + 1;
|
||||
#else
|
||||
lines--;
|
||||
#endif
|
||||
#if GPS_NMEA_SCRNWRAP
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
delete buffer;
|
||||
}
|
||||
} else {
|
||||
static String old_nmea_sentence="";
|
||||
String nmea_sentence=gps_obj.getNmeaNotimp();
|
||||
|
||||
if(nmea_sentence != "" && nmea_sentence != old_nmea_sentence){
|
||||
old_nmea_sentence=nmea_sentence;
|
||||
Serial.println(nmea_sentence);
|
||||
}
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
if(lines>0){
|
||||
String display_nmea_sentence=gps_obj.getNmeaNotparsed();
|
||||
int length=display_nmea_sentence.length();
|
||||
if(length)
|
||||
#if GPS_NMEA_SCRNWRAP
|
||||
if((((length-1)/STANDARD_FONT_CHAR_LIMIT) + 1)<=lines)
|
||||
#endif
|
||||
display_obj.tft.println(display_nmea_sentence);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(gxgga);
|
||||
display_obj.tft.println(gxrmc);
|
||||
#if GPS_NMEA_SCRNWRAP
|
||||
display_obj.tft.setTextWrap(false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
gps_obj.sendSentence(Serial, gxgga.c_str());
|
||||
gps_obj.sendSentence(Serial, gxrmc.c_str());
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void WiFiScan::RunInfo()
|
||||
{
|
||||
String sta_mac = this->getStaMAC();
|
||||
@@ -1202,11 +1384,7 @@ void WiFiScan::RunInfo()
|
||||
display_obj.tft.println(text_table4[27] + free_ram);
|
||||
#endif
|
||||
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table4[48]);
|
||||
#endif
|
||||
#elif defined(HAS_SD)
|
||||
#if defined(HAS_SD)
|
||||
if (sd_obj.supported) {
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.tft.println(text_table4[28]);
|
||||
@@ -1220,8 +1398,6 @@ void WiFiScan::RunInfo()
|
||||
display_obj.tft.println(text_table4[31]);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_BATTERY
|
||||
@@ -1256,13 +1432,7 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
||||
led_obj.setMode(MODE_SNIFF);
|
||||
#endif
|
||||
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.openCapture("packet_monitor");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
startPcap("packet_monitor");
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
|
||||
@@ -1350,11 +1520,7 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.fillScreen(TFT_BLACK);
|
||||
#endif
|
||||
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.openCapture("eapol");
|
||||
#endif
|
||||
startPcap("eapol");
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
#ifdef TFT_SHIELD
|
||||
@@ -1379,13 +1545,7 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tftDrawExitScaleButtons();
|
||||
#endif
|
||||
#else
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.openCapture("eapol");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
startPcap("eapol");
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
display_obj.TOP_FIXED_AREA_2 = 48;
|
||||
@@ -1480,13 +1640,7 @@ void WiFiScan::RunMimicFlood(uint8_t scan_mode, uint16_t color) {
|
||||
|
||||
void WiFiScan::RunPwnScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.openCapture("pwnagotchi");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
startPcap("pwnagotchi");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
@@ -1649,7 +1803,9 @@ void WiFiScan::executeWarDrive() {
|
||||
String wardrive_line = WiFi.BSSIDstr(i) + "," + ssid + "," + this->security_int_to_string(WiFi.encryptionType(i)) + "," + gps_obj.getDatetime() + "," + (String)WiFi.channel(i) + "," + (String)WiFi.RSSI(i) + "," + gps_obj.getLat() + "," + gps_obj.getLon() + "," + gps_obj.getAlt() + "," + gps_obj.getAccuracy() + ",WIFI\n";
|
||||
Serial.print((String)this->mac_history_cursor + " | " + wardrive_line);
|
||||
|
||||
evil_portal_obj.addLog(wardrive_line, wardrive_line.length());
|
||||
if (do_save) {
|
||||
buffer_obj.append(wardrive_line);
|
||||
}
|
||||
}
|
||||
}
|
||||
this->channelHop();
|
||||
@@ -1663,23 +1819,21 @@ void WiFiScan::executeWarDrive() {
|
||||
// Function to start running a beacon scan
|
||||
void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
if (scan_mode == WIFI_SCAN_AP)
|
||||
sd_obj.openCapture("beacon");
|
||||
else if (scan_mode == WIFI_SCAN_WAR_DRIVE) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
sd_obj.openLog("wardrive");
|
||||
String header_line = "WigleWifi-1.4,appRelease=" + (String)MARAUDER_VERSION + ",model=ESP32 Marauder,release=" + (String)MARAUDER_VERSION + ",device=ESP32 Marauder,display=SPI TFT,board=ESP32 Marauder,brand=JustCallMeKoko\nMAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n";
|
||||
evil_portal_obj.addLog(header_line, header_line.length());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
if (scan_mode == WIFI_SCAN_AP)
|
||||
startPcap("beacon");
|
||||
else if (scan_mode == WIFI_SCAN_WAR_DRIVE) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
startLog("wardrive");
|
||||
String header_line = "WigleWifi-1.4,appRelease=" + (String)MARAUDER_VERSION + ",model=ESP32 Marauder,release=" + (String)MARAUDER_VERSION + ",device=ESP32 Marauder,display=SPI TFT,board=ESP32 Marauder,brand=JustCallMeKoko\nMAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n";
|
||||
buffer_obj.append(header_line);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
@@ -1738,13 +1892,7 @@ void WiFiScan::startWardriverWiFi() {
|
||||
|
||||
void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.openCapture("station");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
startPcap("station");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
@@ -1787,14 +1935,8 @@ void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
if (scan_mode != WIFI_SCAN_SIG_STREN)
|
||||
sd_obj.openCapture("raw");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
if (scan_mode != WIFI_SCAN_SIG_STREN)
|
||||
startPcap("raw");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
@@ -1840,13 +1982,7 @@ void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color)
|
||||
|
||||
void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.openCapture("deauth");
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
startPcap("deauth");
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
@@ -1891,23 +2027,21 @@ void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
|
||||
// Function for running probe request scan
|
||||
void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
|
||||
{
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
if (scan_mode == WIFI_SCAN_PROBE)
|
||||
sd_obj.openCapture("probe");
|
||||
else if (scan_mode == WIFI_SCAN_STATION_WAR_DRIVE) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
sd_obj.openLog("station_wardrive");
|
||||
String header_line = "WigleWifi-1.4,appRelease=" + (String)MARAUDER_VERSION + ",model=ESP32 Marauder,release=" + (String)MARAUDER_VERSION + ",device=ESP32 Marauder,display=SPI TFT,board=ESP32 Marauder,brand=JustCallMeKoko\nMAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n";
|
||||
evil_portal_obj.addLog(header_line, header_line.length());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
if (scan_mode == WIFI_SCAN_PROBE)
|
||||
startPcap("probe");
|
||||
else if (scan_mode == WIFI_SCAN_STATION_WAR_DRIVE) {
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
startLog("station_wardrive");
|
||||
String header_line = "WigleWifi-1.4,appRelease=" + (String)MARAUDER_VERSION + ",model=ESP32 Marauder,release=" + (String)MARAUDER_VERSION + ",device=ESP32 Marauder,display=SPI TFT,board=ESP32 Marauder,brand=JustCallMeKoko\nMAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n";
|
||||
buffer_obj.append(header_line);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef MARAUDER_FLIPPER
|
||||
flipper_led.sniffLED();
|
||||
@@ -1993,6 +2127,8 @@ void WiFiScan::RunSwiftpairSpam(uint8_t scan_mode, uint16_t color) {
|
||||
display_obj.tft.drawCentreString("BLE Spam All",120,16,2);
|
||||
else if (scan_mode == BT_ATTACK_SAMSUNG_SPAM)
|
||||
display_obj.tft.drawCentreString("BLE Spam Samsung",120,16,2);
|
||||
else if (scan_mode == BT_ATTACK_GOOGLE_SPAM)
|
||||
display_obj.tft.drawCentreString("BLE Spam Google",120,16,2);
|
||||
display_obj.touchToExit();
|
||||
#endif
|
||||
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
@@ -2036,25 +2172,19 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color)
|
||||
pBLEScan->setAdvertisedDeviceCallbacks(new bluetoothScanAllCallback(), false);
|
||||
}
|
||||
else if ((scan_mode == BT_SCAN_WAR_DRIVE) || (scan_mode == BT_SCAN_WAR_DRIVE_CONT)) {
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.open();
|
||||
#elif defined(HAS_SD)
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
if (scan_mode == BT_SCAN_WAR_DRIVE) {
|
||||
#ifdef HAS_SD
|
||||
sd_obj.openLog("bt_wardrive");
|
||||
#endif
|
||||
}
|
||||
else if (scan_mode == BT_SCAN_WAR_DRIVE_CONT) {
|
||||
#ifdef HAS_SD
|
||||
sd_obj.openLog("bt_wardrive_cont");
|
||||
#endif
|
||||
}
|
||||
String header_line = "WigleWifi-1.4,appRelease=" + (String)MARAUDER_VERSION + ",model=ESP32 Marauder,release=" + (String)MARAUDER_VERSION + ",device=ESP32 Marauder,display=SPI TFT,board=ESP32 Marauder,brand=JustCallMeKoko\nMAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n";
|
||||
evil_portal_obj.addLog(header_line, header_line.length());
|
||||
#ifdef HAS_GPS
|
||||
if (gps_obj.getGpsModuleStatus()) {
|
||||
if (scan_mode == BT_SCAN_WAR_DRIVE) {
|
||||
startLog("bt_wardrive");
|
||||
}
|
||||
#endif
|
||||
else if (scan_mode == BT_SCAN_WAR_DRIVE_CONT) {
|
||||
startLog("bt_wardrive_cont");
|
||||
}
|
||||
String header_line = "WigleWifi-1.4,appRelease=" + (String)MARAUDER_VERSION + ",model=ESP32 Marauder,release=" + (String)MARAUDER_VERSION + ",device=ESP32 Marauder,display=SPI TFT,board=ESP32 Marauder,brand=JustCallMeKoko\nMAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type\n";
|
||||
buffer_obj.append(header_line);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
@@ -2219,7 +2349,7 @@ void WiFiScan::pwnSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
|
||||
Serial.println();
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2378,7 +2508,7 @@ void WiFiScan::apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
|
||||
Serial.println();
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2504,7 +2634,7 @@ void WiFiScan::apSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
|
||||
Serial.println();
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2625,7 +2755,7 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
|
||||
Serial.println();
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) {
|
||||
#ifdef HAS_GPS
|
||||
@@ -2700,7 +2830,7 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
}
|
||||
String wardrive_line = (String)addr + "," + essid + "," + wifi_scan_obj.security_int_to_string(snifferPacket->rx_ctrl.channel) + "," + gps_obj.getDatetime() + "," + (String)snifferPacket->rx_ctrl.channel + "," + (String)snifferPacket->rx_ctrl.rssi + "," + gps_obj.getLat() + "," + gps_obj.getLon() + "," + gps_obj.getAlt() + "," + gps_obj.getAccuracy() + ",WIFI";
|
||||
Serial.println(wardrive_line);
|
||||
//evil_portal_obj.addLog(wardrive_line, wardrive_line.length());
|
||||
//buffer_obj.append(wardrive_line);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2864,7 +2994,7 @@ void WiFiScan::stationSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t typ
|
||||
|
||||
access_points->set(ap_index, ap);
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
|
||||
void WiFiScan::rawSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
@@ -2965,7 +3095,7 @@ void WiFiScan::rawSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
|
||||
Serial.println();
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
|
||||
void WiFiScan::deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
@@ -3029,7 +3159,7 @@ void WiFiScan::deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
|
||||
Serial.println();
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3101,7 +3231,7 @@ void WiFiScan::probeSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
|
||||
Serial.println();
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) {
|
||||
#ifdef HAS_GPS
|
||||
@@ -3156,7 +3286,7 @@ void WiFiScan::probeSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
if (do_save) {
|
||||
String wardrive_line = (String)addr + "," + (String)addr + ",," + gps_obj.getDatetime() + "," + (String)snifferPacket->rx_ctrl.channel + "," + (String)snifferPacket->rx_ctrl.rssi + "," + gps_obj.getLat() + "," + gps_obj.getLon() + "," + gps_obj.getAlt() + "," + gps_obj.getAccuracy() + ",WIFI";
|
||||
Serial.println(wardrive_line);
|
||||
evil_portal_obj.addLog(wardrive_line, wardrive_line.length());
|
||||
buffer_obj.append(wardrive_line);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -3247,7 +3377,7 @@ void WiFiScan::beaconListSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t
|
||||
|
||||
Serial.println();
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3708,7 +3838,7 @@ void WiFiScan::wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3796,7 +3926,7 @@ void WiFiScan::eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
#endif
|
||||
}
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
|
||||
void WiFiScan::activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type)
|
||||
@@ -3882,20 +4012,7 @@ void WiFiScan::activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t
|
||||
|
||||
}
|
||||
|
||||
addPacket(snifferPacket, len);
|
||||
}
|
||||
|
||||
void WiFiScan::addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len) {
|
||||
bool save_packet = settings_obj.loadSetting<bool>(text_table4[7]);
|
||||
if (save_packet) {
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.addPacket(snifferPacket->payload, len);
|
||||
#elif defined(HAS_SD)
|
||||
sd_obj.addPacket(snifferPacket->payload, len);
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -4341,7 +4458,8 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
else if ((currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
|
||||
(currentScanMode == BT_ATTACK_SOUR_APPLE) ||
|
||||
(currentScanMode == BT_ATTACK_SPAM_ALL) ||
|
||||
(currentScanMode == BT_ATTACK_SAMSUNG_SPAM)) {
|
||||
(currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
|
||||
(currentScanMode == BT_ATTACK_GOOGLE_SPAM)) {
|
||||
#ifdef HAS_BT
|
||||
if (currentTime - initTime >= 1000) {
|
||||
initTime = millis();
|
||||
@@ -4357,6 +4475,10 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((currentScanMode == BT_ATTACK_GOOGLE_SPAM) ||
|
||||
(currentScanMode == BT_ATTACK_SPAM_ALL))
|
||||
this->executeSwiftpairSpam(Google);
|
||||
|
||||
if ((currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
|
||||
(currentScanMode == BT_ATTACK_SPAM_ALL))
|
||||
this->executeSwiftpairSpam(Samsung);
|
||||
@@ -4386,6 +4508,12 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
this->RunGPSInfo();
|
||||
}
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_GPS_NMEA) {
|
||||
if (currentTime - initTime >= 1000) {
|
||||
this->initTime = millis();
|
||||
this->RunGPSNmea();
|
||||
}
|
||||
}
|
||||
else if (currentScanMode == WIFI_SCAN_EVIL_PORTAL) {
|
||||
evil_portal_obj.main(currentScanMode);
|
||||
}
|
||||
@@ -4640,4 +4768,9 @@ void WiFiScan::main(uint32_t currentTime)
|
||||
packets_sent = 0;
|
||||
}
|
||||
}
|
||||
#ifdef HAS_GPS
|
||||
else if ((currentScanMode == WIFI_SCAN_OFF))
|
||||
if(gps_obj.queue_enabled())
|
||||
gps_obj.disable_queue();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef WiFiScan_h
|
||||
#define WiFiScan_h
|
||||
|
||||
@@ -88,6 +90,8 @@
|
||||
#define BT_ATTACK_SWIFTPAIR_SPAM 37
|
||||
#define BT_ATTACK_SPAM_ALL 38
|
||||
#define BT_ATTACK_SAMSUNG_SPAM 39
|
||||
#define WIFI_SCAN_GPS_NMEA 40
|
||||
#define BT_ATTACK_GOOGLE_SPAM 41
|
||||
|
||||
#define GRAPH_REFRESH 100
|
||||
|
||||
@@ -312,6 +316,7 @@ class WiFiScan
|
||||
void broadcastSetSSID(uint32_t current_time, const char* ESSID);
|
||||
void RunAPScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunGPSInfo();
|
||||
void RunGPSNmea();
|
||||
void RunMimicFlood(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);
|
||||
@@ -384,8 +389,11 @@ class WiFiScan
|
||||
void StartScan(uint8_t scan_mode, uint16_t color = 0);
|
||||
void StopScan(uint8_t scan_mode);
|
||||
const char* generateRandomName();
|
||||
//void addLog(String log, int len);
|
||||
|
||||
|
||||
bool save_serial = false;
|
||||
void startPcap(String file_name);
|
||||
void startLog(String file_name);
|
||||
|
||||
static void getMAC(char *addr, uint8_t* data, uint16_t offset);
|
||||
static void pwnSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
@@ -399,7 +407,6 @@ class WiFiScan
|
||||
static void activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void addPacket(wifi_promiscuous_pkt_t *snifferPacket, int len);
|
||||
|
||||
/*#ifdef HAS_BT
|
||||
enum EBLEPayloadType
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -1,13 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef configs_h
|
||||
|
||||
#define configs_h
|
||||
|
||||
#define POLISH_POTATO
|
||||
|
||||
//Indicates that it must redirect the stream with the captured packets to serial (1)
|
||||
//If not defined, will write packages to SD card if supported
|
||||
//#define WRITE_PACKETS_SERIAL
|
||||
|
||||
//// BOARD TARGETS
|
||||
//#define MARAUDER_M5STICKC
|
||||
//#define MARAUDER_MINI
|
||||
@@ -22,7 +20,7 @@
|
||||
//#define XIAO_ESP32_S3
|
||||
//// END BOARD TARGETS
|
||||
|
||||
#define MARAUDER_VERSION "v0.13.5"
|
||||
#define MARAUDER_VERSION "v0.13.7"
|
||||
|
||||
//// HARDWARE NAMES
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
@@ -68,7 +66,7 @@
|
||||
|
||||
#ifdef MARAUDER_MINI
|
||||
//#define FLIPPER_ZERO_HAT
|
||||
#define HAS_BATTERY
|
||||
//#define HAS_BATTERY
|
||||
#define HAS_BT
|
||||
#define HAS_BUTTONS
|
||||
#define HAS_NEOPIXEL_LED
|
||||
@@ -145,10 +143,8 @@
|
||||
//#define HAS_PWR_MGMT
|
||||
//#define HAS_SCREEN
|
||||
#define HAS_GPS
|
||||
#ifndef WRITE_PACKETS_SERIAL
|
||||
#define HAS_SD
|
||||
#define USE_SD
|
||||
#endif
|
||||
#define HAS_SD
|
||||
#define USE_SD
|
||||
//#define HAS_TEMP_SENSOR
|
||||
#endif
|
||||
|
||||
@@ -194,20 +190,6 @@
|
||||
#endif
|
||||
//// END BOARD FEATURES
|
||||
|
||||
//// FLIPPER ZERO HAT SETTINGS
|
||||
#ifdef FLIPPER_ZERO_HAT
|
||||
|
||||
//#ifdef MARAUDER_FLIPPER
|
||||
// #define USE_FLIPPER_SD
|
||||
//#endif
|
||||
|
||||
#ifdef XIAO_ESP32_S3
|
||||
#define USE_FLIPPER_SD
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//// END FLIPPER ZERO HAT SETTINGS
|
||||
|
||||
//// POWER MANAGEMENT
|
||||
#ifdef HAS_PWR_MGMT
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
@@ -665,13 +647,7 @@
|
||||
//// END MENU DEFINITIONS
|
||||
|
||||
//// SD DEFINITIONS
|
||||
#ifdef FLIPPER_ZERO_HAT
|
||||
|
||||
#ifdef USE_FLIPPER_SD
|
||||
#define WRITE_PACKETS_SERIAL
|
||||
#endif
|
||||
|
||||
#elif defined(USE_SD)
|
||||
#if defined(USE_SD)
|
||||
|
||||
#ifdef MARAUDER_V4
|
||||
#define SD_CS 12
|
||||
@@ -781,15 +757,6 @@
|
||||
#endif
|
||||
//// END NEOPIXEL STUFF
|
||||
|
||||
//// BOARD PIN OVERRIDES
|
||||
#ifdef XIAO_ESP32_S3
|
||||
#ifdef USE_FLIPPER_SD
|
||||
#define XIAO_RX1 1
|
||||
#define XIAO_TX1 2
|
||||
#endif
|
||||
#endif
|
||||
//// END BOARD PIN OVERRIDES
|
||||
|
||||
//// EVIL PORTAL STUFF
|
||||
#ifdef MARAUDER_M5STICKC
|
||||
#define MAX_HTML_SIZE 11400
|
||||
@@ -844,11 +811,7 @@
|
||||
#define GPS_RX 22
|
||||
#define mac_history_len 512
|
||||
#elif defined(MARAUDER_FLIPPER)
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
#define GPS_SOFTWARE_SERIAL
|
||||
#else
|
||||
#define GPS_SERIAL_INDEX 1
|
||||
#endif
|
||||
#define GPS_SERIAL_INDEX 1
|
||||
#define GPS_TX 9
|
||||
#define GPS_RX 21
|
||||
#define mac_history_len 512
|
||||
|
||||
@@ -198,17 +198,6 @@ void setup()
|
||||
|
||||
Serial.begin(115200);
|
||||
|
||||
// Starts a second serial channel to stream the captured packets
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
|
||||
#ifdef XIAO_ESP32_S3
|
||||
Serial1.begin(115200, SERIAL_8N1, XIAO_RX1, XIAO_TX1);
|
||||
#else
|
||||
Serial1.begin(115200);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//Serial.println("\n\nHello, World!\n");
|
||||
|
||||
Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
|
||||
@@ -293,9 +282,8 @@ void setup()
|
||||
display_obj.tft.println(F(text_table0[2]));
|
||||
#endif
|
||||
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj = Buffer();
|
||||
#elif defined(HAS_SD)
|
||||
buffer_obj = Buffer();
|
||||
#if defined(HAS_SD)
|
||||
// Do some SD stuff
|
||||
if(sd_obj.initSD()) {
|
||||
#ifdef HAS_SCREEN
|
||||
@@ -399,6 +387,22 @@ void loop()
|
||||
mini = true;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_ILI9341
|
||||
#ifdef HAS_BUTTONS
|
||||
if (c_btn.isHeld()) {
|
||||
if (menu_function_obj.disable_touch)
|
||||
menu_function_obj.disable_touch = false;
|
||||
else
|
||||
menu_function_obj.disable_touch = true;
|
||||
|
||||
menu_function_obj.updateStatusBar();
|
||||
|
||||
while (!c_btn.justReleased())
|
||||
delay(1);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Update all of our objects
|
||||
/*#ifdef HAS_SCREEN
|
||||
bool do_draw = display_obj.draw_tft;
|
||||
@@ -419,14 +423,14 @@ void loop()
|
||||
gps_obj.main();
|
||||
#endif
|
||||
|
||||
#ifdef WRITE_PACKETS_SERIAL
|
||||
buffer_obj.forceSaveSerial();
|
||||
#elif defined(HAS_SD)
|
||||
// Detect SD card
|
||||
#if defined(HAS_SD)
|
||||
sd_obj.main();
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
|
||||
// Save buffer to SD and/or serial
|
||||
buffer_obj.save();
|
||||
|
||||
#ifdef HAS_BATTERY
|
||||
battery_obj.main(currentTime);
|
||||
//temp_obj.main(currentTime);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef flipperLED_h
|
||||
#define flipperLED_h
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef lang_var_h
|
||||
#define lang_var_h
|
||||
|
||||
@@ -177,13 +179,12 @@ PROGMEM const char text4_44[] = " AP Scan ";
|
||||
PROGMEM const char text4_45[] = "Clearing Stations...";
|
||||
PROGMEM const char text4_46[] = "Stations Cleared: ";
|
||||
PROGMEM const char text4_47[] = "Targeted Deauth";
|
||||
PROGMEM const char text4_48[] = "Using serial to transmit packets";
|
||||
|
||||
//Making tables
|
||||
PROGMEM const char *text_table0[] = {text0_0,text0_1, text0_2, text0_3, text0_4, text0_5, text0_6, text0_7, text0_8};
|
||||
PROGMEM const char *text_table1[] = {text1_0,text1_1,text1_2,text1_3,text1_4,text1_5,text1_6,text1_7,text1_8,text1_9,text1_10,text1_11,text1_12,text1_13,text1_14,text1_15,text1_16,text1_17,text1_18,text1_19,text1_20,text1_21,text1_22,text1_23,text1_24,text1_25,text1_26,text1_27,text1_28,text1_29,text1_30,text1_31,text1_32,text1_33,text1_34,text1_35,text1_36,text1_37,text1_38,text1_39,text1_40,text1_41,text1_42,text1_43,text1_44,text1_45,text1_46,text1_47,text1_48,text1_49,text1_50,text1_51,text1_52,text1_53,text1_54,text1_55,text1_56,text1_57,text1_58,text1_59,text1_60,text1_61,text1_62};
|
||||
PROGMEM const char *text_table2[] = {text2_0,text2_1,text2_2,text2_3,text2_4,text2_5,text2_6,text2_7,text2_8,text2_9,text2_10,text2_11,text2_12,text2_13,text2_14};
|
||||
PROGMEM const char *text_table3[] = {text3_0,text3_1,text3_2,text3_3,text3_4,text3_5};
|
||||
PROGMEM const char *text_table4[] = {text4_0,text4_1,text4_2,text4_3,text4_4,text4_5,text4_6,text4_7,text1_54,text4_9,text4_10,text4_11,text4_12,text4_13,text4_14,text4_15,text4_16,text4_17,text4_18,text4_19,text4_20,text4_21,text4_22,text4_23,text4_24,text4_25,text4_26,text4_27,text4_28,text4_29,text4_30,text4_31,text4_32,text4_33,text4_34,text4_35,text4_36,text4_37,text4_38,text4_39,text4_40,text4_41,text4_42,text4_43,text4_44,text4_45,text4_46,text4_47, text4_48};
|
||||
PROGMEM const char *text_table4[] = {text4_0,text4_1,text4_2,text4_3,text4_4,text4_5,text4_6,text4_7,text1_54,text4_9,text4_10,text4_11,text4_12,text4_13,text4_14,text4_15,text4_16,text4_17,text4_18,text4_19,text4_20,text4_21,text4_22,text4_23,text4_24,text4_25,text4_26,text4_27,text4_28,text4_29,text4_30,text4_31,text4_32,text4_33,text4_34,text4_35,text4_36,text4_37,text4_38,text4_39,text4_40,text4_41,text4_42,text4_43,text4_44,text4_45,text4_46,text4_47};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef Settings_h
|
||||
#define Settings_h
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef stickcLED_H
|
||||
#define stickcLED_H
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef xiaoLED_H
|
||||
#define xiaoLED_H
|
||||
|
||||
|
||||
BIN
mechanical/V6/M6_GPS_BOTTOM_SMA_BRASS.stl
Normal file
BIN
mechanical/V6/M6_GPS_BOTTOM_SMA_BRASS.stl
Normal file
Binary file not shown.
BIN
pictures/icons/disable_touch_16.bmp
Normal file
BIN
pictures/icons/disable_touch_16.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 190 B |
6
pictures/xbm/disable_touch_16.xbm
Normal file
6
pictures/xbm/disable_touch_16.xbm
Normal file
@@ -0,0 +1,6 @@
|
||||
#define ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_width 16
|
||||
#define ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_height 16
|
||||
static char ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_bits[] = {
|
||||
0xFF, 0xFF, 0xFD, 0xBF, 0x0B, 0xD0, 0xE7, 0xE7, 0xEF, 0xF7, 0xCF, 0xF3,
|
||||
0xAF, 0xF5, 0x6F, 0xF6, 0x6F, 0xF6, 0xAF, 0xF5, 0xCF, 0xF3, 0x0F, 0xF0,
|
||||
0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF, };
|
||||
Reference in New Issue
Block a user