50 lines
1.0 KiB
C
50 lines
1.0 KiB
C
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
#include <WiFi.h>
|
|
#include "esp_wifi.h"
|
|
#include <SD.h>
|
|
|
|
typedef struct {
|
|
uint32_t magic_number;
|
|
uint16_t version_major;
|
|
uint16_t version_minor;
|
|
int32_t thiszone;
|
|
uint32_t sigfigs;
|
|
uint32_t snaplen;
|
|
uint32_t network;
|
|
} __attribute__((packed)) pcap_global_header_t;
|
|
|
|
typedef struct {
|
|
uint32_t ts_sec;
|
|
uint32_t ts_usec;
|
|
uint32_t incl_len;
|
|
uint32_t orig_len;
|
|
} __attribute__((packed)) pcap_record_header_t;
|
|
|
|
typedef struct {
|
|
String ssid;
|
|
uint8_t bssid[6];
|
|
int ch;
|
|
int rssi;
|
|
String encryption;
|
|
bool handshake_captured;
|
|
} WifiNetwork;
|
|
|
|
extern WifiNetwork networks[20];
|
|
extern WifiNetwork target;
|
|
extern bool is_capturing;
|
|
extern bool with_deauth;
|
|
|
|
void handshakeCaptureInit();
|
|
bool wasBssidCaptured(const uint8_t* bssid);
|
|
void markBssidCaptured(const uint8_t* bssid);
|
|
void scanNetworksSortedByRSSI();
|
|
void startCapture(bool deauth);
|
|
void stopCapture();
|
|
void setTarget(int index);
|
|
int getCurrentTargetIndex();
|
|
bool isHandshakeCaptured(int index);
|
|
bool isCaptureable(int index);
|
|
void handshakeCaptureLoop();
|