From 12bd5736ad4ccb758f4d4ec3383e9280acee4728 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 3 Sep 2026 19:23:39 +0200 Subject: [PATCH 1/3] renamed script --- tools/{pm3trace_edit.py => pm3_edit_trace.py} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename tools/{pm3trace_edit.py => pm3_edit_trace.py} (99%) diff --git a/tools/pm3trace_edit.py b/tools/pm3_edit_trace.py similarity index 99% rename from tools/pm3trace_edit.py rename to tools/pm3_edit_trace.py index bf27031b7..7d5c53495 100644 --- a/tools/pm3trace_edit.py +++ b/tools/pm3_edit_trace.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -pm3trace_edit.py — Proxmark3 binary trace file editor +pm3_edit_trace.py — Proxmark3 binary trace file editor Binary record format (tracelog_hdr_t, include/pm3_cmd.h): [4] timestamp uint32 LE — carrier periods (14a/thinfilm), ETU (hitag), etc. @@ -10,8 +10,8 @@ Binary record format (tracelog_hdr_t, include/pm3_cmd.h): [P] parity ceil(data_len/8) bytes, bit j of byte i = odd-parity of data[i*8+j] Usage: - python3 pm3trace_edit.py # interactive editor - python3 pm3trace_edit.py --dump # dump to stdout and exit + python3 pm3_edit_trace.py # interactive editor + python3 pm3_edit_trace.py --dump # dump to stdout and exit Interactive commands: l / list [N] list all frames, or frame N only From 1b631a288ae2c654e94600ff0568c0a247591e40 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 3 Sep 2026 19:31:56 +0200 Subject: [PATCH 2/3] text output --- tools/pm3_edit_trace.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) mode change 100644 => 100755 tools/pm3_edit_trace.py diff --git a/tools/pm3_edit_trace.py b/tools/pm3_edit_trace.py old mode 100644 new mode 100755 index 7d5c53495..299aedeaf --- a/tools/pm3_edit_trace.py +++ b/tools/pm3_edit_trace.py @@ -150,14 +150,20 @@ def serialise_trace(frames: list[Frame]) -> bytes: HEADER = ( f"{'#':>5} {'Timestamp':>10} {'Dur':>6} {'Src':>3} " - f"{'Data (hex)':<50} {'Par':>3}" + f"{'Data (hex)':<50}" ) SEP = '-' * len(HEADER) +# reader lines in yellow, when stdout is a terminal +YELLOW = '\033[33m' if sys.stdout.isatty() else '' +RESET = '\033[0m' if sys.stdout.isatty() else '' + def print_frame(idx: int, f: Frame) -> None: - print(f'{idx:>5} {f.timestamp:>10} {f.duration:>6} {f.src:>3} ' - f'{f.data_hex():<50} {f.parity_status:>3}') + colour = '' if f.is_response else YELLOW + reset = '' if f.is_response else RESET + print(f'{colour}{idx:>5} {f.timestamp:>10} {f.duration:>6} {f.src:>3} ' + f'{f.data_hex():<50}{reset}') def cmd_list(frames: list[Frame], args: list[str]) -> None: From 50c1c7213654ef98a865db5354ca67e0f4c36fb6 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 3 Sep 2026 19:35:58 +0200 Subject: [PATCH 3/3] added some sample dump files and trace file for hitag2 --- traces/README.md | 14 ++++++++++++++ traces/lf_ht2_crypto.bin | Bin 0 -> 32 bytes traces/lf_ht2_publicA.bin | Bin 0 -> 32 bytes traces/lf_ht2_publicB.bin | Bin 0 -> 32 bytes traces/lf_ht2_publicC.bin | Bin 0 -> 32 bytes traces/lf_ht2_pwd_sniff.trace | Bin 0 -> 749 bytes 6 files changed, 14 insertions(+) create mode 100644 traces/lf_ht2_crypto.bin create mode 100644 traces/lf_ht2_publicA.bin create mode 100644 traces/lf_ht2_publicB.bin create mode 100644 traces/lf_ht2_publicC.bin create mode 100644 traces/lf_ht2_pwd_sniff.trace diff --git a/traces/README.md b/traces/README.md index 7c2a84e5f..db0ac32e0 100644 --- a/traces/README.md +++ b/traces/README.md @@ -113,3 +113,17 @@ |--------|-----------| |lf_hitag_crypto_dump.trace |Execution of `lf hitag dump --crypto` against Hitag2 card in crypto mode| + +## LF emulator dumps + +Tag images for `lf hitag eload`, used to simulate a Hitag 2 in each of its +operating modes. Byte 0 of page 3 is the configuration byte that selects the +mode, so the files differ mainly in that one byte. + +|filename|description| +|--------|-----------| +|lf-hitag-CE129911-dump.bin |Hitag2 in password mode (config `0x06`), password `BDF5E846`| +|lf_ht2_crypto.bin |Hitag2 in crypto mode (config `0x0E`), key `4F4EBDF5E846`| +|lf_ht2_publicA.bin |Hitag2 in Public Mode A (config `0x02`), Manchester, pages 4-5, carries an EM4102 payload| +|lf_ht2_publicB.bin |Hitag2 in Public Mode B (config `0x00`), biphase 32 T0, pages 4-7| +|lf_ht2_publicC.bin |Hitag2 in Public Mode C (config `0x04`), biphase 64 T0, pages 4-7| diff --git a/traces/lf_ht2_crypto.bin b/traces/lf_ht2_crypto.bin new file mode 100644 index 0000000000000000000000000000000000000000..d2d4b9700715108a3753a91f684b0cad87e52581 GIT binary patch literal 32 ocmX>nG*fWz*B5RIAN>9JezG6h=2D_yW6!|Gkic0O`I9&j0`b literal 0 HcmV?d00001 diff --git a/traces/lf_ht2_publicA.bin b/traces/lf_ht2_publicA.bin new file mode 100644 index 0000000000000000000000000000000000000000..12f9577938ca933e09a5392095b9fffb0fac4bbb GIT binary patch literal 32 qcmV+*0N?-45}6Ub_2@<*@J~(x`3J)PjHXJM_{ahPUnG*fWz*B5RIAN>6oezG50{E;uFTJsunG*fWz*B5RIAN>7TezG50{E;uFTJsuIyNhA|yQvUAg{yW>#Iro10-U|Q@A@B|HApoDj;G6?uV2cEnjA8H? z8=?WP9G}N6#^NX*$PYJQKj1INXaXIWej*MLl?-Ht2|RejaSCuRFI=VlW;CS&S#s`o zilj8!FDix!TNc`Xw~HPt&CwcphVUHPmmp6rJx2qD3V;<2lx}CBsWJk&|3S4CbfAH5 zsuXCpnt?2JH1Bi@e?0>YH7QVG3+-#5ONRnYbTH6q7lG`?KraI|4*+?3A@d*utvdlL z6>1x1pr0{S$TiMDm6NnD3q?#b(2DHwUsM)qT%die(EKv6tQ9(11~2R2WpCuMh+M0lksKW&i*H literal 0 HcmV?d00001