mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
hf 14a list helptext handling by CmdTraceListAlias, to be generalized if ok
This commit is contained in:
parent
4c228b6c64
commit
4dea429157
3 changed files with 38 additions and 5 deletions
|
@ -171,12 +171,13 @@ static uint16_t frameLength = 0;
|
||||||
uint16_t atsFSC[] = {16, 24, 32, 40, 48, 64, 96, 128, 256};
|
uint16_t atsFSC[] = {16, 24, 32, 40, 48, 64, 96, 128, 256};
|
||||||
|
|
||||||
static int CmdHF14AList(const char *Cmd) {
|
static int CmdHF14AList(const char *Cmd) {
|
||||||
char args[128] = {0};
|
int ret = CmdTraceListAlias(Cmd, "hf 14a list");
|
||||||
if (strlen(Cmd) == 0) {
|
if (ret != PM3_SUCCESS) {
|
||||||
snprintf(args, sizeof(args), "-t 14a");
|
return ret;
|
||||||
} else {
|
|
||||||
strncpy(args, Cmd, sizeof(args) - 1);
|
|
||||||
}
|
}
|
||||||
|
char args[128] = {0};
|
||||||
|
snprintf(args, sizeof(args), "-t 14a ");
|
||||||
|
strncat(args, Cmd, sizeof(args) - strlen(args));
|
||||||
return CmdTraceList(args);
|
return CmdTraceList(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -591,6 +591,37 @@ static int CmdTraceSave(const char *Cmd) {
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CmdTraceListAlias(const char *Cmd, const char *alias) {
|
||||||
|
CLIParserContext *ctx;
|
||||||
|
char example[200] = {0};
|
||||||
|
sprintf(example,
|
||||||
|
"%s -f -> show frame delay times\n"
|
||||||
|
"%s -1 -> use trace buffer ",
|
||||||
|
alias, alias);
|
||||||
|
CLIParserInit(&ctx, alias,
|
||||||
|
"Alias of `trace list -t` with selected protocol data to annotate trace buffer\n"
|
||||||
|
"You can load a trace from file (see `trace load -h`) or it be downloaded from device by default\n"
|
||||||
|
"It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol",
|
||||||
|
example
|
||||||
|
);
|
||||||
|
|
||||||
|
void *argtable[] = {
|
||||||
|
arg_param_begin,
|
||||||
|
arg_lit0("1", "buffer", "use data from trace buffer"),
|
||||||
|
arg_lit0("f", NULL, "show frame delay times"),
|
||||||
|
arg_lit0("c", NULL, "mark CRC bytes"),
|
||||||
|
arg_lit0("r", NULL, "show relative times (gap and duration)"),
|
||||||
|
arg_lit0("u", NULL, "display times in microseconds instead of clock cycles"),
|
||||||
|
arg_lit0("x", NULL, "show hexdump to convert to pcap(ng)\n"
|
||||||
|
" or to import into Wireshark using encapsulation type \"ISO 14443\""),
|
||||||
|
arg_strx0(NULL, "dict", "<file>", "use dictionary keys file"),
|
||||||
|
arg_param_end
|
||||||
|
};
|
||||||
|
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||||
|
CLIParserFree(ctx);
|
||||||
|
return PM3_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
int CmdTraceList(const char *Cmd) {
|
int CmdTraceList(const char *Cmd) {
|
||||||
CLIParserContext *ctx;
|
CLIParserContext *ctx;
|
||||||
CLIParserInit(&ctx, "trace list",
|
CLIParserInit(&ctx, "trace list",
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
|
|
||||||
int CmdTrace(const char *Cmd);
|
int CmdTrace(const char *Cmd);
|
||||||
int CmdTraceList(const char *Cmd);
|
int CmdTraceList(const char *Cmd);
|
||||||
|
int CmdTraceListAlias(const char *Cmd, const char *alias);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue