mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
lf hid clone - wip take binary string as input
This commit is contained in:
parent
005079b91f
commit
93c99e9f7a
1 changed files with 12 additions and 0 deletions
|
@ -344,6 +344,7 @@ static int CmdHIDClone(const char *Cmd) {
|
||||||
arg_strx0("r", "raw", "<hex>", "raw bytes"),
|
arg_strx0("r", "raw", "<hex>", "raw bytes"),
|
||||||
arg_lit0(NULL, "q5", "optional - specify writing to Q5/T5555 tag"),
|
arg_lit0(NULL, "q5", "optional - specify writing to Q5/T5555 tag"),
|
||||||
arg_lit0(NULL, "em", "optional - specify writing to EM4305/4469 tag"),
|
arg_lit0(NULL, "em", "optional - specify writing to EM4305/4469 tag"),
|
||||||
|
arg_str0(NULL, "bin", "<bin>", "Binary string i.e 0001001001"),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
@ -365,6 +366,12 @@ static int CmdHIDClone(const char *Cmd) {
|
||||||
|
|
||||||
bool q5 = arg_get_lit(ctx, 7);
|
bool q5 = arg_get_lit(ctx, 7);
|
||||||
bool em = arg_get_lit(ctx, 8);
|
bool em = arg_get_lit(ctx, 8);
|
||||||
|
|
||||||
|
|
||||||
|
int bin_len = 63;
|
||||||
|
uint8_t bin[70] = {0};
|
||||||
|
CLIGetStrWithReturn(ctx, 9, bin, &bin_len);
|
||||||
|
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
if (q5 && em) {
|
if (q5 && em) {
|
||||||
|
@ -372,6 +379,11 @@ static int CmdHIDClone(const char *Cmd) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bin_len > 127) {
|
||||||
|
PrintAndLogEx(ERR, "Binary wiegand string must be less than 128 bits");
|
||||||
|
return PM3_EINVARG;
|
||||||
|
}
|
||||||
|
|
||||||
wiegand_message_t packed;
|
wiegand_message_t packed;
|
||||||
memset(&packed, 0, sizeof(wiegand_message_t));
|
memset(&packed, 0, sizeof(wiegand_message_t));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue