mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fix styles
This commit is contained in:
parent
9ddd833cba
commit
81d795e56f
2 changed files with 13 additions and 10 deletions
|
@ -4759,9 +4759,9 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
|
||||||
// TODO: very confusing sizes... buf of 70, parser len to 63 instead of 70-1, tests for len > 127, loop with 64...
|
// can only do one block of 8 bytes currently. There are room for two blocks in the specs.
|
||||||
uint8_t bin[70] = {0};
|
uint8_t bin[65] = {0};
|
||||||
int bin_len = 63;
|
int bin_len = sizeof(bin) - 1; // CLIGetStrWithReturn does not guarantee string to be null-terminated
|
||||||
CLIGetStrWithReturn(ctx, 1, bin, &bin_len);
|
CLIGetStrWithReturn(ctx, 1, bin, &bin_len);
|
||||||
|
|
||||||
int key_nr = arg_get_int_def(ctx, 2, -1);
|
int key_nr = arg_get_int_def(ctx, 2, -1);
|
||||||
|
@ -4801,8 +4801,10 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
||||||
bool use_sc = false;
|
bool use_sc = false;
|
||||||
CLIGetHexWithReturn(ctx, 6, enc_key, &enc_key_len);
|
CLIGetHexWithReturn(ctx, 6, enc_key, &enc_key_len);
|
||||||
|
|
||||||
|
// FC / CN / Issue Level
|
||||||
wiegand_card_t card;
|
wiegand_card_t card;
|
||||||
memset(&card, 0, sizeof(wiegand_card_t));
|
memset(&card, 0, sizeof(wiegand_card_t));
|
||||||
|
|
||||||
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);
|
||||||
card.IssueLevel = arg_get_u32_def(ctx, 9, 0);
|
card.IssueLevel = arg_get_u32_def(ctx, 9, 0);
|
||||||
|
@ -4830,8 +4832,8 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
||||||
have_enc_key = true;
|
have_enc_key = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bin_len > 127) {
|
if (bin_len > 64) {
|
||||||
PrintAndLogEx(ERR, "Binary wiegand string must be less than 128 bits");
|
PrintAndLogEx(ERR, "Binary wiegand string must be less than 64 bits");
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -376,9 +376,10 @@ 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);
|
||||||
|
|
||||||
// TODO: very confusing sizes... buf of 70, parser len to 63 instead of 70-1, tests for len > 127, loop with 96...
|
// t5577 can do 6 blocks with 32bits == 192 bits, HID is manchester encoded and doubles in length.
|
||||||
int bin_len = 63;
|
// With parity, manchester and preamble we have about 3 blocks to play with. Ie: 96 bits
|
||||||
uint8_t bin[70] = {0};
|
uint8_t bin[97] = {0};
|
||||||
|
int bin_len = sizeof(bin) - 1; // CLIGetStrWithReturn does not guarantee string to be null-terminated
|
||||||
CLIGetStrWithReturn(ctx, 9, bin, &bin_len);
|
CLIGetStrWithReturn(ctx, 9, bin, &bin_len);
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
|
@ -387,8 +388,8 @@ static int CmdHIDClone(const char *Cmd) {
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bin_len > 127) {
|
if (bin_len > 96) {
|
||||||
PrintAndLogEx(ERR, "Binary wiegand string must be less than 128 bits");
|
PrintAndLogEx(ERR, "Binary wiegand string must be less than 96 bits");
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue