}\r
}\r
}\r
- //moebius attack\r
+ /*\r
+ //un-comment to use as well moebius attack\r
for (uint8_t i = ATTACK_KEY_COUNT; i<ATTACK_KEY_COUNT*2; i++) {\r
if (ar_resp[i].ar2 > 0) {\r
if (tryMfk32_moebius(ar_resp[i], &key)) {\r
PrintAndLog("M-Found Key%s for sector %02d: [%04x%08x]", (ar_resp[i].keytype) ? "B" : "A", ar_resp[i].sector, (uint32_t) (key>>32), (uint32_t) (key &0xFFFFFFFF));\r
}\r
}\r
- }\r
+ }*/\r
}\r
\r
int usage_hf14_mf1ksim(void) {\r
memset(filename, 0x00, sizeof(filename));\r
int len = 0;\r
char buf[64];\r
- uint8_t uidBuffer[64];\r
\r
uint8_t cmdp = 0;\r
bool errors = false;\r
PrintAndLog("Loading file and simulating. Press keyboard to abort");\r
while(!feof(f) && !ukbhit()){\r
memset(buf, 0, sizeof(buf));\r
- memset(uidBuffer, 0, sizeof(uidBuffer));\r
+ memset(uid, 0, sizeof(uid));\r
\r
if (fgets(buf, sizeof(buf), f) == NULL) { \r
if (count > 0) break;\r
fclose(f);\r
return 2;\r
}\r
- if(strlen(buf) && feof(f)) break;\r
+ if(!strlen(buf) && feof(f)) break;\r
\r
- uidlen = strlen(buf);\r
+ uidlen = strlen(buf)-1;\r
switch(uidlen) {\r
- case 20: flags = FLAG_10B_UID_IN_DATA; break; //not complete\r
- case 14: flags = FLAG_7B_UID_IN_DATA; break;\r
- case 8: flags = FLAG_4B_UID_IN_DATA; break;\r
+ case 20: flags |= FLAG_10B_UID_IN_DATA; break; //not complete\r
+ case 14: flags |= FLAG_7B_UID_IN_DATA; break;\r
+ case 8: flags |= FLAG_4B_UID_IN_DATA; break;\r
default: \r
- PrintAndLog("uid in file wrong length at %d",count);\r
+ PrintAndLog("uid in file wrong length at %d (length: %d) [%s]",count, uidlen, buf);\r
fclose(f);\r
return 2;\r
}\r
\r
for (uint8_t i = 0; i < uidlen; i += 2) {\r
- sscanf(&buf[i], "%02x", (unsigned int *)&uidBuffer[i / 2]);\r
+ sscanf(&buf[i], "%02x", (unsigned int *)&uid[i / 2]);\r
}\r
\r
PrintAndLog("mf 1k sim uid: %s, numreads:%d, flags:%d (0x%02x) - press button to abort",\r