From 07337549685a3e32165c502a2eb45da64e87be86 Mon Sep 17 00:00:00 2001 From: Anton Todorov Date: Mon, 30 Sep 2024 16:25:00 +0300 Subject: [PATCH 1/3] fix hf mfu pwdgen for 7 byte uid The last 3 bytes of the 7 byte uid are zeroed out Tested with the example from the forum http://www.proxmark.org/forum/viewtopic.php?pid=44238#p44238 Signed-off-by: Anton Todorov --- client/src/cmdhfmfu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client/src/cmdhfmfu.c b/client/src/cmdhfmfu.c index 6f7c9cdfa..d56ae5123 100644 --- a/client/src/cmdhfmfu.c +++ b/client/src/cmdhfmfu.c @@ -4392,10 +4392,6 @@ static int CmdHF14AMfUPwdGen(const char *Cmd) { if (u_len != 7 && u_len != 4) { PrintAndLogEx(WARNING, "Key must be 7 hex bytes"); return PM3_EINVARG; - } else { - // adapt to 7 bytes :) - memset(uid + 4, 0x00, 3); - u_len = 7; } } From 047039aed7f9956e45330a8f5b7362f65c7b6a55 Mon Sep 17 00:00:00 2001 From: Anton Todorov Date: Mon, 30 Sep 2024 16:30:57 +0300 Subject: [PATCH 2/3] Update CHANGELOG.md add line for the `hf mfu pwdgen` fix Signed-off-by: Anton Todorov --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2e3ef6e1..571c12ef2 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] +- Fixed `hf mfu pwdgen` for the 7 byte UID (@ANTodorov) - Added `hf iclass unhash` command to reverse an iclass diversified key to hash0 pre-images (@antiklesys) - Added crypto1 support to `hf 14a raw` (@doegox) - Changed `hw version` command to print LUA and Python versions (@jmichelp) From 26fe583a802a16095fd959b03fc840ad62001210 Mon Sep 17 00:00:00 2001 From: Anton Todorov Date: Mon, 30 Sep 2024 16:56:14 +0300 Subject: [PATCH 3/3] hf mfu pwdgen with 4byte uid should adapt to 7 byte Signed-off-by: Anton Todorov --- client/src/cmdhfmfu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/cmdhfmfu.c b/client/src/cmdhfmfu.c index d56ae5123..1586d8bda 100644 --- a/client/src/cmdhfmfu.c +++ b/client/src/cmdhfmfu.c @@ -4392,6 +4392,10 @@ static int CmdHF14AMfUPwdGen(const char *Cmd) { if (u_len != 7 && u_len != 4) { PrintAndLogEx(WARNING, "Key must be 7 hex bytes"); return PM3_EINVARG; + } else if (u_len == 4) { + // adapt to 7 bytes :) + memset(uid + 4, 0x00, 3); + u_len = 7; } }