mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
chg: helptext (@drandreas)
chg: 'hf legic esave' now saves to both BIN / EML
This commit is contained in:
parent
65b29410d4
commit
56f3ef2a55
2 changed files with 5 additions and 14 deletions
|
@ -54,7 +54,7 @@ int usage_legic_sim(void){
|
||||||
PrintAndLogEx(NORMAL, " : 2 = MIM1024");
|
PrintAndLogEx(NORMAL, " : 2 = MIM1024");
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(NORMAL, "Examples:");
|
PrintAndLogEx(NORMAL, "Examples:");
|
||||||
PrintAndLogEx(NORMAL, " hf legic sim");
|
PrintAndLogEx(NORMAL, " hf legic sim 2");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int usage_legic_write(void){
|
int usage_legic_write(void){
|
||||||
|
@ -1120,7 +1120,7 @@ int CmdLegicELoad(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int CmdLegicESave(const char *Cmd) {
|
int CmdLegicESave(const char *Cmd) {
|
||||||
FILE *f;
|
|
||||||
char filename[FILE_PATH_SIZE];
|
char filename[FILE_PATH_SIZE];
|
||||||
char *fnameptr = filename;
|
char *fnameptr = filename;
|
||||||
int fileNlen, numofbytes, nameParamNo = 1;
|
int fileNlen, numofbytes, nameParamNo = 1;
|
||||||
|
@ -1160,24 +1160,14 @@ int CmdLegicESave(const char *Cmd) {
|
||||||
free(data);
|
free(data);
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// user supplied filename?
|
// user supplied filename?
|
||||||
if (fileNlen < 1)
|
if (fileNlen < 1)
|
||||||
sprintf(fnameptr,"%02X%02X%02X%02X.bin", data[0], data[1], data[2], data[3]);
|
sprintf(fnameptr,"%02X%02X%02X%02X.bin", data[0], data[1], data[2], data[3]);
|
||||||
else
|
else
|
||||||
sprintf(fnameptr + fileNlen,".bin");
|
sprintf(fnameptr + fileNlen,".bin");
|
||||||
|
|
||||||
// open file
|
saveFileEML(filename, "eml", data, numofbytes, 8);
|
||||||
f = fopen(filename,"wb");
|
saveFile(filename, "bin", data, numofbytes);
|
||||||
if (!f) {
|
|
||||||
PrintAndLogEx(WARNING, "Could not create file name %s", filename);
|
|
||||||
free(data);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
fwrite(data, 1, numofbytes, f);
|
|
||||||
fclose(f);
|
|
||||||
free(data);
|
|
||||||
PrintAndLogEx(NORMAL, "\nSaved %d bytes from emulator memory to file: %s", numofbytes, filename);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "legic_prng.h"
|
#include "legic_prng.h"
|
||||||
#include "legic.h" // legic_card_select_t struct
|
#include "legic.h" // legic_card_select_t struct
|
||||||
#include "cmdhf.h" // "hf list"
|
#include "cmdhf.h" // "hf list"
|
||||||
|
#include "loclass/fileutils.h" //saveFile
|
||||||
|
|
||||||
int CmdHFLegic(const char *Cmd);
|
int CmdHFLegic(const char *Cmd);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue