mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2026-01-31 09:14:23 -08:00
Compare commits
38 Commits
develop
...
nightly_a7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7bc611ede | ||
|
|
b0a823ac6b | ||
|
|
1e70c04894 | ||
|
|
069ff0a475 | ||
|
|
4fb65cd186 | ||
|
|
44f51d2f70 | ||
|
|
a1b02691d0 | ||
|
|
a54a311995 | ||
|
|
ebcfc9392e | ||
|
|
64f6b4c582 | ||
|
|
467c58fef3 | ||
|
|
2430db99b3 | ||
|
|
0196c00220 | ||
|
|
af9938f8eb | ||
|
|
0ba3d0f60a | ||
|
|
140668448f | ||
|
|
961bcb6cf5 | ||
|
|
774d5f0707 | ||
|
|
07a684a03e | ||
|
|
e3fe40ede0 | ||
|
|
8e0ed07483 | ||
|
|
249ba6eabe | ||
|
|
88762063ff | ||
|
|
9d2a1ab3aa | ||
|
|
a20b25a39c | ||
|
|
a785a3b125 | ||
|
|
380875d32f | ||
|
|
d03c079080 | ||
|
|
8ef5cf3b92 | ||
|
|
1dd5502c1d | ||
|
|
f5375eedaf | ||
|
|
86e2fb206a | ||
|
|
1d419605f7 | ||
|
|
dfd556da30 | ||
|
|
03623e2985 | ||
|
|
4e7f48a036 | ||
|
|
722b9ad88e | ||
|
|
0a5e200294 |
@@ -9,8 +9,8 @@
|
||||
static const uint8_t *g_filter_bssid = nullptr;
|
||||
uint8_t *current_act = nullptr;
|
||||
|
||||
MacEntry WiFiScan::mac_entries[mac_history_len_half];
|
||||
uint8_t WiFiScan::mac_entry_state[mac_history_len_half];
|
||||
MacEntry WiFiScan::mac_entries[mac_history_len];
|
||||
uint8_t WiFiScan::mac_entry_state[mac_history_len];
|
||||
|
||||
int num_beacon = 0;
|
||||
int num_deauth = 0;
|
||||
@@ -1721,7 +1721,7 @@ void WiFiScan::RunSetup() {
|
||||
mac_history = (struct mac_addr*) ps_malloc(mac_history_len * sizeof(struct mac_addr));
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < mac_history_len_half; i++)
|
||||
for (int i = 0; i < mac_history_len; i++)
|
||||
mac_entry_state[i] = 0;
|
||||
|
||||
#ifdef HAS_BT
|
||||
@@ -1762,8 +1762,6 @@ void WiFiScan::RunSetup() {
|
||||
|
||||
this->shutdownBLE();
|
||||
|
||||
Serial.println("Initializing WiFi...");
|
||||
|
||||
esp_wifi_init(&cfg);
|
||||
#ifdef HAS_IDF_3
|
||||
esp_wifi_set_country(&country);
|
||||
@@ -1775,9 +1773,7 @@ void WiFiScan::RunSetup() {
|
||||
esp_wifi_get_mac(WIFI_IF_STA, this->sta_mac);
|
||||
delay(10);
|
||||
esp_wifi_get_mac(WIFI_IF_AP, this->ap_mac);
|
||||
Serial.println("Setting MAC...");
|
||||
this->setMac();
|
||||
Serial.println("Shutting down WiFi...");
|
||||
this->shutdownWiFi();
|
||||
#endif
|
||||
|
||||
@@ -2364,10 +2360,6 @@ bool WiFiScan::shutdownBLE() {
|
||||
|
||||
pBLEScan->clearResults();
|
||||
|
||||
delay(100);
|
||||
|
||||
Serial.println("Deinitializing NimBLE...");
|
||||
|
||||
//#ifndef HAS_DUAL_BAND
|
||||
NimBLEDevice::deinit();
|
||||
//#endif
|
||||
@@ -2637,7 +2629,7 @@ int16_t WiFiScan::seen_mac_int(unsigned char* mac, bool simple) {
|
||||
tmp[x] = mac[x];
|
||||
}
|
||||
|
||||
for (int x = 0; x < mac_history_len_half; x++) {
|
||||
for (int x = 0; x < mac_history_len; x++) {
|
||||
if (this->mac_cmp(tmp, mac_entries[x].mac)) {
|
||||
return x;
|
||||
}
|
||||
@@ -2658,12 +2650,12 @@ inline uint32_t WiFiScan::hash_mac(const uint8_t mac[6]) {
|
||||
|
||||
int WiFiScan::update_mac_entry(const uint8_t mac[6], int8_t rssi, bool bt) {
|
||||
const uint32_t now_ms = millis();
|
||||
const uint32_t start_idx = hash_mac(mac) & (mac_history_len_half - 1);
|
||||
const uint32_t start_idx = hash_mac(mac) & (mac_history_len - 1);
|
||||
|
||||
int32_t first_tombstone = -1;
|
||||
|
||||
for (uint32_t probe = 0; probe < mac_history_len_half; probe++) {
|
||||
const uint32_t idx = (start_idx + probe) & (mac_history_len_half - 1);
|
||||
for (uint32_t probe = 0; probe < mac_history_len; probe++) {
|
||||
const uint32_t idx = (start_idx + probe) & (mac_history_len - 1);
|
||||
|
||||
switch (mac_entry_state[idx]) {
|
||||
|
||||
@@ -2699,7 +2691,7 @@ int WiFiScan::update_mac_entry(const uint8_t mac[6], int8_t rssi, bool bt) {
|
||||
|
||||
mac_entries[idx].rssi = rssi;
|
||||
|
||||
return idx + mac_history_len_half;
|
||||
return idx + mac_history_len;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2737,7 +2729,7 @@ void WiFiScan::evict_and_insert(const uint8_t mac[6], uint32_t now_ms) {
|
||||
const uint32_t EVICT_AGE_MS = TRACK_EVICT_SEC * 1000UL;
|
||||
|
||||
// 1) Prefer reusing a tombstone if any exist.
|
||||
for (uint32_t i = 0; i < mac_history_len_half; i++) {
|
||||
for (uint32_t i = 0; i < mac_history_len; i++) {
|
||||
if (mac_entry_state[i] == TOMBSTONE_ENTRY) {
|
||||
insert_mac_entry(i, mac, now_ms);
|
||||
return;
|
||||
@@ -2754,7 +2746,7 @@ void WiFiScan::evict_and_insert(const uint8_t mac[6], uint32_t now_ms) {
|
||||
uint16_t victim_any_frames = 0xFFFF;
|
||||
uint32_t victim_any_age = 0;
|
||||
|
||||
for (uint32_t i = 0; i < mac_history_len_half; i++) {
|
||||
for (uint32_t i = 0; i < mac_history_len; i++) {
|
||||
if (mac_entry_state[i] != VALID_ENTRY) continue;
|
||||
|
||||
const uint32_t age = (uint32_t)(now_ms - mac_entries[i].last_seen_ms);
|
||||
@@ -2890,7 +2882,7 @@ uint8_t WiFiScan::build_top10_for_ui(MacEntry* out_top10, MacSortMode mode) {
|
||||
}
|
||||
};
|
||||
|
||||
for (uint32_t i = 0; i < mac_history_len_half; i++) {
|
||||
for (uint32_t i = 0; i < mac_history_len; i++) {
|
||||
if (mac_entry_state[i] != VALID_ENTRY)
|
||||
continue;
|
||||
|
||||
@@ -5038,7 +5030,7 @@ void WiFiScan::RunStationScan(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.print_delay_2 = 10;
|
||||
display_obj.initScrollValues(true);
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setTextColor(TFT_BLACK, color);
|
||||
display_obj.tft.setTextColor(TFT_WHITE, color);
|
||||
#ifdef HAS_FULL_SCREEN
|
||||
display_obj.tft.fillRect(0,16,TFT_WIDTH,16, color);
|
||||
display_obj.tft.drawCentreString(text_table1[59],TFT_WIDTH / 2,16,2);
|
||||
@@ -5319,8 +5311,6 @@ void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
|
||||
display_obj.tft.drawCentreString(text_table4[40],TFT_WIDTH / 2,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_DETECT_FOLLOW)
|
||||
display_obj.tft.drawCentreString("MAC Monitor",TFT_WIDTH / 2,16,2);
|
||||
else if (scan_mode == WIFI_SCAN_STATION_WAR_DRIVE)
|
||||
display_obj.tft.drawCentreString("Station Wardrive",TFT_WIDTH / 2,16,2);
|
||||
else {
|
||||
Serial.println(F("Starting WiFi sniff for Flock..."));
|
||||
display_obj.tft.drawCentreString("Flock Sniff",TFT_WIDTH / 2,16,2);
|
||||
@@ -8085,12 +8075,12 @@ void WiFiScan::beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type
|
||||
else if (wifi_scan_obj.currentScanMode == WIFI_SCAN_DETECT_FOLLOW) {
|
||||
int frame_check = wifi_scan_obj.update_mac_entry(src_addr, snifferPacket->rx_ctrl.rssi);
|
||||
|
||||
if (frame_check >= mac_history_len_half) {
|
||||
if (frame_check >= mac_history_len) {
|
||||
int32_t dloc = 0;
|
||||
bool is_following = is_following_candidate_light(wifi_scan_obj.mac_entries[frame_check - mac_history_len_half], millis(), &dloc);
|
||||
bool is_following = is_following_candidate_light(wifi_scan_obj.mac_entries[frame_check - mac_history_len], millis(), &dloc);
|
||||
if (is_following) {
|
||||
wifi_scan_obj.mac_entries[frame_check - mac_history_len_half].dloc = dloc;
|
||||
wifi_scan_obj.mac_entries[frame_check - mac_history_len_half].following = is_following;
|
||||
wifi_scan_obj.mac_entries[frame_check - mac_history_len].dloc = dloc;
|
||||
wifi_scan_obj.mac_entries[frame_check - mac_history_len].following = is_following;
|
||||
buffer_obj.append(snifferPacket, len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -662,8 +662,8 @@ class WiFiScan
|
||||
volatile bool bt_pending_clear = false;
|
||||
|
||||
|
||||
static MacEntry mac_entries[mac_history_len_half];
|
||||
static uint8_t mac_entry_state[mac_history_len_half];
|
||||
static MacEntry mac_entries[mac_history_len];
|
||||
static uint8_t mac_entry_state[mac_history_len];
|
||||
|
||||
// Stuff for RAW stats
|
||||
uint32_t mgmt_frames = 0;
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
#define HAS_BT
|
||||
#define HAS_BT_REMOTE
|
||||
#define HAS_BUTTONS
|
||||
//#define HAS_NEOPIXEL_LED
|
||||
#define HAS_NEOPIXEL_LED
|
||||
//#define HAS_PWR_MGMT
|
||||
#define HAS_SCREEN
|
||||
#define HAS_FULL_SCREEN
|
||||
@@ -2334,8 +2334,6 @@
|
||||
#define mac_history_len 100
|
||||
#endif
|
||||
|
||||
#define mac_history_len_half (mac_history_len / 2)
|
||||
|
||||
#if defined(MARAUDER_V6) || defined(MARAUDER_V6_1)
|
||||
#define GPS_SERIAL_INDEX 2
|
||||
#define GPS_TX 4
|
||||
@@ -2411,7 +2409,6 @@
|
||||
#endif
|
||||
#else
|
||||
#define mac_history_len 100
|
||||
#define mac_history_len_half (mac_history_len / 2)
|
||||
#endif
|
||||
//// END GPS STUFF
|
||||
|
||||
@@ -2522,9 +2519,9 @@
|
||||
#ifdef HAS_PSRAM
|
||||
#define BUF_SIZE 8 * 1024 // Had to reduce buffer size to save RAM. GG @spacehuhn
|
||||
#define SNAP_LEN 1 * 4096 // max len of each recieved packet
|
||||
//#elif !defined(HAS_ILI9341)
|
||||
// #define BUF_SIZE 8 * 1024 // Had to reduce buffer size to save RAM. GG @spacehuhn
|
||||
// #define SNAP_LEN 4096 // max len of each recieved packet
|
||||
#elif !defined(HAS_ILI9341)
|
||||
#define BUF_SIZE 8 * 1024 // Had to reduce buffer size to save RAM. GG @spacehuhn
|
||||
#define SNAP_LEN 4096 // max len of each recieved packet
|
||||
#else
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user