mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-25 07:35:40 -07: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_str0(NULL, "enckey", "<hex>", "3DES transport key, 16 hex bytes"),
|
||||||
arg_u64_0(NULL, "fc", "<dec>", "facility code"),
|
arg_u64_0(NULL, "fc", "<dec>", "facility code"),
|
||||||
arg_u64_0(NULL, "cn", "<dec>", "card number"),
|
arg_u64_0(NULL, "cn", "<dec>", "card number"),
|
||||||
|
arg_str0("w", "wiegand", "<format>", "see " _YELLOW_("`wiegand list`") " for available formats"),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
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.FacilityCode = arg_get_u32_def(ctx, 7, 0);
|
||||||
card.CardNumber = arg_get_u32_def(ctx, 8, 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);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
if ((rawkey + elite) > 1) {
|
if ((rawkey + elite) > 1) {
|
||||||
|
@ -3717,8 +3722,9 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
||||||
wiegand_message_t packed;
|
wiegand_message_t packed;
|
||||||
memset(&packed, 0, sizeof(wiegand_message_t));
|
memset(&packed, 0, sizeof(wiegand_message_t));
|
||||||
|
|
||||||
int format_idx = HIDFindCardFormat("H10301");
|
int format_idx = HIDFindCardFormat((char *)format);
|
||||||
if (format_idx == -1) {
|
if (format_idx == -1) {
|
||||||
|
PrintAndLogEx(WARNING, "Unknown format: " _YELLOW_("%s"), format);
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue