mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Fix hf mf chk
This commit is contained in:
parent
5ab9716e77
commit
13b2e6eed7
3 changed files with 28 additions and 18 deletions
|
@ -1529,7 +1529,12 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain, b
|
|||
uint64_t key = 0;
|
||||
uint32_t cuid = 0;
|
||||
int i, res;
|
||||
uint8_t cascade_levels = 0, isOK = 0;
|
||||
uint8_t cascade_levels = 0;
|
||||
struct {
|
||||
uint8_t key[6];
|
||||
bool found;
|
||||
} PACKED keyresult;
|
||||
keyresult.found = false;
|
||||
uint8_t blockNo, keyType, keyCount;
|
||||
bool clearTrace, have_uid = false;
|
||||
|
||||
|
@ -1595,19 +1600,19 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain, b
|
|||
|
||||
if (res)
|
||||
continue;
|
||||
|
||||
isOK = 1;
|
||||
memcpy(keyresult.key, datain + i * 6, 6);
|
||||
keyresult.found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
LED_B_ON();
|
||||
|
||||
if (ng) {
|
||||
reply_ng(CMD_MIFARE_CHKKEYS, PM3_SUCCESS, datain + i * 6, 6);
|
||||
reply_ng(CMD_MIFARE_CHKKEYS, PM3_SUCCESS, (uint8_t*)&keyresult, sizeof(keyresult));
|
||||
} else {
|
||||
reply_mix(CMD_ACK, isOK, 0, 0, datain + i * 6, 6);
|
||||
reply_mix(CMD_ACK, keyresult.found, 0, 0, (uint8_t*)&keyresult.key, sizeof(keyresult.key));
|
||||
}
|
||||
// reply_old(CMD_ACK, isOK, 0, 0, datain + i * 6, 6);
|
||||
// reply_old(CMD_ACK, keyresult.found, 0, 0, (uint8_t*)&keyresult.key, sizeof(keyresult.key));
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
LEDsoff();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue