mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
chg: use protocols.h for protocols defines
This commit is contained in:
parent
743659aebf
commit
c7bbe9914e
2 changed files with 8 additions and 44 deletions
|
@ -83,7 +83,7 @@ static desfire_cardtype_t getCardType(uint8_t major, uint8_t minor) {
|
|||
//ICEMAN: Turn on field method?
|
||||
//none
|
||||
static int test_desfire_authenticate() {
|
||||
uint8_t c[] = {AUTHENTICATE, 0x00, 0x00, 0x01, 0x00, 0x00}; // 0x0A, KEY 0
|
||||
uint8_t c[] = {MFDES_AUTHENTICATE, 0x00, 0x00, 0x01, 0x00, 0x00}; // 0x0A, KEY 0
|
||||
SendCommandMIX(CMD_HF_DESFIRE_COMMAND, NONE, sizeof(c), 0, c, sizeof(c));
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
|
||||
|
@ -96,7 +96,7 @@ static int test_desfire_authenticate() {
|
|||
}
|
||||
// none
|
||||
static int test_desfire_authenticate_iso() {
|
||||
uint8_t c[] = {AUTHENTICATE_ISO, 0x00, 0x00, 0x01, 0x00, 0x00}; // 0x1A, KEY 0
|
||||
uint8_t c[] = {MFDES_AUTHENTICATE_ISO, 0x00, 0x00, 0x01, 0x00, 0x00}; // 0x1A, KEY 0
|
||||
SendCommandMIX(CMD_HF_DESFIRE_COMMAND, NONE, sizeof(c), 0, c, sizeof(c));
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
|
||||
|
@ -117,7 +117,7 @@ static int test_desfire_authenticate_aes() {
|
|||
const static u08_t CustomKey3[16] = {0x79, 0x70, 0x25, 0x53, 0x79, 0x70, 0x25,
|
||||
0x53, 0x79, 0x70, 0x25, 0x53, 0x79, 0x70, 0x25, 0x53};
|
||||
*/
|
||||
uint8_t c[] = {AUTHENTICATE_AES, 0x00, 0x00, 0x01, 0x00, 0x00}; // 0xAA, KEY 0
|
||||
uint8_t c[] = {MFDES_AUTHENTICATE_AES, 0x00, 0x00, 0x01, 0x00, 0x00}; // 0xAA, KEY 0
|
||||
SendCommandMIX(CMD_HF_DESFIRE_COMMAND, NONE, sizeof(c), 0, c, sizeof(c));
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
|
||||
|
@ -137,7 +137,7 @@ static int desfire_print_freemem(uint32_t free_mem) {
|
|||
|
||||
// init / disconnect
|
||||
static int get_desfire_freemem(uint32_t *free_mem) {
|
||||
uint8_t c[] = {GET_FREE_MEMORY, 0x00, 0x00, 0x00}; // 0x6E
|
||||
uint8_t c[] = {MFDES_GET_FREE_MEMORY, 0x00, 0x00, 0x00}; // 0x6E
|
||||
SendCommandMIX(CMD_HF_DESFIRE_COMMAND, (INIT | DISCONNECT), sizeof(c), 0, c, sizeof(c));
|
||||
PacketResponseNG resp;
|
||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {
|
||||
|
@ -301,7 +301,7 @@ static int get_desfire_select_application(uint8_t *aid) {
|
|||
if (aid == NULL) return PM3_ESOFT;
|
||||
|
||||
DropField();
|
||||
uint8_t c[] = {SELECT_APPLICATION, 0x00, 0x00, 0x03, aid[0], aid[1], aid[2], 0x00}; // 0x5a
|
||||
uint8_t c[] = {MFDES_SELECT_APPLICATION, 0x00, 0x00, 0x03, aid[0], aid[1], aid[2], 0x00}; // 0x5a
|
||||
PacketResponseNG resp;
|
||||
int ret = SendDesfireCmd(c, sizeof(c), INIT, sizeof(c), 0, &resp, 3000);
|
||||
if (ret != PM3_SUCCESS) {
|
||||
|
@ -322,7 +322,7 @@ static int get_desfire_select_application(uint8_t *aid) {
|
|||
// init / disconnect
|
||||
static int get_desfire_appids(uint8_t *dest, uint8_t *app_ids_len) {
|
||||
|
||||
uint8_t c[] = {GET_APPLICATION_IDS, 0x00, 0x00, 0x00}; //0x6a
|
||||
uint8_t c[] = {MFDES_GET_APPLICATION_IDS, 0x00, 0x00, 0x00}; //0x6a
|
||||
PacketResponseNG resp;
|
||||
int ret = SendDesfireCmd(c, sizeof(c), INIT | CLEARTRACE | DISCONNECT, sizeof(c), 0, &resp, 1500);
|
||||
if (ret != PM3_SUCCESS) return ret;
|
||||
|
|
|
@ -19,50 +19,14 @@ char *getProtocolStr(uint8_t id);
|
|||
char *getVersionStr(uint8_t major, uint8_t minor);
|
||||
void getKeySettings(uint8_t *aid);
|
||||
|
||||
#define CREATE_APPLICATION 0xca
|
||||
#define DELETE_APPLICATION 0xda
|
||||
#define GET_APPLICATION_IDS 0x6a
|
||||
#define SELECT_APPLICATION 0x5a
|
||||
#define FORMAT_PICC 0xfc
|
||||
#define GET_VERSION 0x60
|
||||
#define READ_DATA 0xbd
|
||||
#define WRITE_DATA 0x3d
|
||||
#define GET_VALUE 0x6c
|
||||
#define CREDIT 0x0c
|
||||
#define DEBIT 0xdc
|
||||
#define LIMITED_CREDIT 0x1c
|
||||
#define WRITE_RECORD 0x3b
|
||||
#define READ_RECORDS 0xbb
|
||||
#define CLEAR_RECORD_FILE 0xeb
|
||||
#define COMMIT_TRANSACTION 0xc7
|
||||
#define ABORT_TRANSACTION 0xa7
|
||||
#define GET_FREE_MEMORY 0x6e
|
||||
#define GET_FILE_IDS 0x6f
|
||||
#define GET_ISOFILE_IDS 0x61
|
||||
#define GET_FILE_SETTINGS 0xf5
|
||||
#define CHANGE_FILE_SETTINGS 0x5f
|
||||
#define CREATE_STD_DATA_FILE 0xcd
|
||||
#define CREATE_BACKUP_DATA_FILE 0xcb
|
||||
#define CREATE_VALUE_FILE 0xcc
|
||||
#define CREATE_LINEAR_RECORD_FILE 0xc1
|
||||
#define CREATE_CYCLIC_RECORD_FILE 0xc0
|
||||
#define DELETE_FILE 0xdf
|
||||
#define AUTHENTICATE 0x0a // AUTHENTICATE_NATIVE
|
||||
#define AUTHENTICATE_ISO 0x1a // AUTHENTICATE_STANDARD
|
||||
#define AUTHENTICATE_AES 0xaa
|
||||
#define CHANGE_KEY_SETTINGS 0x54
|
||||
#define GET_KEY_SETTINGS 0x45
|
||||
#define CHANGE_KEY 0xc4
|
||||
#define GET_KEY_VERSION 0x64
|
||||
#define AUTHENTICATION_FRAME 0xAF
|
||||
|
||||
// Ev1 card limits
|
||||
#define MAX_NUM_KEYS 0x0F
|
||||
#define MAX_APPLICATION_COUNT 28
|
||||
#define MAX_FILE_COUNT 32
|
||||
#define MAX_FRAME_SIZE 60
|
||||
#define NOT_YET_AUTHENTICATED 255
|
||||
#define FRAME_PAYLOAD_SIZE (MAX_FRAME_SIZE - 5)
|
||||
|
||||
#define NOT_YET_AUTHENTICATED 0xFF
|
||||
|
||||
// status- and error codes |
|
||||
#define OPERATION_OK 0x00 // Successful operation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue