mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-14 00:53:12 +08:00
bad logic
This commit is contained in:
parent
580159ed97
commit
b9cbc5cb7f
1 changed files with 19 additions and 20 deletions
|
@ -425,34 +425,33 @@ int CmdHFFelicaDumpLite(const char *Cmd) {
|
|||
}
|
||||
|
||||
uint64_t tracelen = resp.arg[1];
|
||||
if (tracelen == 0)
|
||||
return 1;
|
||||
|
||||
uint8_t *trace = calloc(tracelen, sizeof(uint8_t));
|
||||
if (trace == NULL) {
|
||||
PrintAndLogEx(WARNING, "Cannot allocate memory for trace");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// only download data if there is any.
|
||||
if (tracelen > 0) {
|
||||
|
||||
if (!GetFromDevice(BIG_BUF, trace, tracelen, 0, NULL, 2500, false)) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
free(trace);
|
||||
return 0;
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Recorded Activity (trace len = %d bytes)", tracelen);
|
||||
|
||||
print_hex_break(trace, tracelen, 32);
|
||||
|
||||
printSep();
|
||||
uint16_t tracepos = 0;
|
||||
while (tracepos < tracelen)
|
||||
tracepos = PrintFliteBlock(tracepos, trace, tracelen);
|
||||
|
||||
printSep();
|
||||
if (!GetFromDevice(BIG_BUF, trace, tracelen, 0, NULL, 2500, false)) {
|
||||
PrintAndLogEx(WARNING, "command execution time out");
|
||||
free(trace);
|
||||
return 0;
|
||||
}
|
||||
|
||||
free(trace);
|
||||
PrintAndLogEx(SUCCESS, "Recorded Activity (trace len = %d bytes)", tracelen);
|
||||
|
||||
print_hex_break(trace, tracelen, 32);
|
||||
printSep();
|
||||
|
||||
uint16_t tracepos = 0;
|
||||
while (tracepos < tracelen)
|
||||
tracepos = PrintFliteBlock(tracepos, trace, tracelen);
|
||||
|
||||
printSep();
|
||||
|
||||
free(trace);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue