mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-05 04:25:20 +08:00
minor fix when reading blocks
This commit is contained in:
parent
fc8c5cdd12
commit
ab6bf11f3f
1 changed files with 5 additions and 0 deletions
|
@ -531,12 +531,17 @@ bool hitag2_crypto(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen) {
|
||||||
} else {
|
} else {
|
||||||
// Failed reading a block, could be (read/write) locked, skip block and re-authenticate
|
// Failed reading a block, could be (read/write) locked, skip block and re-authenticate
|
||||||
if (blocknr == 1) {
|
if (blocknr == 1) {
|
||||||
|
// Write the low part of the key in memory
|
||||||
memcpy(tag.sectors[1],key+2,4);
|
memcpy(tag.sectors[1],key+2,4);
|
||||||
} else if (blocknr == 2) {
|
} else if (blocknr == 2) {
|
||||||
|
// Write the high part of the key in memory
|
||||||
tag.sectors[2][0] = 0x00;
|
tag.sectors[2][0] = 0x00;
|
||||||
tag.sectors[2][1] = 0x00;
|
tag.sectors[2][1] = 0x00;
|
||||||
tag.sectors[2][2] = key[0];
|
tag.sectors[2][2] = key[0];
|
||||||
tag.sectors[2][3] = key[1];
|
tag.sectors[2][3] = key[1];
|
||||||
|
} else {
|
||||||
|
// Just put zero's in the memory (of the unreadable block)
|
||||||
|
memset(tag.sectors[blocknr],0x00,4);
|
||||||
}
|
}
|
||||||
blocknr++;
|
blocknr++;
|
||||||
bCrypto = false;
|
bCrypto = false;
|
||||||
|
|
Loading…
Reference in a new issue