Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
iceman1001 committed Jul 16, 2023
1 parent 66f2a85 commit 8fc05ad
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
66 changes: 33 additions & 33 deletions armsrc/iso14443a.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,62 +143,62 @@ Default HF 14a config is set to:
static hf14a_config hf14aconfig = { 0, 0, 0, 0, 0 } ;


// Polling frames and configurations
// Polling frames and configurations

/*static iso14a_polling_frame REQA_FRAME = {
{ 0x26 }, 1, 7, 0
/*static iso14a_polling_frame REQA_FRAME = {
{ 0x26 }, 1, 7, 0
};*/

static const iso14a_polling_frame WUPA_FRAME = {
static const iso14a_polling_frame WUPA_FRAME = {
{ 0x52 }, 1, 7, 0,
};

static const iso14a_polling_frame MAGWUPA1_FRAME = {
{ 0x7A }, 1, 7, 0
static const iso14a_polling_frame MAGWUPA1_FRAME = {
{ 0x7A }, 1, 7, 0
};

static const iso14a_polling_frame MAGWUPA2_FRAME = {
{ 0x7B }, 1, 7, 0
static const iso14a_polling_frame MAGWUPA2_FRAME = {
{ 0x7B }, 1, 7, 0
};

static const iso14a_polling_frame MAGWUPA3_FRAME = {
{ 0x7C }, 1, 7, 0
static const iso14a_polling_frame MAGWUPA3_FRAME = {
{ 0x7C }, 1, 7, 0
};

static const iso14a_polling_frame MAGWUPA4_FRAME = {
{ 0x7D }, 1, 7, 0
static const iso14a_polling_frame MAGWUPA4_FRAME = {
{ 0x7D }, 1, 7, 0
};

static const iso14a_polling_frame ECP_FRAME = {
.frame={ 0x6a, 0x02, 0xC8, 0x01, 0x00, 0x03, 0x00, 0x02, 0x79, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xD8},
.frame_length=15,
.last_byte_bits=8,
.extra_delay=0
static const iso14a_polling_frame ECP_FRAME = {
.frame = { 0x6a, 0x02, 0xC8, 0x01, 0x00, 0x03, 0x00, 0x02, 0x79, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xD8},
.frame_length = 15,
.last_byte_bits = 8,
.extra_delay = 0
};

static iso14a_polling_parameters WUPA_POLLING_PARAMETERS = {
.frames={ WUPA_FRAME },
.frame_count=1,
.extra_timeout=0,
.frames = { WUPA_FRAME },
.frame_count = 1,
.extra_timeout = 0,
};

static iso14a_polling_parameters MAGSAFE_POLLING_PARAMETERS = {
.frames={ WUPA_FRAME, MAGWUPA1_FRAME, MAGWUPA2_FRAME, MAGWUPA3_FRAME, MAGWUPA4_FRAME },
.frame_count=5,
.extra_timeout=0
.frames = { WUPA_FRAME, MAGWUPA1_FRAME, MAGWUPA2_FRAME, MAGWUPA3_FRAME, MAGWUPA4_FRAME },
.frame_count = 5,
.extra_timeout = 0
};

// Extra 100ms give enough time for Apple devices to proccess field info and make a decision
static iso14a_polling_parameters ECP_POLLING_PARAMETERS = {
.frames={ WUPA_FRAME, ECP_FRAME },
.frame_count=2,
.extra_timeout=100
.frames = { WUPA_FRAME, ECP_FRAME },
.frame_count = 2,
.extra_timeout = 100
};

static iso14a_polling_parameters FULL_POLLING_PARAMETERS = {
.frames={ WUPA_FRAME, ECP_FRAME, MAGWUPA1_FRAME, MAGWUPA2_FRAME, MAGWUPA3_FRAME, MAGWUPA4_FRAME },
.frame_count=6,
.extra_timeout=100
.frames = { WUPA_FRAME, ECP_FRAME, MAGWUPA1_FRAME, MAGWUPA2_FRAME, MAGWUPA3_FRAME, MAGWUPA4_FRAME },
.frame_count = 6,
.extra_timeout = 100
};


Expand Down Expand Up @@ -2570,7 +2570,7 @@ static void iso14a_set_ATS_times(const uint8_t *ats) {


static int GetATQA(uint8_t *resp, uint8_t *resp_par, iso14a_polling_parameters parameters) {
#define WUPA_RETRY_TIMEOUT 10
#define WUPA_RETRY_TIMEOUT 10

uint32_t save_iso14a_timeout = iso14a_get_timeout();
iso14a_set_timeout(1236 / 128 + 1); // response to WUPA is expected at exactly 1236/fc. No need to wait longer.
Expand All @@ -2587,15 +2587,15 @@ static int GetATQA(uint8_t *resp, uint8_t *resp_par, iso14a_polling_parameters p

if (frame_parameters.last_byte_bits == 8) {
ReaderTransmit(frame_parameters.frame, frame_parameters.frame_length, NULL);

} else {
ReaderTransmitBitsPar(frame_parameters.frame, frame_parameters.last_byte_bits, NULL, NULL);
}

if (frame_parameters.extra_delay) {
SpinDelay(frame_parameters.extra_delay);
}

// Receive the ATQA
len = ReaderReceive(resp, resp_par);

Expand Down Expand Up @@ -2628,7 +2628,7 @@ iso14a_polling_parameters iso14a_get_polling_parameters(bool use_ecp, bool use_m
return ECP_POLLING_PARAMETERS;
} else if (use_magsafe) {
return MAGSAFE_POLLING_PARAMETERS;
}
}
return WUPA_POLLING_PARAMETERS;
}

Expand Down
6 changes: 3 additions & 3 deletions armsrc/iso14443a.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ typedef struct {
// Defines polling sequence configuration
// 4 magsafe, 1 wupa, 1 reqa, 1 ecp, 1 extra
typedef struct {
iso14a_polling_frame frames[8];
uint8_t frame_count;
uint16_t extra_timeout;
iso14a_polling_frame frames[8];
uint8_t frame_count;
uint16_t extra_timeout;
} iso14a_polling_parameters;


Expand Down
4 changes: 2 additions & 2 deletions doc/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -4806,7 +4806,7 @@
},
"hf mf staticnested": {
"command": "hf mf staticnested",
"description": "Execute Nested attack against MIFARE Classic card with static nonce for key recovery. Supply a known key from one block to recover all keys",
"description": "Execute static nested attack against MIFARE Classic card with static nonce for key recovery. Supply a known key from one block to recover all keys",
"notes": [
"hf mf staticnested --mini --blk 0 -a -k FFFFFFFFFFFF",
"hf mf staticnested --1k --blk 0 -a -k FFFFFFFFFFFF",
Expand Down Expand Up @@ -11689,6 +11689,6 @@
"metadata": {
"commands_extracted": 679,
"extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2023-07-14T16:33:40"
"extracted_on": "2023-07-16T13:30:30"
}
}

0 comments on commit 8fc05ad

Please sign in to comment.