protocol.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. /**
  34. * Get recomended/default emulation time
  35. * @return Default emulation time
  36. */
  37. uint8_t fuzzer_proto_get_def_emu_time();
  38. /**
  39. * Get recomended/default idle time
  40. * @return Default idle time
  41. */
  42. uint8_t fuzzer_proto_get_def_idle_time();
  43. /**
  44. * Get protocol name based on its index
  45. * @param index protocol index
  46. * @return pointer to a string containing the name
  47. */
  48. const char* fuzzer_proto_get_name(FuzzerProtocolsID index);
  49. /**
  50. * Get number of protocols
  51. * @return number of protocols
  52. */
  53. uint8_t fuzzer_proto_get_count_of_protocols();
  54. /**
  55. * Get menu label based on its index
  56. * @param index menu index
  57. * @return pointer to a string containing the menu label
  58. */
  59. const char* fuzzer_proto_get_menu_label(uint8_t index);
  60. /**
  61. * Get FuzzerAttackId based on its index
  62. * @param index menu index
  63. * @return FuzzerAttackId
  64. */
  65. FuzzerAttackId fuzzer_proto_get_attack_id_by_index(uint8_t index);
  66. /**
  67. * Get number of menu items
  68. * @return number of menu items
  69. */
  70. uint8_t fuzzer_proto_get_count_of_menu_items();