protocol.h 1.6 KB

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