diff --git a/CHANGELOG.md b/CHANGELOG.md index 80a923eda..5e09e96b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 '--gap' option to lf em 410x sim for more control over sim data (@mwalker) - Changed `hf fido` - refactored load/save json objects (@iceman1001) - Moved / renamed `fido2.json` -> `client/resource/fido2_defparams.json` (@iceman1001) - Added openocd shikra support based on @ninjastyle82 patch to deprecated iceman fork (@iceman1001) diff --git a/client/src/cmdlfem410x.c b/client/src/cmdlfem410x.c index 435421663..bb8bdd46b 100644 --- a/client/src/cmdlfem410x.c +++ b/client/src/cmdlfem410x.c @@ -48,13 +48,13 @@ static int CmdHelp(const char *Cmd); */ // Construct the graph for emulating an EM410X tag -static void em410x_construct_emul_graph(uint8_t *uid, uint8_t clock) { +static void em410x_construct_emul_graph(uint8_t *uid, uint8_t clock, uint8_t gap) { // clear our graph ClearGraph(true); // write 16 zero bit sledge - for (uint8_t i = 0; i < 20; i++) + for (uint8_t i = 0; i < gap; i++) AppendGraph(false, clock, 0); // write 9 start bits @@ -403,13 +403,15 @@ static int CmdEM410xSim(const char *Cmd) { "Enables simulation of EM 410x card.\n" "Simulation runs until the button is pressed or another USB command is issued.", "lf em 410x sim --id 0F0368568B\n" - "lf em 410x sim --id 0F0368568B --clk 32" + "lf em 410x sim --id 0F0368568B --clk 32\n" + "lf em 410x sim --id 0F0368568B --gap 0" ); void *argtable[] = { arg_param_begin, arg_u64_0(NULL, "clk", "", "<32|64> clock (default 64)"), arg_str1(NULL, "id", "", "ID number (5 hex bytes)"), + arg_u64_0(NULL, "gap", "", "gap (0's) between ID repeats (default 20)"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, false); @@ -417,6 +419,7 @@ static int CmdEM410xSim(const char *Cmd) { // clock is 64 in EM410x tags int clk = arg_get_u32_def(ctx, 1, 64); int uid_len = 0; + int gap = arg_get_u32_def(ctx,3,20); uint8_t uid[5] = {0}; CLIGetHexWithReturn(ctx, 2, uid, &uid_len); CLIParserFree(ctx); @@ -427,7 +430,7 @@ static int CmdEM410xSim(const char *Cmd) { } PrintAndLogEx(SUCCESS, "Starting simulating UID "_YELLOW_("%s")" clock: "_YELLOW_("%d"), sprint_hex_inrow(uid, sizeof(uid)), clk); - em410x_construct_emul_graph(uid, clk); + em410x_construct_emul_graph(uid, clk, gap); CmdLFSim(""); return PM3_SUCCESS; } @@ -447,13 +450,14 @@ static int CmdEM410xBrute(const char *Cmd) { arg_u64_0(NULL, "clk", "", "<32|64> clock (default 64)"), arg_u64_0(NULL, "delay", "", "pause delay in milliseconds between UIDs simulation (default 1000ms)"), arg_str1("f", "file", "", "file with UIDs in HEX format, one per line"), + arg_u64_0(NULL, "gap", "", "gap (0's) between ID repeats (default 20)"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, false); // clock default 64 in EM410x uint32_t clk = arg_get_u32_def(ctx, 1, 64); - + int gap = arg_get_u32_def(ctx, 4, 20); // default pause time: 1 second uint32_t delay = arg_get_u32_def(ctx, 2, 1000); @@ -548,7 +552,7 @@ static int CmdEM410xBrute(const char *Cmd) { , sprint_hex_inrow(testuid, sizeof(testuid)) ); - em410x_construct_emul_graph(testuid, clk); + em410x_construct_emul_graph(testuid, clk, gap); lfsim_upload_gb();