mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Added Hitag2 reading tag memory in password mode
This commit is contained in:
parent
8de6b69d1e
commit
ed7bd3a380
1 changed files with 15 additions and 6 deletions
|
@ -450,6 +450,8 @@ static void hitag_reader_send_frame(const byte_t* frame, size_t frame_len)
|
||||||
LOW(GPIO_SSC_DOUT);
|
LOW(GPIO_SSC_DOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t blocknr;
|
||||||
|
|
||||||
bool hitag2_password(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen) {
|
bool hitag2_password(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen) {
|
||||||
// Reset the transmission frame length
|
// Reset the transmission frame length
|
||||||
*txlen = 0;
|
*txlen = 0;
|
||||||
|
@ -474,10 +476,16 @@ bool hitag2_password(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen)
|
||||||
memcpy(tx,password,4);
|
memcpy(tx,password,4);
|
||||||
bPwd = true;
|
bPwd = true;
|
||||||
} else {
|
} else {
|
||||||
DbpString("Password succesful!");
|
if (blocknr > 7) {
|
||||||
|
DbpString("Read succesful!");
|
||||||
// We are done... for now
|
// We are done... for now
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
*txlen = 10;
|
||||||
|
tx[0] = 0xc0 | (blocknr << 3) | ((blocknr^7) >> 2);
|
||||||
|
tx[1] = ((blocknr^7) << 6);
|
||||||
|
blocknr++;
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
// Unexpected response
|
// Unexpected response
|
||||||
|
@ -513,7 +521,7 @@ bool hitag2_authenticate(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txl
|
||||||
memcpy(tx,NrAr,8);
|
memcpy(tx,NrAr,8);
|
||||||
bCrypto = true;
|
bCrypto = true;
|
||||||
} else {
|
} else {
|
||||||
DbpString("Authentication succesful!");
|
DbpString("Read succesful!");
|
||||||
// We are done... for now
|
// We are done... for now
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -993,6 +1001,7 @@ void ReaderHitag(hitag_function htf, hitag_data* htd) {
|
||||||
case RHT2F_PASSWORD: {
|
case RHT2F_PASSWORD: {
|
||||||
Dbprintf("List identifier in password mode");
|
Dbprintf("List identifier in password mode");
|
||||||
memcpy(password,htd->pwd.password,4);
|
memcpy(password,htd->pwd.password,4);
|
||||||
|
blocknr = 0;
|
||||||
bQuitTraceFull = false;
|
bQuitTraceFull = false;
|
||||||
bQuiet = false;
|
bQuiet = false;
|
||||||
bPwd = false;
|
bPwd = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue