mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
chg: "trace list" - adjust messages
This commit is contained in:
parent
293b638f71
commit
f6c2516779
1 changed files with 11 additions and 5 deletions
|
@ -496,7 +496,7 @@ static int CmdTraceLoad(const char *Cmd) {
|
||||||
|
|
||||||
g_traceLen = 0;
|
g_traceLen = 0;
|
||||||
g_trace = calloc(fsize, sizeof(uint8_t));
|
g_trace = calloc(fsize, sizeof(uint8_t));
|
||||||
if (!g_trace) {
|
if (g_trace == NULL) {
|
||||||
PrintAndLogEx(FAILED, "Cannot allocate memory for trace");
|
PrintAndLogEx(FAILED, "Cannot allocate memory for trace");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
|
@ -505,7 +505,7 @@ static int CmdTraceLoad(const char *Cmd) {
|
||||||
size_t bytes_read = fread(g_trace, 1, fsize, f);
|
size_t bytes_read = fread(g_trace, 1, fsize, f);
|
||||||
g_traceLen = bytes_read;
|
g_traceLen = bytes_read;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
PrintAndLogEx(SUCCESS, "Recorded Activity (TraceLen = %lu bytes) loaded from file %s", g_traceLen, filename);
|
PrintAndLogEx(SUCCESS, "Recorded Activity (TraceLen = " _YELLOW_("%lu") " bytes) loaded from " _YELLOW_("%s"), g_traceLen, filename);
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -627,10 +627,8 @@ int CmdTraceList(const char *Cmd) {
|
||||||
//Validations
|
//Validations
|
||||||
if (errors) return usage_trace_list();
|
if (errors) return usage_trace_list();
|
||||||
|
|
||||||
uint16_t tracepos = 0;
|
|
||||||
|
|
||||||
|
|
||||||
if (isOnline) {
|
if (isOnline) {
|
||||||
|
|
||||||
// reserve some space.
|
// reserve some space.
|
||||||
if (g_trace)
|
if (g_trace)
|
||||||
free(g_trace);
|
free(g_trace);
|
||||||
|
@ -640,6 +638,9 @@ int CmdTraceList(const char *Cmd) {
|
||||||
PrintAndLogEx(FAILED, "Cannot allocate memory for trace");
|
PrintAndLogEx(FAILED, "Cannot allocate memory for trace");
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PrintAndLogEx(INFO, "downloading tracelog from device");
|
||||||
|
|
||||||
// Query for the size of the trace, downloading PM3_CMD_DATA_SIZE
|
// Query for the size of the trace, downloading PM3_CMD_DATA_SIZE
|
||||||
PacketResponseNG response;
|
PacketResponseNG response;
|
||||||
if (!GetFromDevice(BIG_BUF, g_trace, PM3_CMD_DATA_SIZE, 0, NULL, 0, &response, 4000, true)) {
|
if (!GetFromDevice(BIG_BUF, g_trace, PM3_CMD_DATA_SIZE, 0, NULL, 0, &response, 4000, true)) {
|
||||||
|
@ -665,6 +666,11 @@ int CmdTraceList(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "Recorded activity (trace len = " _YELLOW_("%lu") " bytes)", g_traceLen);
|
PrintAndLogEx(SUCCESS, "Recorded activity (trace len = " _YELLOW_("%lu") " bytes)", g_traceLen);
|
||||||
|
if (g_traceLen == 0) {
|
||||||
|
return PM3_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t tracepos = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (protocol == FELICA) {
|
if (protocol == FELICA) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue