mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 10:43:01 +08:00
chg: 'trace save' - removed redundant message
chg: 'trace load' - add check if file is too small to be useful
This commit is contained in:
parent
4dd7c19be1
commit
9f7d9a5d7f
1 changed files with 7 additions and 5 deletions
|
@ -560,6 +560,11 @@ int CmdTraceLoad(const char *Cmd) {
|
|||
fclose(f);
|
||||
return 3;
|
||||
}
|
||||
if (fsize < 4 ) {
|
||||
PrintAndLogEx(FAILED, "error, file is too small");
|
||||
fclose(f);
|
||||
return 4;
|
||||
}
|
||||
|
||||
if ( trace )
|
||||
free(trace);
|
||||
|
@ -585,15 +590,12 @@ int CmdTraceSave(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
char filename[FILE_PATH_SIZE];
|
||||
char filename[FILE_PATH_SIZE];
|
||||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) < 1 || cmdp == 'h' || cmdp == 'H') return usage_trace_save();
|
||||
|
||||
param_getstr(Cmd, 0, filename, sizeof(filename));
|
||||
|
||||
param_getstr(Cmd, 0, filename, sizeof(filename));
|
||||
saveFile(filename, "bin", trace, traceLen);
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Recorded Activity (TraceLen = %d bytes) written to file %s", traceLen, filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue