uint8_t trgKeyType = 0;\r
uint8_t SectorsCnt = 0;\r
uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
- uint8_t keyBlock[13*6];\r
+ uint8_t keyBlock[14*6];\r
uint64_t key64 = 0;\r
bool transferToEml = false;\r
\r
\r
if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;\r
\r
- fnameptr += len;\r
+ fnameptr += len-4;\r
\r
sprintf(fnameptr, ".eml"); \r
\r
for (j = 0; j < 7; j++, fnameptr += 2)\r
sprintf(fnameptr, "%02X", buf[j]); \r
} else {\r
- fnameptr += len;\r
+ fnameptr += len-4;\r
}\r
\r
// add file extension\r
if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;\r
\r
memcpy(filename, Cmd, len);\r
- fnameptr += len;\r
+ fnameptr += len-4;\r
\r
sprintf(fnameptr, ".eml"); \r
\r
\r
if (fgets(buf, sizeof(buf), f) == NULL) {\r
PrintAndLog("File reading error.");\r
+ fclose(f);\r
return 2;\r
}\r
\r
if(strlen(buf) && feof(f))\r
break;\r
PrintAndLog("File content error. Block data must include 32 HEX symbols");\r
+ fclose(f);\r
return 2;\r
}\r
for (i = 0; i < 32; i += 2)\r