mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
make style
This commit is contained in:
parent
f323237091
commit
4814dc5bfb
5 changed files with 277 additions and 132 deletions
|
@ -378,7 +378,7 @@ void CIPURSEPrintDGI(uint8_t *dgi, size_t dgilen) {
|
||||||
PrintAndLogEx(WARNING, "DGI too small. Length: %zu", dgilen);
|
PrintAndLogEx(WARNING, "DGI too small. Length: %zu", dgilen);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t len = dgi[2];
|
uint8_t len = dgi[2];
|
||||||
if (len + 3 != dgilen) {
|
if (len + 3 != dgilen) {
|
||||||
PrintAndLogEx(ERR, "DGI size does not match with record size. Length of record: %zu, DGI size: %d", dgilen, len);
|
PrintAndLogEx(ERR, "DGI size does not match with record size. Length of record: %zu, DGI size: %d", dgilen, len);
|
||||||
|
@ -446,10 +446,14 @@ static void CIPURSEPrintKeyAttribDGI(uint8_t *attr) {
|
||||||
|
|
||||||
const char *CIPURSEGetSMR(uint8_t smr) {
|
const char *CIPURSEGetSMR(uint8_t smr) {
|
||||||
switch (smr) {
|
switch (smr) {
|
||||||
case 0x00: return "plain";
|
case 0x00:
|
||||||
case 0x01: return "mac";
|
return "plain";
|
||||||
case 0x02: return "enc";
|
case 0x01:
|
||||||
default: return "unknown";
|
return "mac";
|
||||||
|
case 0x02:
|
||||||
|
return "enc";
|
||||||
|
default:
|
||||||
|
return "unknown";
|
||||||
}
|
}
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
@ -481,35 +485,35 @@ void CIPURSEPrintART(uint8_t *artrec, size_t artlen) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIPURSEPrintEFFileAttr(uint8_t *attr, size_t len) {
|
void CIPURSEPrintEFFileAttr(uint8_t *attr, size_t len) {
|
||||||
CIPURSEPrintFileDescriptor(attr[0]);
|
CIPURSEPrintFileDescriptor(attr[0]);
|
||||||
|
|
||||||
if (attr[1] == 0)
|
if (attr[1] == 0)
|
||||||
PrintAndLogEx(INFO, "SFI.... not assigned");
|
PrintAndLogEx(INFO, "SFI.... not assigned");
|
||||||
else
|
else
|
||||||
PrintAndLogEx(INFO, "SFI.... 0x%02x", attr[1]);
|
PrintAndLogEx(INFO, "SFI.... 0x%02x", attr[1]);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "File ID... 0x%02x%02x", attr[2], attr[3]);
|
PrintAndLogEx(INFO, "File ID... 0x%02x%02x", attr[2], attr[3]);
|
||||||
|
|
||||||
if (attr[0] == 0x01 || attr[0] == 0x11)
|
if (attr[0] == 0x01 || attr[0] == 0x11)
|
||||||
PrintAndLogEx(INFO, "File size... %d", (attr[4] << 8) + attr[5]);
|
PrintAndLogEx(INFO, "File size... %d", (attr[4] << 8) + attr[5]);
|
||||||
else
|
else
|
||||||
PrintAndLogEx(INFO, "Record num " _YELLOW_("%d") " record size " _YELLOW_("%d"), attr[4], attr[5]);
|
PrintAndLogEx(INFO, "Record num " _YELLOW_("%d") " record size " _YELLOW_("%d"), attr[4], attr[5]);
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Keys assigned... %d", attr[6]);
|
PrintAndLogEx(INFO, "Keys assigned... %d", attr[6]);
|
||||||
|
|
||||||
if (len >= 9) {
|
if (len >= 9) {
|
||||||
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[7], attr[8]);
|
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[7], attr[8]);
|
||||||
CIPURSEPrintSMR(&attr[7]);
|
CIPURSEPrintSMR(&attr[7]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len >= 10) {
|
if (len >= 10) {
|
||||||
PrintAndLogEx(INFO, "ART... %s", sprint_hex(&attr[9], len - 9));
|
PrintAndLogEx(INFO, "ART... %s", sprint_hex(&attr[9], len - 9));
|
||||||
CIPURSEPrintART(&attr[9], len - 9);
|
CIPURSEPrintART(&attr[9], len - 9);
|
||||||
|
|
||||||
if (attr[6] + 1 != len - 9) {
|
if (attr[6] + 1 != len - 9) {
|
||||||
PrintAndLogEx(WARNING, "ART length is wrong");
|
PrintAndLogEx(WARNING, "ART length is wrong");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIPURSEPrintFileAttrEx(uint8_t *attr, size_t len, bool isDGI) {
|
void CIPURSEPrintFileAttrEx(uint8_t *attr, size_t len, bool isDGI) {
|
||||||
|
@ -559,7 +563,7 @@ void CIPURSEPrintFileAttrEx(uint8_t *attr, size_t len, bool isDGI) {
|
||||||
PrintAndLogEx(INFO, "Keys assigned... %d", keynum);
|
PrintAndLogEx(INFO, "Keys assigned... %d", keynum);
|
||||||
|
|
||||||
int idx = 7;
|
int idx = 7;
|
||||||
if ( keynum > 0) {
|
if (keynum > 0) {
|
||||||
if (len >= idx + 2) {
|
if (len >= idx + 2) {
|
||||||
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[idx], attr[idx + 1]);
|
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[idx], attr[idx + 1]);
|
||||||
CIPURSEPrintSMR(&attr[idx]);
|
CIPURSEPrintSMR(&attr[idx]);
|
||||||
|
@ -620,7 +624,7 @@ void CIPURSEPrintFileUpdateAttr(uint8_t *attr, size_t len) {
|
||||||
PrintAndLogEx(INFO, "Keys assigned... %d", keynum);
|
PrintAndLogEx(INFO, "Keys assigned... %d", keynum);
|
||||||
|
|
||||||
size_t idx = 1;
|
size_t idx = 1;
|
||||||
if ( keynum > 0) {
|
if (keynum > 0) {
|
||||||
if (len >= idx + 2) {
|
if (len >= idx + 2) {
|
||||||
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[idx], attr[idx + 1]);
|
PrintAndLogEx(INFO, "SMR entries... %02x%02x", attr[idx], attr[idx + 1]);
|
||||||
CIPURSEPrintSMR(&attr[idx]);
|
CIPURSEPrintSMR(&attr[idx]);
|
||||||
|
|
|
@ -187,9 +187,9 @@ static int CmdHFCipurseInfo(const char *Cmd) {
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CLIParseCommandParametersEx(CLIParserContext *ctx, size_t keyid, size_t aidid, size_t fidid, size_t chfidid, size_t sreqid, size_t srespid,
|
static int CLIParseCommandParametersEx(CLIParserContext *ctx, size_t keyid, size_t aidid, size_t fidid, size_t chfidid, size_t sreqid, size_t srespid,
|
||||||
uint8_t *key, uint8_t *aid, size_t *aidlen, bool *useaid, uint16_t *fid, bool *usefid, uint16_t *chfid, bool *usechfid,
|
uint8_t *key, uint8_t *aid, size_t *aidlen, bool *useaid, uint16_t *fid, bool *usefid, uint16_t *chfid, bool *usechfid,
|
||||||
CipurseChannelSecurityLevel *sreq, CipurseChannelSecurityLevel *sresp) {
|
CipurseChannelSecurityLevel *sreq, CipurseChannelSecurityLevel *sresp) {
|
||||||
uint8_t hdata[250] = {0};
|
uint8_t hdata[250] = {0};
|
||||||
int hdatalen = sizeof(hdata);
|
int hdatalen = sizeof(hdata);
|
||||||
if (keyid) {
|
if (keyid) {
|
||||||
|
@ -224,7 +224,7 @@ static int CLIParseCommandParametersEx(CLIParserContext *ctx, size_t keyid, size
|
||||||
*useaid = true;
|
*useaid = true;
|
||||||
} else {
|
} else {
|
||||||
memcpy(aid, defaultAID, defaultAIDLength);
|
memcpy(aid, defaultAID, defaultAIDLength);
|
||||||
*aidlen = defaultAIDLength;
|
*aidlen = defaultAIDLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,16 +312,16 @@ static int CLIParseCommandParametersEx(CLIParserContext *ctx, size_t keyid, size
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CLIParseCommandParameters(CLIParserContext *ctx, size_t keyid, size_t aidid, size_t fidid, size_t sreqid, size_t srespid,
|
static int CLIParseCommandParameters(CLIParserContext *ctx, size_t keyid, size_t aidid, size_t fidid, size_t sreqid, size_t srespid,
|
||||||
uint8_t *key, uint8_t *aid, size_t *aidlen, bool *useaid, uint16_t *fid, bool *usefid,
|
uint8_t *key, uint8_t *aid, size_t *aidlen, bool *useaid, uint16_t *fid, bool *usefid,
|
||||||
CipurseChannelSecurityLevel *sreq, CipurseChannelSecurityLevel *sresp) {
|
CipurseChannelSecurityLevel *sreq, CipurseChannelSecurityLevel *sresp) {
|
||||||
return CLIParseCommandParametersEx(ctx, keyid, aidid, fidid, 0, sreqid, srespid,
|
return CLIParseCommandParametersEx(ctx, keyid, aidid, fidid, 0, sreqid, srespid,
|
||||||
key, aid, aidlen, useaid, fid, usefid, NULL, NULL, sreq, sresp);
|
key, aid, aidlen, useaid, fid, usefid, NULL, NULL, sreq, sresp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SelectCommandEx(bool selectDefaultFile, bool useAID, uint8_t *aid, size_t aidLen, bool useFID, uint16_t fileId,
|
static int SelectCommandEx(bool selectDefaultFile, bool useAID, uint8_t *aid, size_t aidLen, bool useFID, uint16_t fileId,
|
||||||
bool selChildFile, uint16_t childFileId, bool verbose,
|
bool selChildFile, uint16_t childFileId, bool verbose,
|
||||||
uint8_t *buf, size_t bufSize, size_t *len, uint16_t *sw) {
|
uint8_t *buf, size_t bufSize, size_t *len, uint16_t *sw) {
|
||||||
int res = 0;
|
int res = 0;
|
||||||
if (verbose && selChildFile)
|
if (verbose && selChildFile)
|
||||||
PrintAndLogEx(INFO, "Select top level application/file");
|
PrintAndLogEx(INFO, "Select top level application/file");
|
||||||
|
@ -381,7 +381,7 @@ static int SelectCommandEx(bool selectDefaultFile, bool useAID, uint8_t *aid, si
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SelectCommand(bool selectDefaultFile, bool useAID, uint8_t *aid, size_t aidLen, bool useFID, uint16_t fileId, bool verbose,
|
static int SelectCommand(bool selectDefaultFile, bool useAID, uint8_t *aid, size_t aidLen, bool useFID, uint16_t fileId, bool verbose,
|
||||||
uint8_t *buf, size_t bufSize, size_t *len, uint16_t *sw) {
|
uint8_t *buf, size_t bufSize, size_t *len, uint16_t *sw) {
|
||||||
return SelectCommandEx(selectDefaultFile, useAID, aid, aidLen, useFID, fileId, false, 0, verbose, buf, bufSize, len, sw);
|
return SelectCommandEx(selectDefaultFile, useAID, aid, aidLen, useFID, fileId, false, 0, verbose, buf, bufSize, len, sw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -852,9 +852,9 @@ static int CmdHFCipurseReadFileAttr(const char *Cmd) {
|
||||||
|
|
||||||
if (!noAuth)
|
if (!noAuth)
|
||||||
PrintAndLogEx(INFO, "Key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
PrintAndLogEx(INFO, "Key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
||||||
, keyId
|
, keyId
|
||||||
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noAuth == false) {
|
if (noAuth == false) {
|
||||||
|
@ -989,9 +989,9 @@ static int CmdHFCipurseWriteFileAttr(const char *Cmd) {
|
||||||
|
|
||||||
if (!noAuth)
|
if (!noAuth)
|
||||||
PrintAndLogEx(INFO, "Key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
PrintAndLogEx(INFO, "Key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
||||||
, keyId
|
, keyId
|
||||||
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noAuth == false) {
|
if (noAuth == false) {
|
||||||
|
@ -1085,9 +1085,9 @@ static int CmdHFCipurseFormatAll(const char *Cmd) {
|
||||||
PrintAndLogEx(WARNING, _YELLOW_("FORMAT erases all the data at this card!!!"));
|
PrintAndLogEx(WARNING, _YELLOW_("FORMAT erases all the data at this card!!!"));
|
||||||
if (!noauth)
|
if (!noauth)
|
||||||
PrintAndLogEx(INFO, "key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
PrintAndLogEx(INFO, "key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
||||||
, keyId
|
, keyId
|
||||||
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noauth) {
|
if (!noauth) {
|
||||||
|
@ -1121,7 +1121,7 @@ static int CmdHFCipurseCreateDGI(const char *Cmd) {
|
||||||
"Create application/file/key by provide appropriate DGI. If no key is supplied, default key of 737373...7373 will be used",
|
"Create application/file/key by provide appropriate DGI. If no key is supplied, default key of 737373...7373 will be used",
|
||||||
"hf cipurse create -d 9200123F00200008000062098407A0000005070100 -> create PTSE file with FID 0x2000 and space for 8 AIDs\n"
|
"hf cipurse create -d 9200123F00200008000062098407A0000005070100 -> create PTSE file with FID 0x2000 and space for 8 AIDs\n"
|
||||||
"hf cipurse create -d 92002438613F010A050200004040FF021009021009621084054144204631D407A0000005070100A00F28"
|
"hf cipurse create -d 92002438613F010A050200004040FF021009021009621084054144204631D407A0000005070100A00F28"
|
||||||
"73737373737373737373737373737373015FD67B000102030405060708090A0B0C0D0E0F01C6A13B -> create default file with FID 3F01 and 2 keys\n"
|
"73737373737373737373737373737373015FD67B000102030405060708090A0B0C0D0E0F01C6A13B -> create default file with FID 3F01 and 2 keys\n"
|
||||||
"hf cipurse create --aid 4144204631 -d 92010C010001020030020000FFFFFF -> create 0x0102 binary data EF under application 4144204631\n");
|
"hf cipurse create --aid 4144204631 -d 92010C010001020030020000FFFFFF -> create 0x0102 binary data EF under application 4144204631\n");
|
||||||
|
|
||||||
void *argtable[] = {
|
void *argtable[] = {
|
||||||
|
@ -1208,9 +1208,9 @@ static int CmdHFCipurseCreateDGI(const char *Cmd) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
if (!noauth)
|
if (!noauth)
|
||||||
PrintAndLogEx(INFO, "key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
PrintAndLogEx(INFO, "key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
||||||
, keyId
|
, keyId
|
||||||
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noauth) {
|
if (!noauth) {
|
||||||
|
@ -1228,8 +1228,8 @@ static int CmdHFCipurseCreateDGI(const char *Cmd) {
|
||||||
|
|
||||||
res = CIPURSECreateFile(hdata, hdatalen, buf, sizeof(buf), &len, &sw);
|
res = CIPURSECreateFile(hdata, hdatalen, buf, sizeof(buf), &len, &sw);
|
||||||
if (res != 0 || sw != 0x9000) {
|
if (res != 0 || sw != 0x9000) {
|
||||||
PrintAndLogEx(ERR, "Create file command " _RED_("ERROR") ". Card returns:\n 0x%04x - %s", sw,
|
PrintAndLogEx(ERR, "Create file command " _RED_("ERROR") ". Card returns:\n 0x%04x - %s", sw,
|
||||||
GetSpecificAPDUCodeDesc(SelectAPDUCodeDescriptions, ARRAYLEN(SelectAPDUCodeDescriptions), sw));
|
GetSpecificAPDUCodeDesc(SelectAPDUCodeDescriptions, ARRAYLEN(SelectAPDUCodeDescriptions), sw));
|
||||||
DropField();
|
DropField();
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
@ -1282,7 +1282,7 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
|
||||||
CipurseChannelSecurityLevel sreq = CPSMACed;
|
CipurseChannelSecurityLevel sreq = CPSMACed;
|
||||||
CipurseChannelSecurityLevel sresp = CPSMACed;
|
CipurseChannelSecurityLevel sresp = CPSMACed;
|
||||||
uint8_t key[CIPURSE_AES_KEY_LENGTH] = {0};
|
uint8_t key[CIPURSE_AES_KEY_LENGTH] = {0};
|
||||||
|
|
||||||
uint8_t aid[16] = {0};
|
uint8_t aid[16] = {0};
|
||||||
size_t aidLen = 0;
|
size_t aidLen = 0;
|
||||||
bool useAID = false;
|
bool useAID = false;
|
||||||
|
@ -1314,9 +1314,9 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
|
||||||
|
|
||||||
if (!noauth)
|
if (!noauth)
|
||||||
PrintAndLogEx(INFO, "key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
PrintAndLogEx(INFO, "key id " _YELLOW_("%d") " key " _YELLOW_("%s")
|
||||||
, keyId
|
, keyId
|
||||||
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
, sprint_hex(key, CIPURSE_AES_KEY_LENGTH)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t buf[APDU_RES_LEN] = {0};
|
uint8_t buf[APDU_RES_LEN] = {0};
|
||||||
|
@ -1331,7 +1331,7 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
res = CIPURSESelectMFEx(true, true, buf, sizeof(buf), &len, &sw);
|
res = CIPURSESelectMFEx(true, true, buf, sizeof(buf), &len, &sw);
|
||||||
if (res != 0 || sw != 0x9000) {
|
if (res != 0 || sw != 0x9000) {
|
||||||
PrintAndLogEx(ERR, "Cipurse masterfile select " _RED_("error") ". Card returns 0x%04x", sw);
|
PrintAndLogEx(ERR, "Cipurse masterfile select " _RED_("error") ". Card returns 0x%04x", sw);
|
||||||
DropField();
|
DropField();
|
||||||
|
@ -1355,8 +1355,8 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
|
||||||
if (useChildFID) {
|
if (useChildFID) {
|
||||||
res = CIPURSEDeleteFile(childFileId, buf, sizeof(buf), &len, &sw);
|
res = CIPURSEDeleteFile(childFileId, buf, sizeof(buf), &len, &sw);
|
||||||
if (res != 0 || sw != 0x9000) {
|
if (res != 0 || sw != 0x9000) {
|
||||||
PrintAndLogEx(ERR, "Delete child file " _CYAN_("%04x ") _RED_("ERROR") ". Card returns:\n 0x%04x - %s", childFileId, sw,
|
PrintAndLogEx(ERR, "Delete child file " _CYAN_("%04x ") _RED_("ERROR") ". Card returns:\n 0x%04x - %s", childFileId, sw,
|
||||||
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
|
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
|
||||||
DropField();
|
DropField();
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
@ -1364,8 +1364,8 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
|
||||||
} else if (useFID) {
|
} else if (useFID) {
|
||||||
res = CIPURSEDeleteFile(fileId, buf, sizeof(buf), &len, &sw);
|
res = CIPURSEDeleteFile(fileId, buf, sizeof(buf), &len, &sw);
|
||||||
if (res != 0 || sw != 0x9000) {
|
if (res != 0 || sw != 0x9000) {
|
||||||
PrintAndLogEx(ERR, "Delete file " _CYAN_("%04x ") _RED_("ERROR") ". Card returns:\n 0x%04x - %s", fileId, sw,
|
PrintAndLogEx(ERR, "Delete file " _CYAN_("%04x ") _RED_("ERROR") ". Card returns:\n 0x%04x - %s", fileId, sw,
|
||||||
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
|
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
|
||||||
DropField();
|
DropField();
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
@ -1373,10 +1373,10 @@ static int CmdHFCipurseDeleteFile(const char *Cmd) {
|
||||||
} else {
|
} else {
|
||||||
res = CIPURSEDeleteFileAID(aid, aidLen, buf, sizeof(buf), &len, &sw);
|
res = CIPURSEDeleteFileAID(aid, aidLen, buf, sizeof(buf), &len, &sw);
|
||||||
if (res != 0 || sw != 0x9000) {
|
if (res != 0 || sw != 0x9000) {
|
||||||
PrintAndLogEx(ERR, "Delete application " _CYAN_("%s ") _RED_("ERROR") ". Card returns:\n 0x%04x - %s",
|
PrintAndLogEx(ERR, "Delete application " _CYAN_("%s ") _RED_("ERROR") ". Card returns:\n 0x%04x - %s",
|
||||||
sprint_hex_inrow(aid, aidLen),
|
sprint_hex_inrow(aid, aidLen),
|
||||||
sw,
|
sw,
|
||||||
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
|
GetSpecificAPDUCodeDesc(DeleteAPDUCodeDescriptions, ARRAYLEN(DeleteAPDUCodeDescriptions), sw));
|
||||||
DropField();
|
DropField();
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
@ -1464,14 +1464,13 @@ static int CmdHFCipurseDefault(const char *Cmd) {
|
||||||
|
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "------------------- " _CYAN_("Default parameters") " -------------------");
|
PrintAndLogEx(INFO, "------------------- " _CYAN_("Default parameters") " -------------------");
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Key ID : %d", defaultKeyId);
|
PrintAndLogEx(INFO, "Key ID : %d", defaultKeyId);
|
||||||
PrintAndLogEx(INFO, "Key : %s", sprint_hex(defaultKey, sizeof(defaultKey)));
|
PrintAndLogEx(INFO, "Key : %s", sprint_hex(defaultKey, sizeof(defaultKey)));
|
||||||
PrintAndLogEx(INFO, "AID : %s", sprint_hex(defaultAID, defaultAIDLength));
|
PrintAndLogEx(INFO, "AID : %s", sprint_hex(defaultAID, defaultAIDLength));
|
||||||
PrintAndLogEx(INFO, "File ID: 0x%04x", defaultFileId);
|
PrintAndLogEx(INFO, "File ID: 0x%04x", defaultFileId);
|
||||||
|
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -467,7 +467,7 @@ static void emv_tag_dump_bitmask(const struct tlv *tlv, const struct emv_tag *ta
|
||||||
unsigned char val = tlv->value[byte - 1];
|
unsigned char val = tlv->value[byte - 1];
|
||||||
PrintAndLogEx(INFO, "%*s" NOLF, (level * 4), " ");
|
PrintAndLogEx(INFO, "%*s" NOLF, (level * 4), " ");
|
||||||
PrintAndLogEx(NORMAL, " Byte %u (%02x)", byte, val);
|
PrintAndLogEx(NORMAL, " Byte %u (%02x)", byte, val);
|
||||||
|
|
||||||
for (bit = 8; bit > 0; bit--, val <<= 1) {
|
for (bit = 8; bit > 0; bit--, val <<= 1) {
|
||||||
if (val & 0x80) {
|
if (val & 0x80) {
|
||||||
PrintAndLogEx(INFO, "%*s" NOLF, (level * 4), " ");
|
PrintAndLogEx(INFO, "%*s" NOLF, (level * 4), " ");
|
||||||
|
@ -491,7 +491,7 @@ static void emv_tag_dump_dol(const struct tlv *tlv, const struct emv_tag *tag, i
|
||||||
const struct emv_tag *doltag;
|
const struct emv_tag *doltag;
|
||||||
|
|
||||||
if (!tlv_parse_tl(&buf, &left, &doltlv)) {
|
if (!tlv_parse_tl(&buf, &left, &doltlv)) {
|
||||||
PrintAndLogEx(INFO, "%*sInvalid Tag-Len" , (level * 4), " ");
|
PrintAndLogEx(INFO, "%*sInvalid Tag-Len", (level * 4), " ");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ static uint32_t emv_get_binary(const unsigned char *S) {
|
||||||
// https://github.com/binaryfoo/emv-bertlv/blob/master/src/main/resources/fields/visa-cvr.txt
|
// https://github.com/binaryfoo/emv-bertlv/blob/master/src/main/resources/fields/visa-cvr.txt
|
||||||
static void emv_tag_dump_cvr(const struct tlv *tlv, const struct emv_tag *tag, int level) {
|
static void emv_tag_dump_cvr(const struct tlv *tlv, const struct emv_tag *tag, int level) {
|
||||||
if (tlv == NULL || tlv->len < 1) {
|
if (tlv == NULL || tlv->len < 1) {
|
||||||
PrintAndLogEx(INFO, "%*s INVALID length!" , (level * 4), " ");
|
PrintAndLogEx(INFO, "%*s INVALID length!", (level * 4), " ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1693,7 +1693,10 @@
|
||||||
"command": "hf cipurse aread",
|
"command": "hf cipurse aread",
|
||||||
"description": "read file attributes by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
|
"description": "read file attributes by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf cipurse aread --fid 2ff7 -> authenticate with keyid 1, read file attributes with id 2ff7",
|
"hf cipurse aread --fid 2ff7 -> select mf, authenticate with keyid 1, read file attributes with id 2ff7",
|
||||||
|
"hf cipurse aread --mfd -> read file attributes for master file (mf)",
|
||||||
|
"hf cipurse aread --chfid 0102 -> read file 0102 attributes in the default application",
|
||||||
|
"hf cipurse aread --aid 4144204632 --chfid 0102 -> read file 0102 attributes in the 4144204632 application",
|
||||||
"hf cipurse aread -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2, read file attributes"
|
"hf cipurse aread -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2, read file attributes"
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
|
@ -1703,14 +1706,15 @@
|
||||||
"-v, --verbose show technical data",
|
"-v, --verbose show technical data",
|
||||||
"-n <dec> key id",
|
"-n <dec> key id",
|
||||||
"-k, --key <hex> auth key",
|
"-k, --key <hex> auth key",
|
||||||
|
"--mfd show info about master file",
|
||||||
|
"--aid <hex 1..16 bytes> select application id (aid)",
|
||||||
"--fid <hex> file id",
|
"--fid <hex> file id",
|
||||||
|
"--chfid <hex 2 bytes> child file id (ef under application/master file)",
|
||||||
"--noauth read file attributes without authentication",
|
"--noauth read file attributes without authentication",
|
||||||
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
||||||
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
|
"--sresp <plain|mac(default)|encode> communication picc-reader security level"
|
||||||
"--sel-adf show info about adf itself",
|
|
||||||
"--sel-mf show info about master file"
|
|
||||||
],
|
],
|
||||||
"usage": "hf cipurse aread [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [--sel-adf] [--sel-mf]"
|
"usage": "hf cipurse aread [-hav] [-n <dec>] [-k <hex>] [--mfd] [--aid <hex 1..16 bytes>] [--fid <hex>] [--chfid <hex 2 bytes>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>]"
|
||||||
},
|
},
|
||||||
"hf cipurse auth": {
|
"hf cipurse auth": {
|
||||||
"command": "hf cipurse auth",
|
"command": "hf cipurse auth",
|
||||||
|
@ -1724,33 +1728,22 @@
|
||||||
"-h, --help this help",
|
"-h, --help this help",
|
||||||
"-a, --apdu show apdu requests and responses",
|
"-a, --apdu show apdu requests and responses",
|
||||||
"-v, --verbose show technical data",
|
"-v, --verbose show technical data",
|
||||||
|
"--aid <hex 1..16 bytes> application id (aid)",
|
||||||
|
"--fid <hex 2 bytes> top file/application id (fid)",
|
||||||
|
"--mfd select masterfile by empty id",
|
||||||
"-n <dec> key id",
|
"-n <dec> key id",
|
||||||
"-k, --key <hex> auth key"
|
"-k, --key <hex> auth key"
|
||||||
],
|
],
|
||||||
"usage": "hf cipurse auth [-hav] [-n <dec>] [-k <hex>]"
|
"usage": "hf cipurse auth [-hav] [--aid <hex 1..16 bytes>] [--fid <hex 2 bytes>] [--mfd] [-n <dec>] [-k <hex>]"
|
||||||
},
|
},
|
||||||
"hf cipurse default": {
|
"hf cipurse awrite": {
|
||||||
"command": "hf cipurse default",
|
"command": "hf cipurse awrite",
|
||||||
"description": "set default parameters for access to cipurse card",
|
"description": "write file attributes by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf cipurse default -n 1 -k 65656565656565656565656565656565 --fid 2ff7 -> set key, key id and file id"
|
"hf cipurse awrite --fid 2ff7 -d 080000c1c1c1c1c1c1c1c1c1 -> write default file attributes with id 2ff7",
|
||||||
],
|
"hf cipurse awrite --mfd -d 080000ffffffffffffffffff86023232 --commit -> write file attributes for master file (mf)",
|
||||||
"offline": false,
|
"hf cipurse awrite --chfid 0102 -d 020000ffffff -> write file 0102 attributes in the default application to full access",
|
||||||
"options": [
|
"hf cipurse awrite --chfid 0102 -d 02000040ffff -> write file 0102 attributes in the default application to full access with keys 1 and 2"
|
||||||
"-h, --help this help",
|
|
||||||
"--clear resets to defaults",
|
|
||||||
"-n <dec> key id",
|
|
||||||
"-k, --key <hex> authentication key",
|
|
||||||
"--fid <hex> file id"
|
|
||||||
],
|
|
||||||
"usage": "hf cipurse default [-h] [--clear] [-n <dec>] [-k <hex>] [--fid <hex>]"
|
|
||||||
},
|
|
||||||
"hf cipurse delete": {
|
|
||||||
"command": "hf cipurse delete",
|
|
||||||
"description": "read file by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
|
|
||||||
"notes": [
|
|
||||||
"hf cipurse delete --fid 2ff7 -> authenticate with keyid 1, delete file with id 2ff7",
|
|
||||||
"hf cipurse delete -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and delete file"
|
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
|
@ -1759,11 +1752,109 @@
|
||||||
"-v, --verbose show technical data",
|
"-v, --verbose show technical data",
|
||||||
"-n <dec> key id",
|
"-n <dec> key id",
|
||||||
"-k, --key <hex> auth key",
|
"-k, --key <hex> auth key",
|
||||||
|
"--mfd show info about master file",
|
||||||
|
"--aid <hex 1..16 bytes> select application id (aid)",
|
||||||
"--fid <hex> file id",
|
"--fid <hex> file id",
|
||||||
|
"--chfid <hex 2 bytes> child file id (ef under application/master file)",
|
||||||
|
"--noauth read file attributes without authentication",
|
||||||
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
||||||
"--sresp <plain|mac(default)|encode> communication picc-reader security level"
|
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
|
||||||
|
"-d, --data <hex> file attributes",
|
||||||
|
"--commit need commit after write"
|
||||||
],
|
],
|
||||||
"usage": "hf cipurse delete [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>]"
|
"usage": "hf cipurse awrite [-hav] [-n <dec>] [-k <hex>] [--mfd] [--aid <hex 1..16 bytes>] [--fid <hex>] [--chfid <hex 2 bytes>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [-d <hex>] [--commit]"
|
||||||
|
},
|
||||||
|
"hf cipurse create": {
|
||||||
|
"command": "hf cipurse create",
|
||||||
|
"description": "create application/file/key by provide appropriate dgi. if no key is supplied, default key of 737373...7373 will be used",
|
||||||
|
"notes": [
|
||||||
|
"hf cipurse create -d 9200123f00200008000062098407a0000005070100 -> create ptse file with fid 0x2000 and space for 8 aids",
|
||||||
|
"hf cipurse create -d 92002438613f010a050200004040ff021009021009621084054144204631d407a0000005070100a00f2873737373737373737373737373737373015fd67b000102030405060708090a0b0c0d0e0f01c6a13b -> create default file with fid 3f01 and 2 keys",
|
||||||
|
"hf cipurse create --aid 4144204631 -d 92010c010001020030020000ffffff -> create 0x0102 binary data ef under application 4144204631"
|
||||||
|
],
|
||||||
|
"offline": false,
|
||||||
|
"options": [
|
||||||
|
"-h, --help this help",
|
||||||
|
"-a, --apdu show apdu requests and responses",
|
||||||
|
"-v, --verbose show technical data",
|
||||||
|
"-n <dec> key id",
|
||||||
|
"-k, --key <hex> auth key",
|
||||||
|
"--aid <hex 1..16 bytes> application id (aid)",
|
||||||
|
"--fid <hex 2 bytes> file id (fid)",
|
||||||
|
"--mfd select masterfile by empty id",
|
||||||
|
"-d, --data <hex> data with dgi for create",
|
||||||
|
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
||||||
|
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
|
||||||
|
"--no-auth execute without authentication",
|
||||||
|
"--commit need commit after create"
|
||||||
|
],
|
||||||
|
"usage": "hf cipurse create [-hav] [-n <dec>] [-k <hex>] [--aid <hex 1..16 bytes>] [--fid <hex 2 bytes>] [--mfd] [-d <hex>] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [--no-auth] [--commit]"
|
||||||
|
},
|
||||||
|
"hf cipurse default": {
|
||||||
|
"command": "hf cipurse default",
|
||||||
|
"description": "set default parameters for access to cipurse card",
|
||||||
|
"notes": [
|
||||||
|
"hf cipurse default --reset -> reset parameters to default",
|
||||||
|
"hf cipurse default -n 1 -k 65656565656565656565656565656565 --fid 2ff7 -> set key, key id and file id",
|
||||||
|
"hf cipurse default --aid 4144204632 -> set default application id"
|
||||||
|
],
|
||||||
|
"offline": false,
|
||||||
|
"options": [
|
||||||
|
"-h, --help this help",
|
||||||
|
"--clear resets to defaults",
|
||||||
|
"-n <dec> key id",
|
||||||
|
"-k, --key <hex> authentication key",
|
||||||
|
"--aid <hex 1..16 bytes> application id (aid)",
|
||||||
|
"--fid <hex 2 bytes> file id"
|
||||||
|
],
|
||||||
|
"usage": "hf cipurse default [-h] [--clear] [-n <dec>] [-k <hex>] [--aid <hex 1..16 bytes>] [--fid <hex 2 bytes>]"
|
||||||
|
},
|
||||||
|
"hf cipurse delete": {
|
||||||
|
"command": "hf cipurse delete",
|
||||||
|
"description": "delete file by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
|
||||||
|
"notes": [
|
||||||
|
"hf cipurse delete --fid 2ff7 -> authenticate with keyid 1, delete file with id 2ff7 at top level",
|
||||||
|
"hf cipurse delete -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and delete file",
|
||||||
|
"hf cipurse delete --aid a0000005070100 --no-auth -> delete ptse file with aid a0000005070100 without authentication",
|
||||||
|
"hf cipurse delete --aid 4144204631 --chfid 0102 -> delete ef with fid 0x0102 under default application"
|
||||||
|
],
|
||||||
|
"offline": false,
|
||||||
|
"options": [
|
||||||
|
"-h, --help this help",
|
||||||
|
"-a, --apdu show apdu requests and responses",
|
||||||
|
"-v, --verbose show technical data",
|
||||||
|
"-n <dec> key id",
|
||||||
|
"-k, --key <hex> auth key",
|
||||||
|
"--fid <hex> file/application id under mf for delete",
|
||||||
|
"--aid <hex 1..16 bytes> application id (aid) for delete",
|
||||||
|
"--chfid <hex 2 bytes> child file id (ef under application/master file)",
|
||||||
|
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
||||||
|
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
|
||||||
|
"--no-auth execute without authentication",
|
||||||
|
"--commit commit"
|
||||||
|
],
|
||||||
|
"usage": "hf cipurse delete [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [--aid <hex 1..16 bytes>] [--chfid <hex 2 bytes>] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [--no-auth] [--commit]"
|
||||||
|
},
|
||||||
|
"hf cipurse formatall": {
|
||||||
|
"command": "hf cipurse formatall",
|
||||||
|
"description": "format card. erases all the data at the card level!",
|
||||||
|
"notes": [
|
||||||
|
"hf cipurse formatall -> format card with default key",
|
||||||
|
"hf cipurse formatall -n 2 -k 65656565656565656565656565656565 -> format card with keyid 2",
|
||||||
|
"hf cipurse formatall --no-auth -> format card without authentication. works for card in perso state"
|
||||||
|
],
|
||||||
|
"offline": false,
|
||||||
|
"options": [
|
||||||
|
"-h, --help this help",
|
||||||
|
"-a, --apdu show apdu requests and responses",
|
||||||
|
"-v, --verbose show technical data",
|
||||||
|
"-n <dec> key id",
|
||||||
|
"-k, --key <hex> auth key",
|
||||||
|
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
||||||
|
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
|
||||||
|
"--no-auth execute without authentication"
|
||||||
|
],
|
||||||
|
"usage": "hf cipurse formatall [-hav] [-n <dec>] [-k <hex>] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [--no-auth]"
|
||||||
},
|
},
|
||||||
"hf cipurse help": {
|
"hf cipurse help": {
|
||||||
"command": "hf cipurse help",
|
"command": "hf cipurse help",
|
||||||
|
@ -1779,10 +1870,11 @@
|
||||||
},
|
},
|
||||||
"hf cipurse read": {
|
"hf cipurse read": {
|
||||||
"command": "hf cipurse read",
|
"command": "hf cipurse read",
|
||||||
"description": "read file by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
|
"description": "read file in the application by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf cipurse read --fid 2ff7 -> authenticate with keyid 1, read file with id 2ff7",
|
"hf cipurse read --fid 2ff7 -> authenticate with keyid 1, read file with id 2ff7",
|
||||||
"hf cipurse read -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and read file"
|
"hf cipurse read -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and read file",
|
||||||
|
"hf cipurse read --aid 4144204631 --fid 0102 -> read file with id 0102 from application 4144204631"
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
|
@ -1791,13 +1883,36 @@
|
||||||
"-v, --verbose show technical data",
|
"-v, --verbose show technical data",
|
||||||
"-n <dec> key id",
|
"-n <dec> key id",
|
||||||
"-k, --key <hex> auth key",
|
"-k, --key <hex> auth key",
|
||||||
|
"--aid <hex 1..16 bytes> application id (aid)",
|
||||||
"--fid <hex> file id",
|
"--fid <hex> file id",
|
||||||
"-o, --offset <dec> offset for reading data from file",
|
"-o, --offset <dec> offset for reading data from file",
|
||||||
"--noauth read file without authentication",
|
"--noauth read file without authentication",
|
||||||
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
||||||
"--sresp <plain|mac(default)|encode> communication picc-reader security level"
|
"--sresp <plain|mac(default)|encode> communication picc-reader security level"
|
||||||
],
|
],
|
||||||
"usage": "hf cipurse read [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [-o <dec>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>]"
|
"usage": "hf cipurse read [-hav] [-n <dec>] [-k <hex>] [--aid <hex 1..16 bytes>] [--fid <hex>] [-o <dec>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>]"
|
||||||
|
},
|
||||||
|
"hf cipurse select": {
|
||||||
|
"command": "hf cipurse select",
|
||||||
|
"description": "select application or file",
|
||||||
|
"notes": [
|
||||||
|
"hf cipurse select --aid a0000005070100 -> select ptse application by aid",
|
||||||
|
"hf cipurse select --fid 3f00 -> select master file by fid 3f00",
|
||||||
|
"hf cipurse select --fid 2ff7 -> select attribute file by fid 2ff7",
|
||||||
|
"hf cipurse select --mfd -vt -> select default file by empty fid and show response data in plain and tlv decoded format"
|
||||||
|
],
|
||||||
|
"offline": false,
|
||||||
|
"options": [
|
||||||
|
"-h, --help this help",
|
||||||
|
"-a, --apdu show apdu requests and responses",
|
||||||
|
"-v, --verbose show technical data",
|
||||||
|
"-t, --tlv tlv decode returned data",
|
||||||
|
"--aid <hex 1..16 bytes> application id (aid)",
|
||||||
|
"--fid <hex 2 bytes> top level file (or application) id (fid)",
|
||||||
|
"--mfd select masterfile by empty id",
|
||||||
|
"--chfid <hex 2 bytes> child file id (ef under application/master file)"
|
||||||
|
],
|
||||||
|
"usage": "hf cipurse select [-havt] [--aid <hex 1..16 bytes>] [--fid <hex 2 bytes>] [--mfd] [--chfid <hex 2 bytes>]"
|
||||||
},
|
},
|
||||||
"hf cipurse test": {
|
"hf cipurse test": {
|
||||||
"command": "hf cipurse test",
|
"command": "hf cipurse test",
|
||||||
|
@ -1816,10 +1931,12 @@
|
||||||
},
|
},
|
||||||
"hf cipurse write": {
|
"hf cipurse write": {
|
||||||
"command": "hf cipurse write",
|
"command": "hf cipurse write",
|
||||||
"description": "write file by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
|
"description": "write file in the application by file id with key id and key. if no key is supplied, default key of 737373...7373 will be used",
|
||||||
"notes": [
|
"notes": [
|
||||||
"hf cipurse write --fid 2ff7 -> authenticate with keyid 1, write file with id 2ff7",
|
"hf cipurse write --fid 2ff7 -d aabb -> authenticate with keyid 1, write file with id 2ff7",
|
||||||
"hf cipurse write -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -> authenticate keyid 2 and write file"
|
"hf cipurse write -n 2 -k 65656565656565656565656565656565 --fid 2ff7 -d aabb -> authenticate keyid 2 and write file",
|
||||||
|
"hf cipurse write --aid 4144204631 --fid 0102 -d aabb -> write file with id 0102 in the 4144204631 application",
|
||||||
|
"hf cipurse write --fid 0102 -d aabb --commit -> write file with id 0102 and perform commit after write"
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
|
@ -1828,14 +1945,16 @@
|
||||||
"-v, --verbose show technical data",
|
"-v, --verbose show technical data",
|
||||||
"-n <dec> key id",
|
"-n <dec> key id",
|
||||||
"-k, --key <hex> auth key",
|
"-k, --key <hex> auth key",
|
||||||
|
"--aid <hex 1..16 bytes> application id (aid)",
|
||||||
"--fid <hex> file id",
|
"--fid <hex> file id",
|
||||||
"-o, --offset <dec> offset for reading data from file",
|
"-o, --offset <dec> offset for reading data from file",
|
||||||
"--noauth read file without authentication",
|
"--noauth read file without authentication",
|
||||||
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
"--sreq <plain|mac(default)|encode> communication reader-picc security level",
|
||||||
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
|
"--sresp <plain|mac(default)|encode> communication picc-reader security level",
|
||||||
"-d, --data <hex> hex data to write to new file"
|
"-d, --data <hex> hex data to write to new file",
|
||||||
|
"--commit need commit after write"
|
||||||
],
|
],
|
||||||
"usage": "hf cipurse write [-hav] [-n <dec>] [-k <hex>] [--fid <hex>] [-o <dec>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [-d <hex>]"
|
"usage": "hf cipurse write [-hav] [-n <dec>] [-k <hex>] [--aid <hex 1..16 bytes>] [--fid <hex>] [-o <dec>] [--noauth] [--sreq <plain|mac(default)|encode>] [--sresp <plain|mac(default)|encode>] [-d <hex>] [--commit]"
|
||||||
},
|
},
|
||||||
"hf emrtd help": {
|
"hf emrtd help": {
|
||||||
"command": "hf emrtd help",
|
"command": "hf emrtd help",
|
||||||
|
@ -4130,19 +4249,19 @@
|
||||||
"-h, --help this help",
|
"-h, --help this help",
|
||||||
"-a, --apdu show apdu requests and responses",
|
"-a, --apdu show apdu requests and responses",
|
||||||
"-v, --verbose show technical data",
|
"-v, --verbose show technical data",
|
||||||
"-n, --keyno <keyno> key number",
|
"-n, --keyno <dec> key number",
|
||||||
"-t, --algo <des/2tdea/3tdea/aes> crypt algo: des, 2tdea, 3tdea, aes",
|
"-t, --algo <des|2tdea|3tdea|aes> crypt algo: des, 2tdea, 3tdea, aes",
|
||||||
"-k, --key <key> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
|
"-k, --key <hex> key for authenticate (hex 8(des), 16(2tdea or aes) or 24(3tdea) bytes)",
|
||||||
"-f, --kdf <none/an10922/gallagher> key derivation function (kdf): none, an10922, gallagher",
|
"-f, --kdf <none|an10922|gallagher> key derivation function (kdf): none, an10922, gallagher",
|
||||||
"-i, --kdfi <kdfi> kdf input (hex 1-31 bytes)",
|
"-i, --kdfi <hex> kdf input (hex 1-31 bytes)",
|
||||||
"-m, --cmode <plain/mac/encrypt> communicaton mode: plain/mac/encrypt",
|
"-m, --cmode <plain|mac|encrypt> communicaton mode: plain/mac/encrypt",
|
||||||
"-c, --ccset <native/niso/iso> communicaton command set: native/niso/iso",
|
"-c, --ccset <native|niso|iso> communicaton command set: native/niso/iso",
|
||||||
"-s, --schann <d40/ev1/ev2/lrp> secure channel: d40/ev1/ev2/lrp",
|
"-s, --schann <d40|ev1|ev2|lrp> secure channel: d40/ev1/ev2/lrp",
|
||||||
"--aid <app id hex> application id of application for some parameters (3 hex bytes, big endian)",
|
"--aid <hex> application id of application for some parameters (3 hex bytes, big endian)",
|
||||||
"--appisoid <isoid hex> application iso id (iso df id) (2 hex bytes, big endian).",
|
"--appisoid <hex> application iso id (iso df id) (2 hex bytes, big endian).",
|
||||||
"--save saves channels parameters to defaults if authentication succeeds"
|
"--save saves channels parameters to defaults if authentication succeeds"
|
||||||
],
|
],
|
||||||
"usage": "hf mfdes auth [-hav] [-n <keyno>] [-t <des/2tdea/3tdea/aes>] [-k <key>] [-f <none/an10922/gallagher>] [-i <kdfi>] [-m <plain/mac/encrypt>] [-c <native/niso/iso>] [-s <d40/ev1/ev2/lrp>] [--aid <app id hex>] [--appisoid <isoid hex>] [--save]"
|
"usage": "hf mfdes auth [-hav] [-n <dec>] [-t <des|2tdea|3tdea|aes>] [-k <hex>] [-f <none|an10922|gallagher>] [-i <hex>] [-m <plain|mac|encrypt>] [-c <native|niso|iso>] [-s <d40|ev1|ev2|lrp>] [--aid <hex>] [--appisoid <hex>] [--save]"
|
||||||
},
|
},
|
||||||
"hf mfdes bruteaid": {
|
"hf mfdes bruteaid": {
|
||||||
"command": "hf mfdes bruteaid",
|
"command": "hf mfdes bruteaid",
|
||||||
|
@ -8328,6 +8447,7 @@
|
||||||
"description": "clone a farpointe/pyramid tag to a t55x7, q5/t5555 or em4305/4469 tag. the facility-code is 8-bit and the card number is 16-bit. larger values are truncated. currently only works on 26bit",
|
"description": "clone a farpointe/pyramid tag to a t55x7, q5/t5555 or em4305/4469 tag. the facility-code is 8-bit and the card number is 16-bit. larger values are truncated. currently only works on 26bit",
|
||||||
"notes": [
|
"notes": [
|
||||||
"lf pyramid clone --fc 123 --cn 11223",
|
"lf pyramid clone --fc 123 --cn 11223",
|
||||||
|
"lf pyramid clone --raw 0001010101010101010440013223921c",
|
||||||
"lf pyramid clone --fc 123 --cn 11223 --q5 -> encode for q5/t5555 tag",
|
"lf pyramid clone --fc 123 --cn 11223 --q5 -> encode for q5/t5555 tag",
|
||||||
"lf pyramid clone --fc 123 --cn 11223 --em -> encode for em4305/4469"
|
"lf pyramid clone --fc 123 --cn 11223 --em -> encode for em4305/4469"
|
||||||
],
|
],
|
||||||
|
@ -8337,9 +8457,10 @@
|
||||||
"--fc <dec> 8-bit value facility code",
|
"--fc <dec> 8-bit value facility code",
|
||||||
"--cn <dec> 16-bit value card number",
|
"--cn <dec> 16-bit value card number",
|
||||||
"--q5 optional - specify writing to q5/t5555 tag",
|
"--q5 optional - specify writing to q5/t5555 tag",
|
||||||
"--em optional - specify writing to em4305/4469 tag"
|
"--em optional - specify writing to em4305/4469 tag",
|
||||||
|
"-r, --raw <hex> raw hex data. 16 bytes"
|
||||||
],
|
],
|
||||||
"usage": "lf pyramid clone [-h] --fc <dec> --cn <dec> [--q5] [--em]"
|
"usage": "lf pyramid clone [-h] [--fc <dec>] [--cn <dec>] [--q5] [--em] [-r <hex>]"
|
||||||
},
|
},
|
||||||
"lf pyramid help": {
|
"lf pyramid help": {
|
||||||
"command": "lf pyramid help",
|
"command": "lf pyramid help",
|
||||||
|
@ -8370,15 +8491,17 @@
|
||||||
"command": "lf pyramid sim",
|
"command": "lf pyramid sim",
|
||||||
"description": "enables simulation of farpointe/pyramid card with specified card number. simulation runs until the button is pressed or another usb command is issued. the facility-code is 8-bit and the card number is 16-bit. larger values are truncated. currently work only on 26bit",
|
"description": "enables simulation of farpointe/pyramid card with specified card number. simulation runs until the button is pressed or another usb command is issued. the facility-code is 8-bit and the card number is 16-bit. larger values are truncated. currently work only on 26bit",
|
||||||
"notes": [
|
"notes": [
|
||||||
"lf pyramid sim --fc 123 --cn 1337"
|
"lf pyramid sim --fc 123 --cn 1337",
|
||||||
|
"lf pyramid clone --raw 0001010101010101010440013223921c"
|
||||||
],
|
],
|
||||||
"offline": false,
|
"offline": false,
|
||||||
"options": [
|
"options": [
|
||||||
"-h, --help this help",
|
"-h, --help this help",
|
||||||
"--fc <dec> 8-bit value facility code",
|
"--fc <dec> 8-bit value facility code",
|
||||||
"--cn <dec> 16-bit value card number"
|
"--cn <dec> 16-bit value card number",
|
||||||
|
"-r, --raw <hex> raw hex data. 16 bytes"
|
||||||
],
|
],
|
||||||
"usage": "lf pyramid sim [-h] --fc <dec> --cn <dec>"
|
"usage": "lf pyramid sim [-h] [--fc <dec>] [--cn <dec>] [-r <hex>]"
|
||||||
},
|
},
|
||||||
"lf read": {
|
"lf read": {
|
||||||
"command": "lf read",
|
"command": "lf read",
|
||||||
|
@ -9980,7 +10103,21 @@
|
||||||
},
|
},
|
||||||
"trace help": {
|
"trace help": {
|
||||||
"command": "trace help",
|
"command": "trace help",
|
||||||
"description": "help this help list list protocol data in trace buffer load load trace from file save save trace buffer to file --------------------------------------------------------------------------------------- trace list available offline: yes annotate trace buffer with selected protocol data you can load a trace from file (see `trace load -h`) or it be downloaded from device by default",
|
"description": "help this help extract extract authentication challenges found in trace list list protocol data in trace buffer load load trace from file save save trace buffer to file --------------------------------------------------------------------------------------- trace extract available offline: yes extracts protocol authentication challenges from trace buffer",
|
||||||
|
"notes": [
|
||||||
|
"trace extract",
|
||||||
|
"trace extract -1"
|
||||||
|
],
|
||||||
|
"offline": true,
|
||||||
|
"options": [
|
||||||
|
"-h, --help this help",
|
||||||
|
"-1, --buffer use data from trace buffer"
|
||||||
|
],
|
||||||
|
"usage": "trace extract [-h1]"
|
||||||
|
},
|
||||||
|
"trace list": {
|
||||||
|
"command": "trace list",
|
||||||
|
"description": "annotate trace buffer with selected protocol data you can load a trace from file (see `trace load -h`) or it be downloaded from device by default",
|
||||||
"notes": [
|
"notes": [
|
||||||
"trace list -t raw -> just show raw data without annotations",
|
"trace list -t raw -> just show raw data without annotations",
|
||||||
"",
|
"",
|
||||||
|
@ -10206,8 +10343,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 598,
|
"commands_extracted": 603,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"extracted_by": "PM3Help2JSON v1.00",
|
||||||
"extracted_on": "2022-01-23T19:02:27"
|
"extracted_on": "2022-02-04T13:37:03"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -243,10 +243,14 @@ Check column "offline" for their availability.
|
||||||
|------- |------- |-----------
|
|------- |------- |-----------
|
||||||
|`hf cipurse help `|Y |`This help.`
|
|`hf cipurse help `|Y |`This help.`
|
||||||
|`hf cipurse info `|N |`Get info about CIPURSE tag`
|
|`hf cipurse info `|N |`Get info about CIPURSE tag`
|
||||||
|
|`hf cipurse select `|N |`Select CIPURSE application or file`
|
||||||
|`hf cipurse auth `|N |`Authenticate CIPURSE tag`
|
|`hf cipurse auth `|N |`Authenticate CIPURSE tag`
|
||||||
|`hf cipurse read `|N |`Read binary file`
|
|`hf cipurse read `|N |`Read binary file`
|
||||||
|`hf cipurse write `|N |`Write binary file`
|
|`hf cipurse write `|N |`Write binary file`
|
||||||
|`hf cipurse aread `|N |`Read file attributes`
|
|`hf cipurse aread `|N |`Read file attributes`
|
||||||
|
|`hf cipurse awrite `|N |`Write file attributes`
|
||||||
|
|`hf cipurse formatall `|N |`Erase all the data from chip`
|
||||||
|
|`hf cipurse create `|N |`Create file, application, key via DGI record`
|
||||||
|`hf cipurse delete `|N |`Delete file`
|
|`hf cipurse delete `|N |`Delete file`
|
||||||
|`hf cipurse default `|N |`Set default key and file id for all the other commands`
|
|`hf cipurse default `|N |`Set default key and file id for all the other commands`
|
||||||
|`hf cipurse test `|Y |`Tests`
|
|`hf cipurse test `|Y |`Tests`
|
||||||
|
@ -1287,6 +1291,7 @@ Check column "offline" for their availability.
|
||||||
|command |offline |description
|
|command |offline |description
|
||||||
|------- |------- |-----------
|
|------- |------- |-----------
|
||||||
|`trace help `|Y |`This help`
|
|`trace help `|Y |`This help`
|
||||||
|
|`trace extract `|Y |`Extract authentication challenges found in trace`
|
||||||
|`trace list `|Y |`List protocol data in trace buffer`
|
|`trace list `|Y |`List protocol data in trace buffer`
|
||||||
|`trace load `|Y |`Load trace from file`
|
|`trace load `|Y |`Load trace from file`
|
||||||
|`trace save `|Y |`Save trace buffer to file`
|
|`trace save `|Y |`Save trace buffer to file`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue