mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-22 08:16:16 +08:00
use fileutils to write memory dump
This commit is contained in:
parent
974713a4d8
commit
de91e850b4
|
@ -683,17 +683,13 @@ static int dumpmem_to_file(const char *filename, uint32_t addr, uint32_t len, bo
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == PM3_SUCCESS) {
|
if (res == PM3_SUCCESS) {
|
||||||
FILE *fd = fopen(filename, "wb");
|
PrintAndLogEx(INFO, "saving to "_YELLOW_("%s"), filename);
|
||||||
if (!fd) {
|
if (saveFile(filename, ".bin", buffer, read) != 0) {
|
||||||
PrintAndLogEx(ERR, _RED_("Could not open file") " %s >>> ", filename);
|
PrintAndLogEx(ERR, "error writing to file "_YELLOW_("%s"), filename);
|
||||||
res = PM3_EFILE;
|
res = PM3_EFILE;
|
||||||
goto fail2;
|
|
||||||
}
|
}
|
||||||
fwrite(buffer, 1, read, fd);
|
|
||||||
fclose(fd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fail2:
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
fail:
|
fail:
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in a new issue