protocol.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #pragma once
  2. #include <stdint.h>
  3. // #define RFID_125_PROTOCOL
  4. typedef struct FuzzerPayload FuzzerPayload;
  5. typedef enum {
  6. #if defined(RFID_125_PROTOCOL)
  7. EM4100,
  8. HIDProx,
  9. PAC,
  10. H10301,
  11. #else
  12. DS1990,
  13. Metakom,
  14. Cyfral,
  15. #endif
  16. } FuzzerProtocolsID;
  17. typedef enum {
  18. FuzzerAttackIdDefaultValues = 0,
  19. FuzzerAttackIdLoadFile,
  20. FuzzerAttackIdLoadFileCustomUids,
  21. FuzzerAttackIdBFCustomerID,
  22. } FuzzerAttackId;
  23. struct FuzzerPayload {
  24. uint8_t* data;
  25. uint8_t data_size;
  26. };
  27. /**
  28. * Allocate FuzzerPayload
  29. *
  30. * @return FuzzerPayload* pointer to FuzzerPayload
  31. */
  32. FuzzerPayload* fuzzer_payload_alloc();
  33. /**
  34. * Free FuzzerPayload
  35. *
  36. * @param instance Pointer to a FuzzerPayload
  37. */
  38. void fuzzer_payload_free(FuzzerPayload*);
  39. /**
  40. * Get maximum length of UID among all supported protocols
  41. * @return Maximum length of UID
  42. */
  43. uint8_t fuzzer_proto_get_max_data_size();
  44. // TODO add description
  45. uint8_t fuzzer_proto_get_def_emu_time();
  46. uint8_t fuzzer_proto_get_def_idle_time();
  47. /**
  48. * Get protocol name based on its index
  49. * @param index protocol index
  50. * @return pointer to a string containing the name
  51. */
  52. const char* fuzzer_proto_get_name(FuzzerProtocolsID index);
  53. /**
  54. * Get number of protocols
  55. * @return number of protocols
  56. */
  57. uint8_t fuzzer_proto_get_count_of_protocols();
  58. /**
  59. * Get menu label based on its index
  60. * @param index menu index
  61. * @return pointer to a string containing the menu label
  62. */
  63. const char* fuzzer_proto_get_menu_label(uint8_t index);
  64. /**
  65. * Get FuzzerAttackId based on its index
  66. * @param index menu index
  67. * @return FuzzerAttackId
  68. */
  69. FuzzerAttackId fuzzer_proto_get_attack_id_by_index(uint8_t index);
  70. /**
  71. * Get number of menu items
  72. * @return number of menu items
  73. */
  74. uint8_t fuzzer_proto_get_count_of_menu_items();