unleashed-firmware/applications/external/pacs_fuzzer/lib/worker/protocol.h

75 lines
1.5 KiB
C
Raw Normal View History

2023-06-02 14:48:21 +00:00
#pragma once
#include <stdint.h>
2023-06-03 11:24:27 +00:00
// #define RFID_125_PROTOCOL
2023-06-05 11:10:51 +00:00
typedef struct FuzzerPayload FuzzerPayload;
2023-06-03 11:24:27 +00:00
2023-06-05 11:10:51 +00:00
typedef enum {
2023-06-03 11:24:27 +00:00
#if defined(RFID_125_PROTOCOL)
EM4100,
HIDProx,
PAC,
H10301,
#else
2023-06-02 14:48:21 +00:00
DS1990,
Metakom,
Cyfral,
2023-06-03 11:24:27 +00:00
#endif
2023-06-05 11:10:51 +00:00
} FuzzerProtocolsID;
2023-06-03 11:24:27 +00:00
2023-06-05 11:10:51 +00:00
typedef enum {
FuzzerAttackIdDefaultValues = 0,
FuzzerAttackIdLoadFile,
FuzzerAttackIdLoadFileCustomUids,
FuzzerAttackIdBFCustomerID,
} FuzzerAttackId;
2023-06-05 11:10:51 +00:00
struct FuzzerPayload {
uint8_t* data;
uint8_t data_size;
2023-06-02 14:48:21 +00:00
};
2023-06-05 17:24:38 +00:00
/**
* Get maximum length of UID among all supported protocols
* @return Maximum length of UID
*/
2023-06-05 11:10:51 +00:00
uint8_t fuzzer_proto_get_max_data_size();
2023-06-02 14:48:21 +00:00
2023-06-06 19:43:44 +00:00
// TODO add description
uint8_t fuzzer_proto_get_def_emu_time();
uint8_t fuzzer_proto_get_def_idle_time();
2023-06-06 12:13:50 +00:00
2023-06-05 17:24:38 +00:00
/**
* Get protocol name based on its index
* @param index protocol index
* @return pointer to a string containing the name
*/
2023-06-05 11:10:51 +00:00
const char* fuzzer_proto_get_name(FuzzerProtocolsID index);
2023-06-05 17:24:38 +00:00
/**
* Get number of protocols
* @return number of protocols
*/
2023-06-05 11:10:51 +00:00
uint8_t fuzzer_proto_get_count_of_protocols();
2023-06-02 14:48:21 +00:00
2023-06-05 17:24:38 +00:00
/**
* Get menu label based on its index
* @param index menu index
* @return pointer to a string containing the menu label
*/
const char* fuzzer_proto_get_menu_label(uint8_t index);
/**
* Get FuzzerAttackId based on its index
* @param index menu index
* @return FuzzerAttackId
*/
FuzzerAttackId fuzzer_proto_get_attack_id_by_index(uint8_t index);
2023-06-02 14:48:21 +00:00
2023-06-05 17:24:38 +00:00
/**
* Get number of menu items
* @return number of menu items
*/
2023-06-05 11:10:51 +00:00
uint8_t fuzzer_proto_get_count_of_menu_items();