This commit is contained in:
iceman1001 committed 2024-05-14 10:04:28 +02:00
1 parent 72a11cfd89
commit 42f0699c78
17 files changed
+256 -167

No files matched your search

+48 -48
View File
@@ -403,7 +403,7 @@ uint8_t *get_uid_from_filename(const char *filename) {
}
// extract uid part from filename
char uidinhex[17] = {0};
char uidinhex[17] = {0};
strncpy(uidinhex, found + 7, 16);
uidinhex[16] = '\0';
@@ -2486,16 +2486,16 @@ static int CmdHF14BAPDU(const char *Cmd) {
uint16_t sw = get_sw(data, datalen);
if (sw != ISO7816_OK) {
PrintAndLogEx(SUCCESS, "APDU response: " _YELLOW_("%02x %02x") " - %s"
, data[datalen - 2]
, data[datalen - 1]
, GetAPDUCodeDescription(data[datalen - 2], data[datalen - 1])
);
, data[datalen - 2]
, data[datalen - 1]
, GetAPDUCodeDescription(data[datalen - 2], data[datalen - 1])
);
} else {
PrintAndLogEx(SUCCESS, "APDU response: " _GREEN_("%02x %02x") " - %s"
, data[datalen - 2]
, data[datalen - 1]
, GetAPDUCodeDescription(data[datalen - 2], data[datalen - 1])
);
, data[datalen - 2]
, data[datalen - 1]
, GetAPDUCodeDescription(data[datalen - 2], data[datalen - 1])
);
}
// TLV decoder
@@ -2708,30 +2708,30 @@ static int CmdHF14BCalypsoRead(const char *Cmd) {
{"19.SpecEv1", "\x94\xb2\x01\x04\x1d", 5},
};
/*
local CLA = '94'
local _calypso_cmds = {
/*
local CLA = '94'
local _calypso_cmds = {
-- Break down of command bytes:
-- A4 = select
-- Master File 3F00
-- 0x3F = master file
-- 0x00 = master file id, is constant to 0x00.
-- Break down of command bytes:
-- A4 = select
-- Master File 3F00
-- 0x3F = master file
-- 0x00 = master file id, is constant to 0x00.
-- DF Dedicated File 38nn
-- can be seen as directories
-- 0x38
-- 0xNN id
-- ["01.Select ICC file"] = '0294 a4 080004 3f00 0002',
-- DF Dedicated File 38nn
-- can be seen as directories
-- 0x38
-- 0xNN id
-- ["01.Select ICC file"] = '0294 a4 080004 3f00 0002',
-- EF Elementary File
-- EF1 Pin file
-- EF2 Key file
-- Grey Lock file
-- Electronic deposit file
-- Electronic Purse file
-- Electronic Transaction log file
*/
-- EF Elementary File
-- EF1 Pin file
-- EF2 Key file
-- Grey Lock file
-- Electronic deposit file
-- Electronic Purse file
-- Electronic Transaction log file
*/
bool activate_field = true;
bool leave_signal_on = true;
uint8_t response[PM3_CMD_DATA_SIZE] = { 0x00 };
@@ -2741,15 +2741,15 @@ local _calypso_cmds = {
int user_timeout = -1;
int resplen = 0;
int res = exchange_14b_apdu(
(uint8_t*)cmds[i].apdu,
cmds[i].apdulen,
activate_field,
leave_signal_on,
response,
PM3_CMD_DATA_SIZE,
&resplen,
user_timeout
);
(uint8_t *)cmds[i].apdu,
cmds[i].apdulen,
activate_field,
leave_signal_on,
response,
PM3_CMD_DATA_SIZE,
&resplen,
user_timeout
);
if (res != PM3_SUCCESS) {
PrintAndLogEx(FAILED, "sending command failed, aborting!");
@@ -2846,15 +2846,15 @@ static int CmdHF14BMobibRead(const char *Cmd) {
int user_timeout = -1;
int resplen = 0;
int res = exchange_14b_apdu(
(uint8_t*)cmds[i].apdu,
cmds[i].apdulen,
activate_field,
leave_signal_on,
response,
PM3_CMD_DATA_SIZE,
&resplen,
user_timeout
);
(uint8_t *)cmds[i].apdu,
cmds[i].apdulen,
activate_field,
leave_signal_on,
response,
PM3_CMD_DATA_SIZE,
&resplen,
user_timeout
);
if (res != PM3_SUCCESS) {
PrintAndLogEx(FAILED, "sending command failed, aborting!");