Merge pull request #2947 from andyshieh/fix-indala-clone-fc-cn

Fix getIndalaBits checksum logic
This commit is contained in:
Iceman 2025-07-28 15:17:57 +02:00 committed by GitHub
commit ec144c5198
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View file

@ -21,6 +21,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
- Changed `hf mfu sim` - now support UL-C simulation (@iceman1001) - Changed `hf mfu sim` - now support UL-C simulation (@iceman1001)
- Added `!` - run system commands from inside the client. Potentially dangerous if running client as SUDO, SU, ROOT (@iceman1001) - Added `!` - run system commands from inside the client. Potentially dangerous if running client as SUDO, SU, ROOT (@iceman1001)
- Implemented `hf felica scsvcode` - now dumps all service and area codes. (@zinongli) - Implemented `hf felica scsvcode` - now dumps all service and area codes. (@zinongli)
- Fixed `lf indala cone` - now writing the right bits when using `--fc` and `--cn`
## [Daddy Iceman.4.20469][2025-06-16] ## [Daddy Iceman.4.20469][2025-06-16]
- Fixed edge case in fm11rf08s key recovery tools (@doegox) - Fixed edge case in fm11rf08s key recovery tools (@doegox)

View file

@ -1163,21 +1163,21 @@ int getIndalaBits(uint8_t fc, uint16_t cn, uint8_t *bits) {
chk += ((cn >> 2) & 1); //y14 == 89 - 30 = 59 chk += ((cn >> 2) & 1); //y14 == 89 - 30 = 59
chk += (cn & 1); //y16 == 71 - 30 = 41 chk += (cn & 1); //y16 == 71 - 30 = 41
if ((chk & 1) == 0) { if ((chk & 1) == 0) { // If the sum is even, checksum is '10' (binary) = 2.
bits[62] = 0;
bits[63] = 1;
} else {
bits[62] = 1; bits[62] = 1;
bits[63] = 0; bits[63] = 0;
} else { // If the sum is odd, checksum is '01' (binary) = 1.
bits[62] = 0;
bits[63] = 1;
} }
// add parity // add parity
// bits[34] = 1; // p1 64 - 30 = 34 // bits[34] = 1; // p1 64 - 30 = 34
// bits[38] = 1; // p2 68 - 30 = 38 // bits[38] = 1; // p2 68 - 30 = 38
// 92 = 62 // 92 = 62
// 93 = 63 // 93 = 63
bits[34] = 0; // parity for odd bits bits[34] = 0; // parity for odd bits
bits[38] = 0; // parity for even bits bits[38] = 0; // parity for even bits
uint8_t p1 = 1; uint8_t p1 = 1;