Refactor payload config, dont need 2 structs

This commit is contained in:
Willy-JL
2023-10-25 21:43:26 +01:00
parent e4309dcb8a
commit f474e8c7ca
8 changed files with 273 additions and 276 deletions

View File

@@ -6,13 +6,14 @@
#include "swiftpair.h"
typedef enum {
ProtocolModeRandom,
ProtocolModeValue,
ProtocolModeBruteforce,
} ProtocolMode;
PayloadModeRandom,
PayloadModeValue,
PayloadModeBruteforce,
} PayloadMode;
struct ProtocolCfg {
ProtocolMode mode;
struct Payload {
bool random_mac;
PayloadMode mode;
struct {
uint8_t counter;
uint32_t value;
@@ -23,18 +24,13 @@ struct ProtocolCfg {
FastpairCfg fastpair;
EasysetupCfg easysetup;
SwiftpairCfg swiftpair;
} specific;
} cfg;
};
extern const Protocol* protocols[];
extern const size_t protocols_count;
typedef struct {
bool random_mac;
ProtocolCfg cfg;
} Payload;
struct Attack {
const char* title;
const char* text;