+ \r
+ if ( PackBits(0, 32, DemodBuffer) == 0x00 )\r
+ return FALSE;\r
+ \r
+ uint8_t si = 0;\r
+ \r
+ uint8_t safer = PackBits(si, 4, DemodBuffer); si += 4; \r
+ uint8_t resv = PackBits(si, 7, DemodBuffer); si += 7+3;\r
+ uint8_t extend = PackBits(si, 1, DemodBuffer); si += 1;\r
+\r
+ //PrintAndLog("test: %X %X %X ", safer, resv, extend);\r
+ \r
+ // 2nibble must be zeroed.\r
+ if ( resv > 0x00) return FALSE;\r
+\r
+ if ( safer == 0x6 || safer == 0x9){\r
+ if ( extend == 0x00)\r
+ return TRUE;\r
+ }\r
+ if ( resv== 0x00) return TRUE;\r
+ return FALSE;\r
+}\r
+\r
+void printT55xxBlock(const char *demodStr){\r
+ \r
+ uint32_t blockData = 0;\r
+ uint8_t bits[64] = {0x00};\r
+ \r
+ if ( !DemodBufferLen) \r
+ return;\r
+ \r
+ if ( config.offset > DemodBufferLen){\r
+ PrintAndLog("The configured offset is to big. (%d > %d)", config.offset, DemodBufferLen);\r
+ return;\r
+ }\r
+ \r
+ int i = config.offset;\r
+ int pos = 32 + config.offset;\r
+ for (; i < pos; ++i)\r
+ bits[i - config.offset]=DemodBuffer[i];\r
+ \r
+ blockData = PackBits(0, 32, bits);\r
+ PrintAndLog("0x%08X %s [%s]", blockData, sprint_bin(bits,32), demodStr);\r
+}\r
+\r
+int special(const char *Cmd) {\r
+ uint32_t blockData = 0;\r
+ uint8_t bits[32] = {0x00};\r
+\r
+ PrintAndLog("[OFFSET] [DATA] [BINARY]");\r
+ PrintAndLog("----------------------------------------------------");\r
+ int i,j = 0;\r
+ for (; j < 128; ++j){\r
+ \r
+ for (i = 0; i < 32; ++i)\r
+ bits[i]=DemodBuffer[j+i];\r
+ \r
+ blockData = PackBits(0, 32, bits);\r
+ PrintAndLog("[%d] 0x%08X %s",j , blockData, sprint_bin(bits,32)); \r