mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 14:23:50 -07:00
Update cmdlfindala.c
25 But parity diz
This commit is contained in:
parent
8b520de838
commit
20a0713441
1 changed files with 17 additions and 2 deletions
|
@ -1136,6 +1136,7 @@ int getIndalaBits(uint8_t fc, uint16_t cn, uint8_t *bits) {
|
|||
bits[51] = ((cn >> 8) & 1); // b9 - c
|
||||
bits[46] = ((cn >> 7) & 1); // b8
|
||||
bits[33] = ((cn >> 6) & 1); // b7 - c
|
||||
// bits[61] = ((cn >> 6) & 1); // b7 - c
|
||||
bits[37] = ((cn >> 5) & 1); // b6 - c
|
||||
bits[54] = ((cn >> 4) & 1); // b5
|
||||
bits[56] = ((cn >> 3) & 1); // b4
|
||||
|
@ -1164,11 +1165,25 @@ int getIndalaBits(uint8_t fc, uint16_t cn, uint8_t *bits) {
|
|||
}
|
||||
|
||||
// add parity
|
||||
bits[34] = 1; // p1 64 - 30 = 34
|
||||
bits[38] = 1; // p2 68 - 30 = 38
|
||||
// bits[34] = 1; // p1 64 - 30 = 34
|
||||
// bits[38] = 1; // p2 68 - 30 = 38
|
||||
|
||||
// 92 = 62
|
||||
// 93 = 63
|
||||
|
||||
bits[34] = 0; // parity for odd bits
|
||||
bits[38] = 0; // parity for even bits
|
||||
uint8_t p1 = 1;
|
||||
uint8_t p2 = 1;
|
||||
|
||||
for (int i=33; i < 64; i++) {
|
||||
if (i%2)
|
||||
p1 ^= bits[i];
|
||||
else
|
||||
p2 ^= bits[i];
|
||||
}
|
||||
bits[34] = p1; // parity for odd bits
|
||||
bits[38] = p2; // parity for even bits
|
||||
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue