mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-14 03:03:14 +08:00
ADD: "HF MFU CRDBL", Started to add the password for reading blocks. Wasn't used before :(
This commit is contained in:
parent
251d07dbfb
commit
f1170fa79e
1 changed files with 30 additions and 9 deletions
|
@ -601,12 +601,16 @@ int CmdTestDES(const char * cmd)
|
||||||
//
|
//
|
||||||
int CmdHF14AMfUCRdBl(const char *Cmd)
|
int CmdHF14AMfUCRdBl(const char *Cmd)
|
||||||
{
|
{
|
||||||
|
bool hasPwd = FALSE;
|
||||||
uint8_t blockNo = -1;
|
uint8_t blockNo = -1;
|
||||||
|
unsigned char key[16];
|
||||||
char cmdp = param_getchar(Cmd, 0);
|
char cmdp = param_getchar(Cmd, 0);
|
||||||
|
|
||||||
if (strlen(Cmd) < 1 || cmdp == 'h' || cmdp == 'H') {
|
if (strlen(Cmd) < 1 || cmdp == 'h' || cmdp == 'H') {
|
||||||
PrintAndLog("Usage: hf mfu crdbl <block number>");
|
PrintAndLog("Usage: hf mfu crdbl <block number> <password>");
|
||||||
PrintAndLog(" sample: hf mfu crdbl 0");
|
PrintAndLog("");
|
||||||
|
PrintAndLog("sample: hf mfu crdbl 0");
|
||||||
|
PrintAndLog(" hf mfu crdbl 0 1122334455667788");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -621,15 +625,32 @@ int CmdHF14AMfUCRdBl(const char *Cmd)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLog("--block no: 0x%02X (%d)", (int)blockNo, blockNo);
|
// key
|
||||||
|
if ( strlen(Cmd) > 3){
|
||||||
|
if (param_gethex(Cmd, 1, key, 16)) {
|
||||||
|
PrintAndLog("Key must include %d HEX symbols", 16);
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
hasPwd = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( hasPwd )
|
||||||
|
PrintAndLog("--block no: 0x%02X (%d) PWD: %s", (int)blockNo, blockNo, key);
|
||||||
|
else
|
||||||
|
PrintAndLog("--block no: 0x%02X (%d)", (int)blockNo, blockNo);
|
||||||
|
|
||||||
//Read Block
|
//Read Block
|
||||||
UsbCommand e = {CMD_MIFAREU_READBL, {blockNo}};
|
UsbCommand c = {CMD_MIFAREU_READBL, {blockNo}};
|
||||||
SendCommand(&e);
|
if ( hasPwd ) {
|
||||||
UsbCommand resp_c;
|
c.arg[1] = 1;
|
||||||
if (WaitForResponseTimeout(CMD_ACK,&resp_c,1500)) {
|
memcpy(c.d.asBytes,key,16);
|
||||||
uint8_t isOK = resp_c.arg[0] & 0xff;
|
}
|
||||||
uint8_t *data = resp_c.d.asBytes;
|
SendCommand(&c);
|
||||||
|
UsbCommand resp;
|
||||||
|
if (WaitForResponseTimeout(CMD_ACK,&resp,1500)) {
|
||||||
|
uint8_t isOK = resp.arg[0] & 0xff;
|
||||||
|
uint8_t *data = resp.d.asBytes;
|
||||||
|
|
||||||
PrintAndLog("isOk: %02x", isOK);
|
PrintAndLog("isOk: %02x", isOK);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
|
|
Loading…
Reference in a new issue