PrintAndLog("---------------------------------");
for (i = 0; i < Pages; ++i) {
if ( i < 3 ) {
- PrintAndLog("%02d/0x%02X | %s| | ", i+startPage, i+startPage, sprint_hex(data + i * 4, 4));
+ PrintAndLog("%02d/0x%02X | %s| | %.4s", i+startPage, i+startPage, sprint_hex(data + i * 4, 4), data + i * 4 );
continue;
}
switch(i){
return 1;
}
fwrite( dump_file_data, 1, Pages*4 + DUMP_PREFIX_LENGTH, fout );
- fclose(fout);
-
+ if (fout) {
+ fclose(fout);
+ fout = NULL;
+ }
PrintAndLog("Dumped %d pages, wrote %d bytes to %s", Pages+(DUMP_PREFIX_LENGTH/4), Pages*4 + DUMP_PREFIX_LENGTH, filename);
return 0;
}