This commit is contained in:
iceman1001 2024-01-15 19:54:22 +01:00
commit 805269ad4a

View file

@ -760,6 +760,8 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
if (prev_eot)
*prev_eot = end_of_transmission_timestamp;
// Always annotate these protocols both reader/tag messages
switch (protocol) {
case ISO_14443A:
@ -836,6 +838,7 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
if (j == 0) {
uint32_t time1 = hdr->timestamp - first_hdr->timestamp;
uint32_t time2 = end_of_transmission_timestamp - first_hdr->timestamp;
if (prev_eot) {
@ -995,13 +998,14 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
static int download_trace(void) {
if (IfPm3Present() == false) {
PrintAndLogEx(FAILED, "You requested a trace upload in offline mode, consider using parameter '-1' for working from Tracebuffer");
PrintAndLogEx(FAILED, "You requested a trace upload in offline mode, consider using parameter `" _YELLOW_("-1") "` for working from Tracebuffer");
return PM3_EINVARG;
}
// reserve some space.
if (gs_trace)
if (gs_trace) {
free(gs_trace);
}
gs_traceLen = 0;
@ -1011,7 +1015,7 @@ static int download_trace(void) {
return PM3_EMALLOC;
}
PrintAndLogEx(INFO, "downloading tracelog data from device");
PrintAndLogEx(DEBUG, "downloading tracelog data from device");
// Query for the size of the trace, downloading PM3_CMD_DATA_SIZE
PacketResponseNG resp;
@ -1078,11 +1082,11 @@ static int CmdTraceExtract(const char *Cmd) {
download_trace();
} else if (gs_traceLen == 0) {
PrintAndLogEx(FAILED, "You requested a trace list in offline mode but there is no trace.");
PrintAndLogEx(FAILED, "Consider using " _YELLOW_("`trace load`") " or removing parameter " _YELLOW_("`-1`"));
PrintAndLogEx(FAILED, "Consider using `" _YELLOW_("trace load") "` or removing parameter `" _YELLOW_("-1") "`");
return PM3_EINVARG;
}
PrintAndLogEx(SUCCESS, "Recorded activity (trace len = " _YELLOW_("%u") " bytes)", gs_traceLen);
PrintAndLogEx(SUCCESS, "Recorded activity ( " _YELLOW_("%u") " bytes )" , gs_traceLen);
if (gs_traceLen == 0) {
return PM3_SUCCESS;
}
@ -1092,10 +1096,10 @@ static int CmdTraceExtract(const char *Cmd) {
while (tracepos < gs_traceLen) {
tracepos = extractChallenges(tracepos, gs_traceLen, gs_trace);
if (kbd_enter_pressed())
if (kbd_enter_pressed()) {
break;
}
}
return PM3_SUCCESS;
}
@ -1312,11 +1316,11 @@ int CmdTraceList(const char *Cmd) {
download_trace();
} else if (gs_traceLen == 0 || gs_trace == NULL) {
PrintAndLogEx(FAILED, "You requested a trace list in offline mode but there is no trace.");
PrintAndLogEx(FAILED, "Consider using " _YELLOW_("`trace load`") " or removing parameter " _YELLOW_("`-1`"));
PrintAndLogEx(FAILED, "Consider using `" _YELLOW_("trace load") "` or removing parameter `" _YELLOW_("-1") "`");
return PM3_EINVARG;
}
PrintAndLogEx(SUCCESS, "Recorded activity (trace len = " _YELLOW_("%u") " bytes)", gs_traceLen);
PrintAndLogEx(SUCCESS, "Recorded activity ( " _YELLOW_("%u") " bytes )" , gs_traceLen);
if (gs_traceLen == 0) {
return PM3_SUCCESS;
}
@ -1335,9 +1339,9 @@ int CmdTraceList(const char *Cmd) {
} else {
if (use_relative) {
PrintAndLogEx(INFO, _YELLOW_("gap") " = time between transfers. " _YELLOW_("duration") " = duration of data transfer. " _YELLOW_("src") " = source of transfer");
PrintAndLogEx(INFO, _YELLOW_("gap") " = time between transfers. " _YELLOW_("duration") " = duration of data transfer. " _YELLOW_("src") " = source of transfer.");
} else {
PrintAndLogEx(INFO, _YELLOW_("start") " = start of start frame " _YELLOW_("end") " = end of frame. " _YELLOW_("src") " = source of transfer");
PrintAndLogEx(INFO, _YELLOW_("start") " = start of start frame. " _YELLOW_("end") " = end of frame. " _YELLOW_("src") " = source of transfer.");
}
if (protocol == ISO_14443A || protocol == PROTO_MIFARE || protocol == MFDES || protocol == PROTO_MFPLUS || protocol == TOPAZ || protocol == LTO) {