mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-21 22:54:40 +08:00
Add format parameter
This commit is contained in:
parent
9bab341cad
commit
b797c2ff9d
1 changed files with 7 additions and 1 deletions
|
@ -3598,6 +3598,7 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
|||
arg_str0(NULL, "enckey", "<hex>", "3DES transport key, 16 hex bytes"),
|
||||
arg_u64_0(NULL, "fc", "<dec>", "facility code"),
|
||||
arg_u64_0(NULL, "cn", "<dec>", "card number"),
|
||||
arg_str0("w", "wiegand", "<format>", "see " _YELLOW_("`wiegand list`") " for available formats"),
|
||||
arg_param_end
|
||||
};
|
||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||
|
@ -3638,6 +3639,10 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
|||
card.FacilityCode = arg_get_u32_def(ctx, 7, 0);
|
||||
card.CardNumber = arg_get_u32_def(ctx, 8, 0);
|
||||
|
||||
char format[16] = {0};
|
||||
int format_len = 0;
|
||||
CLIParamStrToBuf(arg_get_str(ctx, 9), (uint8_t *)format, sizeof(format), &format_len);
|
||||
|
||||
CLIParserFree(ctx);
|
||||
|
||||
if ((rawkey + elite) > 1) {
|
||||
|
@ -3717,8 +3722,9 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
|||
wiegand_message_t packed;
|
||||
memset(&packed, 0, sizeof(wiegand_message_t));
|
||||
|
||||
int format_idx = HIDFindCardFormat("H10301");
|
||||
int format_idx = HIDFindCardFormat((char *)format);
|
||||
if (format_idx == -1) {
|
||||
PrintAndLogEx(WARNING, "Unknown format: " _YELLOW_("%s"), format);
|
||||
return PM3_EINVARG;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue