fixed size error when creating dump files of mfclassic

This commit is contained in:
Ricardo J. Rodríguez 2016-04-28 09:06:08 +02:00
parent e23f8a9f9c
commit 7b5a840935

View File

@ -669,7 +669,7 @@ main(int argc, const char *argv[])
magic2 = true; magic2 = true;
} }
} }
printf("Guessing size: seems to be a %i-byte card\n", (uiBlocks + 1) * 16); printf("Guessing size: seems to be a %i-byte card\n", (uiBlocks + 1) * sizeof(mifare_classic_block));
if (bUseKeyFile) { if (bUseKeyFile) {
FILE *pfKeys = fopen(argv[4], "rb"); FILE *pfKeys = fopen(argv[4], "rb");
@ -686,7 +686,7 @@ main(int argc, const char *argv[])
} }
if (atAction == ACTION_READ) { if (atAction == ACTION_READ) {
memset(&mtDump, 0x00, sizeof(mtDump)); memset(&mtDump, 0x00, (uiBlocks + 1) * sizeof(mifare_classic_block));
} else { } else {
FILE *pfDump = fopen(argv[3], "rb"); FILE *pfDump = fopen(argv[3], "rb");