This commit is contained in:
iceman1001 2022-02-12 17:46:34 +01:00
parent f1d45b491c
commit ec59acf64c
9 changed files with 961 additions and 886 deletions

View file

@ -186,8 +186,7 @@ static void Wipe(void) {
static void Read(void) {
mode = 0;
while (low2 == 0 || mode == 0)
{
while (low2 == 0 || mode == 0) {
DbpString("Read");
LEDsoff();
LED_A_ON();
@ -202,9 +201,9 @@ static void Read(void) {
high = high2;
mode = 1;
#ifdef WITH_FLASH
#ifdef WITH_FLASH
SaveIDtoFlash(low2);
#endif
#endif
SpinDelay(50);
LED_C_ON();
@ -258,8 +257,7 @@ static void Validate(void) {
}
return;
}
else if (low2 != 0 || high2 != 0) {
} else if (low2 != 0 || high2 != 0) {
LEDsoff();
for (int i = 0; i < 3; i++) {
LED_A_ON();
@ -272,8 +270,7 @@ static void Validate(void) {
}
return;
}
else
} else
SpinDelay(200);
int b = BUTTON_HELD(200);

View file

@ -4998,7 +4998,7 @@ static int CmdHF14ADesWriteData(const char *Cmd) {
arg_lit0(NULL, "debit", "use for value file debit operation instead of credit"),
arg_lit0(NULL, "commit", "commit needs for backup file only. For the other file types and in the `auto` mode - command set it automatically"),
arg_int0(NULL, "updaterec", "<dec>", "Record number for update record command. Updates record instead of write. Lastest record - 0"),
arg_str0(NULL, "isoid" , "<hex>", "Application ISO ID (ISO DF ID) (2 hex bytes, big endian)"),
arg_str0(NULL, "isoid", "<hex>", "Application ISO ID (ISO DF ID) (2 hex bytes, big endian)"),
arg_str0(NULL, "fileisoid", "<hex>", "File ISO ID (ISO DF ID) (2 hex bytes, big endian). Works only for ISO write commands"),
arg_str0(NULL, "readerid", "<hex>", "reader id for CommitReaderID command. If present - the command issued before write command"),
arg_str0(NULL, "trkey", "<hex>", "key for decode previous reader id"),

View file

@ -2063,7 +2063,7 @@ void printMFUdumpEx(mfu_dump_t *card, uint16_t pages, uint8_t startpage) {
PrintAndLogEx(INFO, "Version..... " _YELLOW_("%s"), sprint_hex(card->version, sizeof(card->version)));
PrintAndLogEx(INFO, "TBD 0....... %s", sprint_hex(card->tbo, sizeof(card->tbo)));
PrintAndLogEx(INFO, "TBD 1....... %s", sprint_hex(card->tbo1, sizeof(card->tbo1)));
PrintAndLogEx(INFO, "Signature... %s", sprint_hex(card->signature, 16 ));
PrintAndLogEx(INFO, "Signature... %s", sprint_hex(card->signature, 16));
PrintAndLogEx(INFO, " %s", sprint_hex(card->signature + 16, sizeof(card->signature) - 16));
for (uint8_t i = 0; i < 3; i ++) {
PrintAndLogEx(INFO, "Counter %d... %s", i, sprint_hex(card->counter_tearing[i], 3));
@ -2589,7 +2589,7 @@ static int CmdHF14AMfURestore(const char *Cmd) {
if (pages - 1 != mem->pages) {
PrintAndLogEx(ERR, "Error, invalid dump, wrong page count");
PrintAndLogEx(INFO, " %u vs mempg %u", pages -1 , mem->pages);
PrintAndLogEx(INFO, " %u vs mempg %u", pages - 1, mem->pages);
free(dump);
return PM3_ESOFT;
}
@ -4152,7 +4152,7 @@ static int CmdHF14AMfuEView(const char *Cmd) {
return PM3_ETIMEOUT;
}
printMFUdumpEx( (mfu_dump_t *)dump, blocks, 0);
printMFUdumpEx((mfu_dump_t *)dump, blocks, 0);
free(dump);
return PM3_SUCCESS;
}
@ -4232,7 +4232,7 @@ static int CmdHF14AMfuView(const char *Cmd) {
PrintAndLogEx(INFO, "File size %zu bytes, file blocks %d (0x%x)", bytes_read, block_cnt, block_cnt);
}
printMFUdumpEx( (mfu_dump_t *)dump, block_cnt, 0);
printMFUdumpEx((mfu_dump_t *)dump, block_cnt, 0);
free(dump);
return PM3_SUCCESS;
}

View file

@ -1112,7 +1112,7 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz
if (!strcmp(ctype, "mfu")) {
mfu_dump_t* mem = (mfu_dump_t *)udata;
mfu_dump_t *mem = (mfu_dump_t *)udata;
JsonLoadBufAsHex(root, "$.Card.Version", mem->version, sizeof(mem->version), datalen);
JsonLoadBufAsHex(root, "$.Card.TBO_0", mem->tbo, sizeof(mem->tbo), datalen);

View file

@ -185,6 +185,8 @@ const static vocabulory_t vocabulory[] = {
{ 0, "hf cipurse formatall" },
{ 0, "hf cipurse create" },
{ 0, "hf cipurse delete" },
{ 0, "hf cipurse updkey" },
{ 0, "hf cipurse updakey" },
{ 0, "hf cipurse default" },
{ 1, "hf cipurse test" },
{ 1, "hf epa help" },
@ -348,6 +350,7 @@ const static vocabulory_t vocabulory[] = {
{ 0, "hf mfu ndefread" },
{ 0, "hf mfu rdbl" },
{ 0, "hf mfu restore" },
{ 1, "hf mfu view" },
{ 0, "hf mfu wrbl" },
{ 0, "hf mfu eload" },
{ 0, "hf mfu eview" },

File diff suppressed because it is too large Load diff

View file

@ -137,17 +137,17 @@ Check column "offline" for their availability.
|command |offline |description
|------- |------- |-----------
|`emv help `|Y |`This help`
|`emv exec `|N |`Executes EMV contactless transaction.`
|`emv pse `|N |`Execute PPSE. It selects 2PAY.SYS.DDF01 or 1PAY.SYS.DDF01 directory.`
|`emv search `|N |`Try to select all applets from applets list and print installed applets.`
|`emv select `|N |`Select applet.`
|`emv gpo `|N |`Execute GetProcessingOptions.`
|`emv readrec `|N |`Read files from card.`
|`emv genac `|N |`Generate ApplicationCryptogram.`
|`emv challenge `|N |`Generate challenge.`
|`emv intauth `|N |`Internal authentication.`
|`emv scan `|N |`Scan EMV card and save it contents to json file for emulator.`
|`emv test `|Y |`Crypto logic test.`
|`emv exec `|N |`Executes EMV contactless transaction`
|`emv pse `|N |`Execute PPSE. It selects 2PAY.SYS.DDF01 or 1PAY.SYS.DDF01 directory`
|`emv search `|N |`Try to select all applets from applets list and print installed applets`
|`emv select `|N |`Select applet`
|`emv gpo `|N |`Execute GetProcessingOptions`
|`emv readrec `|N |`Read files from card`
|`emv genac `|N |`Generate ApplicationCryptogram`
|`emv challenge `|N |`Generate challenge`
|`emv intauth `|N |`Internal authentication`
|`emv scan `|N |`Scan EMV card and save it contents to json file for emulator`
|`emv test `|Y |`Crypto logic test`
|`emv list `|Y |`List ISO7816 history`
|`emv roca `|N |`Extract public keys and run ROCA test`
@ -252,6 +252,8 @@ Check column "offline" for their availability.
|`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 updkey `|N |`Update key`
|`hf cipurse updakey `|N |`Update key attributes`
|`hf cipurse default `|N |`Set default key and file id for all the other commands`
|`hf cipurse test `|Y |`Tests`
@ -519,8 +521,9 @@ Check column "offline" for their availability.
|`hf mfu ndefread `|N |`Prints NDEF records from card`
|`hf mfu rdbl `|N |`Read block`
|`hf mfu restore `|N |`Restore a dump onto a MFU MAGIC tag`
|`hf mfu view `|Y |`Display content from tag dump file`
|`hf mfu wrbl `|N |`Write block`
|`hf mfu eload `|N |`load Ultralight .eml dump file into emulator memory`
|`hf mfu eload `|N |`Load Ultralight .eml dump file into emulator memory`
|`hf mfu eview `|N |`View emulator memory`
|`hf mfu sim `|N |`Simulate MIFARE Ultralight from emulator memory`
|`hf mfu setpwd `|N |`Set 3DES key - Ultralight-C`