fix hf mf cload - now it allows for proper GDM ic to load mfc ev1 signature data. On uscuid ic which are more locked down it will failed with a message. Dont forget to enable signature for the gdm ic.
This commit is contained in:
1 parent
f0bdcf3838
commit
cb7109e751
4 files changed
+52
-13
No files matched your search
@@ -5498,6 +5498,7 @@ static int CmdHF14AMfCLoad(const char *Cmd) {
|
||||
|
||||
if (mf_chinese_set_block(blockno, data + (MFBLOCK_SIZE * blockno), NULL, flags)) {
|
||||
PrintAndLogEx(WARNING, "Can't set magic card block: %d", blockno);
|
||||
PrintAndLogEx(HINT, "Verify that it is a GDM and not USCUID deriviate");
|
||||
free(data);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
@@ -1211,16 +1211,27 @@ int mf_chinese_set_block(uint8_t blockNo, uint8_t *data, uint8_t *uid, uint8_t p
|
||||
SendCommandMIX(CMD_HF_MIFARE_CSETBL, params, blockNo, 0, data, MFBLOCK_SIZE);
|
||||
PacketResponseNG resp;
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 3500)) {
|
||||
uint8_t isOK = resp.oldarg[0] & 0xff;
|
||||
uint8_t isOK = resp.oldarg[0] & 0xFF;
|
||||
if (uid != NULL) {
|
||||
memcpy(uid, resp.data.asBytes, 4);
|
||||
}
|
||||
|
||||
if (!isOK) {
|
||||
|
||||
uint8_t reason = (resp.oldarg[1] & 0xFF);
|
||||
if ( reason == 4) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(WARNING, "GDM magic write signature block failed");
|
||||
} else if (reason == 5) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(WARNING, "Write block failed");
|
||||
}
|
||||
|
||||
return PM3_EUNDEF;
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(WARNING, "Command execution time out");
|
||||
return PM3_ETIMEOUT;
|
||||
}
|
||||
return PM3_SUCCESS;
|
||||
|
||||
Reference in new issue
Block a user