From 230c2791245ce823ab43fb3c16be3c515cae568f Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 28 Mar 2018 12:53:27 +0200 Subject: [PATCH] fix: 'lf indala' Commit 1dae981 extended the amount of fixed bits searched for when decoding 64-bit Indala. These additional bits come from the end of one UID, and therefore need to be skipped past when actually retrieving the UID. (@megabug) https://github.com/Proxmark/proxmark3/pull/588/commits/b05611a30bc5d4815a7603afe6593f2e852be91a --- client/cmdlfindala.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/cmdlfindala.c b/client/cmdlfindala.c index ab14638cd..8b447aba4 100644 --- a/client/cmdlfindala.c +++ b/client/cmdlfindala.c @@ -58,6 +58,7 @@ int usage_lf_indala_clone(void) { // indala id decoding int indala64decode(uint8_t *dest, size_t *size, uint8_t *invert) { //standard 64 bit indala formats including 26 bit 40134 format + // Note: these start with 3 bits from the end of one UID; the rest are from a subsequent one uint8_t preamble64[] = {1,0,1,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 1}; uint8_t preamble64_i[] = {0,1,0,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, 0}; size_t idx = 0; @@ -69,7 +70,10 @@ int indala64decode(uint8_t *dest, size_t *size, uint8_t *invert) { } if (found_size != 64) return -2; - if (*invert==1) + // Skip the aforementioned 3 bits from the previous UID + startidx += 3; + + if (*invert == 1) for (size_t i = idx; i < found_size + idx; i++) dest[i] ^= 1;