mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-14 03:03:14 +08:00
CHG: syntax suger
This commit is contained in:
parent
41863885d0
commit
01c78dabc3
1 changed files with 1 additions and 2 deletions
|
@ -218,14 +218,13 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
int mfCheckKeys (uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keycnt, uint8_t * keyBlock, uint64_t * key){
|
int mfCheckKeys (uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keycnt, uint8_t * keyBlock, uint64_t * key){
|
||||||
|
|
||||||
*key = 0;
|
*key = 0;
|
||||||
UsbCommand c = {CMD_MIFARE_CHKKEYS, { (blockNo | (keyType<<8)), clear_trace, keycnt}};
|
UsbCommand c = {CMD_MIFARE_CHKKEYS, { (blockNo | (keyType<<8)), clear_trace, keycnt}};
|
||||||
memcpy(c.d.asBytes, keyBlock, 6 * keycnt);
|
memcpy(c.d.asBytes, keyBlock, 6 * keycnt);
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
UsbCommand resp;
|
UsbCommand resp;
|
||||||
if (!WaitForResponseTimeout(CMD_ACK,&resp, 2500)) return 1;
|
if (!WaitForResponseTimeout(CMD_ACK, &resp, 2500)) return 1;
|
||||||
if ((resp.arg[0] & 0xff) != 0x01) return 2;
|
if ((resp.arg[0] & 0xff) != 0x01) return 2;
|
||||||
*key = bytes_to_num(resp.d.asBytes, 6);
|
*key = bytes_to_num(resp.d.asBytes, 6);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue