mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Fix: 'hf mf fchk' - now reports back correct found keys.
This commit is contained in:
parent
535d4e6ee9
commit
4ea05fc026
3 changed files with 25 additions and 18 deletions
|
@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
|
|||
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
|
||||
|
||||
## [unreleased][unreleased]
|
||||
- Fix 'hf mf fchk' (@iceman)
|
||||
- Fix 'usb slow on posix based systems' (@fl0-0)
|
||||
- Change 'lf pcf7931' - improved read code (@sguerrini97)
|
||||
- Change 'hf felica list' - started with some FeliCa annotations (@iceman)
|
||||
- Fix 'hf tune' - now works as expected (@iceman)
|
||||
|
|
|
@ -1259,7 +1259,6 @@ void MifareChkKeys_fast(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *da
|
|||
LED_A_ON();
|
||||
|
||||
if ( firstchunk ) {
|
||||
|
||||
clear_trace();
|
||||
set_tracing(false);
|
||||
|
||||
|
@ -1467,17 +1466,22 @@ OUT:
|
|||
if (foundkeys == allkeys || lastchunk ) {
|
||||
|
||||
uint64_t foo = 0;
|
||||
for (uint8_t m = 0; m < 64; m++) {
|
||||
foo |= ((uint64_t)(found[m] & 1) << m);
|
||||
}
|
||||
|
||||
uint16_t bar = 0;
|
||||
for (uint8_t m = 0; m < 64; ++m)
|
||||
foo |= (found[m] << m);
|
||||
for (uint8_t m=64; m < sizeof(found); ++m)
|
||||
bar |= (found[m] << (m-64));
|
||||
uint8_t j = 0;
|
||||
for (uint8_t m=64; m < sizeof(found); m++) {
|
||||
bar |= ((uint16_t)(found[m] & 1) << j++);
|
||||
}
|
||||
|
||||
uint8_t *tmp = BigBuf_malloc(480+10);
|
||||
memcpy(tmp, k_sector, sectorcnt * sizeof(sector_t) );
|
||||
num_to_bytes(foo, 8, tmp+480);
|
||||
tmp[488] = bar & 0xFF;
|
||||
tmp[489] = bar >> 8 & 0xFF;
|
||||
|
||||
cmd_send(CMD_ACK, foundkeys, 0, 0, tmp, 480+10);
|
||||
|
||||
set_tracing(false);
|
||||
|
|
|
@ -173,18 +173,19 @@ int mfCheckKeys_fast( uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastChunk,
|
|||
|
||||
// success array. each byte is status of key
|
||||
uint8_t arr[80];
|
||||
uint64_t foo = bytes_to_num(resp.d.asBytes+480, 8);
|
||||
for (uint8_t i = 0; i < 64; ++i) {
|
||||
uint64_t foo = 0;
|
||||
uint16_t bar = 0;
|
||||
foo = bytes_to_num(resp.d.asBytes+480, 8);
|
||||
bar = (resp.d.asBytes[489] << 8 | resp.d.asBytes[488]);
|
||||
|
||||
for (uint8_t i = 0; i < 64; i++)
|
||||
arr[i] = (foo >> i) & 0x1;
|
||||
}
|
||||
foo = bytes_to_num(resp.d.asBytes+488, 2);
|
||||
for (uint8_t i = 0; i < 16; ++i) {
|
||||
arr[i+64] = (foo >> i) & 0x1;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < 16; i++)
|
||||
arr[i+64] = (bar >> i) & 0x1;
|
||||
|
||||
// initialize storage for found keys
|
||||
icesector_t *tmp = NULL;
|
||||
tmp = calloc(sectorsCnt, sizeof(icesector_t));
|
||||
icesector_t *tmp = calloc(sectorsCnt, sizeof(icesector_t));
|
||||
if (tmp == NULL)
|
||||
return 1;
|
||||
memcpy(tmp, resp.d.asBytes, sectorsCnt * sizeof(icesector_t) );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue