mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-01 05:07:03 +08:00
feat: add -v verbose flag to "hf iclass encode"
This commit is contained in:
parent
cb6f3f381d
commit
5133d4a512
2 changed files with 14 additions and 0 deletions
|
@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
|
|||
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
|
||||
|
||||
## [unreleased][unreleased]
|
||||
- Added verbose flag to `hf iclass encode` (@natesales)
|
||||
- Fixed `lf em 4x70 brute` - now works as expected (@adite)
|
||||
- Fixed the lf sampling when bits_per_sample is less than 8 (@wh201906)
|
||||
- Added `lf em 4x70 brute` command (@adite)
|
||||
|
|
|
@ -3832,6 +3832,7 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
|||
arg_u64_0(NULL, "cn", "<dec>", "card number"),
|
||||
arg_str0("w", "wiegand", "<format>", "see " _YELLOW_("`wiegand list`") " for available formats"),
|
||||
arg_lit0(NULL, "shallow", "use shallow (ASK) reader modulation instead of OOK"),
|
||||
arg_lit0("v", NULL, "verbose (print encoded blocks)"),
|
||||
arg_param_end
|
||||
};
|
||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||
|
@ -3877,6 +3878,7 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
|||
CLIParamStrToBuf(arg_get_str(ctx, 9), (uint8_t *)format, sizeof(format), &format_len);
|
||||
|
||||
bool shallow_mod = arg_get_lit(ctx, 10);
|
||||
bool verbose = arg_get_lit(ctx, 11);
|
||||
|
||||
CLIParserFree(ctx);
|
||||
|
||||
|
@ -3996,6 +3998,17 @@ static int CmdHFiClassEncode(const char *Cmd) {
|
|||
iclass_encrypt_block_data(credential + 24, enc_key);
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
for (uint8_t i = 0; i < 4; i++) {
|
||||
PrintAndLogEx(INFO, "Block %d/0x0%x -> " _YELLOW_("%s"), 6 + i, 6 + i, sprint_hex_inrow(credential + (i * 8), 8));
|
||||
}
|
||||
}
|
||||
|
||||
if (!g_session.pm3_present) {
|
||||
PrintAndLogEx(ERR, "Device offline\n");
|
||||
return PM3_EFAILED;
|
||||
}
|
||||
|
||||
int isok = PM3_SUCCESS;
|
||||
// write
|
||||
for (uint8_t i = 0; i < 4; i++) {
|
||||
|
|
Loading…
Reference in a new issue