Merge branch 'master' of github.com:RfidResearchGroup/proxmark3

This commit is contained in:
iceman1001 committed 2023-07-17 19:34:43 +02:00
commit 60cc36b398
5 files changed
+67 -62

No files matched your search

+32 -32
View File
@@ -55,31 +55,31 @@ static int CmdHelp(const char *Cmd);
static int waitCmd(bool i_select, uint32_t timeout, bool verbose);
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
};
@@ -465,34 +465,34 @@ int Hf14443_4aGetCardData(iso14a_card_select_t *card) {
iso14a_polling_parameters iso14a_get_polling_parameters(bool use_ecp, bool use_magsafe) {
// Extra 100ms give enough time for Apple (ECP) devices to proccess field info and make a decision
if (use_ecp && use_magsafe) {
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
};
return full_polling_parameters;
} else if (use_ecp) {
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
};
return ecp_polling_parameters;
} else if (use_magsafe) {
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
};
return magsafe_polling_parameters;
}
}
iso14a_polling_parameters wupa_polling_parameters = {
.frames={ WUPA_FRAME },
.frame_count=1,
.extra_timeout=0,
.frames = { WUPA_FRAME },
.frame_count = 1,
.extra_timeout = 0,
};
return wupa_polling_parameters;
}
@@ -540,7 +540,7 @@ static int CmdHF14AReader(const char *Cmd) {
bool use_ecp = arg_get_lit(ctx, 5);
bool use_magsafe = arg_get_lit(ctx, 6);
iso14a_polling_parameters * polling_parameters = NULL;
iso14a_polling_parameters *polling_parameters = NULL;
iso14a_polling_parameters parameters = iso14a_get_polling_parameters(use_ecp, use_magsafe);
if (use_ecp || use_magsafe) {
cm |= ISO14A_USE_CUSTOM_POLLING;
@@ -566,7 +566,7 @@ static int CmdHF14AReader(const char *Cmd) {
} else {
SendCommandMIX(CMD_HF_ISO14443A_READER, cm, 0, 0, NULL, 0);
}
if (ISO14A_CONNECT & cm) {
PacketResponseNG resp;
@@ -982,7 +982,7 @@ int SelectCard14443A_4_WithParameters(bool disconnect, bool verbose, iso14a_card
} else {
SendCommandMIX(CMD_HF_ISO14443A_READER, ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0, NULL, 0);
}
if (WaitForResponseTimeout(CMD_ACK, &resp, 1500) == false) {
PrintAndLogEx(WARNING, "Command execute timeout");
return PM3_ETIMEOUT;
@@ -1439,7 +1439,7 @@ static int CmdHF14ACmdRaw(const char *Cmd) {
// flags |= ISO14A_USE_MAGSAFE;
// flags |= ISO14A_USE_ECP;
}
// Max buffer is PM3_CMD_DATA_SIZE
datalen = (datalen > PM3_CMD_DATA_SIZE) ? PM3_CMD_DATA_SIZE : datalen;
+12 -12
View File
@@ -41,18 +41,18 @@
#include "mbedtls/ecc_point_compression.h"
#include "mbedtls/gcm.h"
static const iso14a_polling_frame WUPA_FRAME = {
.frame={ 0x52 },
.frame_length=1,
.last_byte_bits=7,
.extra_delay=0,
static const iso14a_polling_frame WUPA_FRAME = {
.frame = { 0x52 },
.frame_length = 1,
.last_byte_bits = 7,
.extra_delay = 0,
};
static const iso14a_polling_frame ECP_VAS_ONLY_FRAME = {
.frame={0x6a, 0x01, 0x00, 0x00, 0x02, 0xe4, 0xd2},
.frame_length=7,
.last_byte_bits=8,
.extra_delay=0,
.frame = {0x6a, 0x01, 0x00, 0x00, 0x02, 0xe4, 0xd2},
.frame_length = 7,
.last_byte_bits = 8,
.extra_delay = 0,
};
uint8_t aid[] = { 0x4f, 0x53, 0x45, 0x2e, 0x56, 0x41, 0x53, 0x2e, 0x30, 0x31 };
@@ -350,9 +350,9 @@ static int VASReader(uint8_t *pidHash, const char *url, size_t urlLen, uint8_t *
clearCommandBuffer();
iso14a_polling_parameters polling_parameters = {
.frames={ WUPA_FRAME, ECP_VAS_ONLY_FRAME },
.frame_count=2,
.extra_timeout=250
.frames = { WUPA_FRAME, ECP_VAS_ONLY_FRAME },
.frame_count = 2,
.extra_timeout = 250
};
if (SelectCard14443A_4_WithParameters(false, false, NULL, &polling_parameters) != PM3_SUCCESS) {