_protocols.h 781 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "continuity.h"
  3. #include "fastpair.h"
  4. #include "easysetup.h"
  5. #include "swiftpair.h"
  6. typedef enum {
  7. ProtocolModeRandom,
  8. ProtocolModeValue,
  9. ProtocolModeBruteforce,
  10. } ProtocolMode;
  11. struct ProtocolCfg {
  12. ProtocolMode mode;
  13. struct {
  14. uint8_t counter;
  15. uint32_t value;
  16. uint8_t size;
  17. } bruteforce;
  18. union {
  19. ContinuityCfg continuity;
  20. FastpairCfg fastpair;
  21. EasysetupCfg easysetup;
  22. SwiftpairCfg swiftpair;
  23. } specific;
  24. };
  25. extern const Protocol* protocols[];
  26. extern const size_t protocols_count;
  27. typedef struct {
  28. bool random_mac;
  29. ProtocolCfg cfg;
  30. } Payload;
  31. struct Attack {
  32. const char* title;
  33. const char* text;
  34. const Protocol* protocol;
  35. Payload payload;
  36. };