Commit Graph
246 Commits
Author SHA1 Message Date
iceman1001andClaude Opus 5.5 c546b70d12 hf 15 dump: don't show or save unread blocks as data
After two failed reads of a block the dump loop ends, but the table was
still printed for every block the tag reports, from a buffer that is
zero where nothing was read, the command returned PM3_SUCCESS, and
without --ns that table was saved as the dump. A card with genuine zero
blocks makes the difference impossible to see. On a PM5 before 05c21a33b
every dump of an EM4233 read block 0, failed on block 1 and printed all
52 rows.

A dump that stops early now prints only the blocks it read, says
"Dump incomplete, read X of Y blocks, not saved", saves nothing and
returns PM3_EPARTIAL.

The tag answering 0x0F/0x10 is different: that is the existing end of
memory heuristic, used when SYSINFO gave no size and 128 blocks were
assumed. The block count now becomes what the tag actually holds, so
the dump stays complete and no rows past the real end are shown.

Behaviour change: an interrupted dump exits PM3_EPARTIAL instead of 0
and writes no file. A complete dump is unchanged.

Tested on a PM5 with an EM4233 (52 blocks), the pre-05c21a33b firmware
serving as a source of genuine read failures:
- fixed firmware, 1-of-4 and 1-of-256: 20/20 complete, exit 0
- failing firmware, 1-of-4: 15/15 "read 2..14 of 52 blocks, not saved",
  only those rows printed, exit PM3_EPARTIAL; without --ns no file
- the end of memory path was not reached: this tag reports its size in
  SYSINFO

Builds clean with gcc and clang.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:20:43 +07:00
Jean-Michel PicodandGemini f233475c5b hf 15: label AFI 0x30 as Secura Key e*Tag
Annotate AFI `0x30` as Secura Key e*Tag in `CmdHF15Info()` and
`print_tag_15693()`.

Co-Authored-By: Gemini <noreply@google.com>
2026-11-11 12:13:14 +01:00
iceman1001andClaude Opus 5.5 a9a5b1ac51 hf 15 implant: read NTAG 5 link + TMP112/TMP117/TMP119 temperature implants
New client command for VivoKey Thermo / Temptress style implants. The
NTAG 5 link (NTP5332) is used as I2C master: energy harvesting is enabled
through the EH_CONFIG_REG session register (AN12365), the TI sensor is
driven with WRITE I2C / READ I2C / READ SRAM and the I2C master status
register is polled for completion and NAKs. Sensors at 0x48-0x4B are
probed and identified by the TMP117/TMP119 device id register, a one-shot
conversion is triggered and the result printed in C and F.

Pure client side, uses CMD_HF_ISO15693_COMMAND with the field kept on.
Offline self test for the conversions is hooked into pm3_tests.sh, and
hf 15 info hints at the command for NTAG 5 tags.

Not tested on hardware, no implant available.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:59:50 +07:00
歐歪andClaude Opus 5 12b0143f46 fix: hf 15 cfinalize does not erase the tag memory
The help text and the -y warning said finalize erases the whole tag memory
to 00000000. A dump of a tag before and after finalize shows otherwise: the
configuration blocks are cleared, but user data is relocated rather than
erased. Data written to block 0x38 before finalize read back at block 0x20
afterwards.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 22:51:14 +08:00
歐歪andClaude Opus 5 14a5de0bdf fix: let the device verdict decide the outcome of hf 15 csetuid
The client only inspected PM3_EWRONGANSWER and then re-verified with its own
getUID(), which asks whether the tag carries the requested UID, not whether
this command wrote it. Running csetuid --v3 twice with the same UID printed
"Setting new UID ( ok )" on the second run even when the device had reported
PM3_ESOFT, because the UID written by the first run still matched.

Gen1 and V3 now switch on the device status, which already covers tag
identification and UID verification. V2 keeps the client side comparison,
the device does neither for it. PM3_ETIMEOUT is handled as well, cfinalize
already did that.

The cfinalize help text and its confirmation warning said the configuration
area is erased. Finalize erases the whole tag memory to 00000000.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 21:08:18 +08:00
歐歪 dfa3255fd6 fix: refine hint messages for V3 tag finalization status 2026-09-22 16:30:43 +08:00
歐歪andClaude Opus 5 f0a502b279 refactor: move ISO15693 magic tag handling to the device side
Identification, writing and failure handling for magic Gen1 and V3 tags
now runs in a single field session on the device, which reports
PM3_SUCCESS only when the UID reads back as requested.

armsrc/iso15693.c:
- SetTag15693Uid() probes 0x38/0x39/0x3E/0x3F and refuses to write when
  any of them answers with data, verifies the UID afterwards and blanks
  the four blocks again when it did not change.
- SetTag15693Uid_v3() and FinalizeTag15693_v3() are new, both check the
  0x14/0x15 configuration signature before writing and verify after.

client/src/cmdhf15.c:
- csetuid and cfinalize now only select a command and print the status.
  The V3 block helpers and constants move to armsrc, which restores the
  original read helper with its CALLOC message and the
  ISO15_ERROR_HANDLING_* macros.

Behaviour change: hf 15 cfinalize without -y no longer energizes the tag
and no longer reports configuration mode before asking for confirmation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 07:04:16 +08:00
歐歪andClaude Sonnet 5 e74bb0f2e5 fix: 15693 csetuid v1 probe, single session write and safer rollback
- probe: only no answer / block not available count as unreadable, other read errors abort
- 69960000 is only accepted in 0x3F, the other blocks must be blank
- write 0x3E/0x3F/0x38/0x39 in one RF session
- rollback only when the tag still shows its original UID, message lists all four blocks

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 03:25:47 +08:00
歐歪 cd24d8b0b0 fix: rewind if 0x38 0x39 write fails 2026-09-21 18:27:45 +08:00
歐歪 f7a9682a9e fix: silent v1 pre-check and refine the commands 2026-09-21 18:06:42 +08:00
歐歪 473dcb0aa5 fix: v1 tag probing fail message clear 2026-09-21 17:34:37 +08:00
歐歪 e1e023ea61 feat: 15693 csetuid v1 v3 check before write 2026-09-21 17:11:23 +08:00
Philippe Teuwen 634edd11fd make style 2026-09-16 19:00:50 +02:00
iceman1001 9caa6d6117 minor change we device now reports back EMULATOR memory size to the client. Had to bump capability version number to 11. 2026-09-14 12:16:51 +02:00
Philippe Teuwen 0cde2124c8 Replace pm3_max_cmd_data_size() by g_conn.max_cmd_data_size 2026-09-01 17:58:14 +02:00
Niel Nielsen 9f0171a706 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-01 17:57:31 +02:00
iceman1001 35c098d489 make style 2026-08-29 17:42:29 +02:00
iceman1001 0ae01a5331 new ISO15693 dump file format with converters added. Needed since 0x100 pages and 8 byte blocks is possible 2026-08-29 11:19:39 +02:00
歐歪 2362cabcd4 Add ISO15693 magic 'V3' tag support (hf 15 csetuid --v3 / hf 15 cfinalize) 2026-08-17 10:26:09 +02:00
iceman1001 6411ba1ee4 add 2026-07-30 17:06:36 +02:00
iceman1001 cd6d3c4665 ansi escape sequences 2026-07-28 15:53:20 +02:00
iceman1001 2c6e607110 style 2026-07-15 16:39:15 +02:00
歐歪 c2cd37025b Add ISO15693 magic 'V3' tag support (hf 15 csetuid --v3 / hf 15 cfinalize) 2026-07-14 04:22:00 +08:00
iceman1001 07b3491346 fix coverity resource leak #910743 2026-07-03 11:51:45 +02:00
iceman1001 52fc106027 fix coverity #910570 2026-07-03 11:40:45 +02:00
Philippe Teuwen 5666cdf4e8 make style 2026-06-23 00:03:16 +02:00
michaelandClaude Opus 4.8 e380bc09e4 hf 15 reader --all -@: live presence table for continuous inventory
Continuous 16-slot inventory now shows a persistent, in-place presence table: one row
per UID seen this session (kept as rows, never removed), redrawn in place each scan with
present / gone (Ns ago) status and a present/total count.

Also keep the RF field up across scans in continuous mode (drop it once on exit) instead
of re-initialising every round -- faster, and avoids per-scan 'Setting ISODEP' churn when
APDU logging is enabled. Fix the reader help text (the polling loop exits on Enter, not
the pm3 button).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 14:54:00 -07:00
michael 9a4fcf2140 hf 15 reader: 16-slot anti-collision inventory (--all)
Add ISO 15693 16-slot inventory with anti-collision tree-walking, reachable via 'hf 15 reader --all'; single-tag reading stays the default. The firmware steps the 16 slots with EOF markers and flags 'signal but no decode' slots as collision hints; the client walks the UID mask tree, validates CRC per slot to confirm real collisions, and dedups discovered tags. Single-tag reading (default) and 16-slot inventory (--all) both run under hf 15 reader.
2026-06-08 14:54:00 -07:00
iceman1001 cbb572afad style 2026-05-11 14:36:17 +02:00
Benjamin DELPY d21e87eafe Update cmdhf15.c tu support ICODE DNA & ICODE 3 in hf 15 info command
including asking for signature

Signed-off-by: Benjamin DELPY <benjamin@gentilkiwi.com>
2026-04-30 22:56:38 +02:00
Benjamin DELPY c84170328c Update cmdhf15.c to add ICODE DNA & ICODE 3 to UID mapping
Signed-off-by: Benjamin DELPY <benjamin@gentilkiwi.com>
2026-04-30 22:52:16 +02:00
Philippe Teuwen 88d20bd4f2 make style 2026-04-13 09:35:02 +02:00
Peter S. Hollander 34a3ae0fed Merge upstream branch 'master' 2026-03-24 10:54:30 +00:00
Peter S. Hollander 422b3b7473 Preserve default flow 2026-03-24 10:53:13 +00:00
Peter S. Hollander 070211be1b Add --timeout to hf 15 sim 2026-03-17 12:54:14 +00:00
iceman1001 b801cddf13 fix @zerochaos compiler warning 2026-03-13 12:33:47 +07:00
Philippe Teuwen 128af38ec4 small bug in hf 15 originality check 2025-09-22 23:37:36 +02:00
iceman1001 7373c38388 hf 15 dump had an logic bug when reading the sysinfo response. It is always fixed size but the logic for handling the Information byte flags made it skip bytes when it wasnt 0x0F 2025-07-02 22:05:12 +02:00
iceman1001 21bae5c73f fix hf 15 readmulti - wrong block count number. It is decreased before to be zero based, but in calc we need number of blocks 2025-07-01 16:45:18 +02:00
iceman1001 16cbb4a446 style 2025-06-30 14:28:24 +02:00
Jean-Michel Picod 6c402791f1 Fix comma instead of semicolon 2025-06-27 12:04:27 +02:00
Jean-Michel Picod 3625ee318a Fix SEGV in cmdhf15 due to argtable size being miscomputed 2025-06-27 11:57:26 +02:00
Philippe Teuwen c3a7a11ae7 change iso15693 nxp originality check from PK_MFC to PK_15 2025-04-24 22:23:35 +02:00
iceman1001 875b3c44b4 unify text - step 1 2025-03-25 10:12:16 +01:00
Philippe Teuwen f90d11912c cppcheck unused struct 2025-03-24 22:10:55 +01:00
Philippe Teuwen c37ca881e6 a few calloc checks, still many to go 2025-03-24 11:17:40 +01:00
iceman1001 4d603a4530 unify hint text 2025-03-20 22:55:26 +01:00
iceman1001 17a8f0f9c2 text 2025-03-20 12:17:37 +01:00
iceman1001 fd0311b139 style 2025-03-11 09:21:01 +01:00
leecher1337 0e2a02bdf0 Implement new command hf 15 slixprotectpage to do ISO15693_PROTECT_PAGE on slix tags 2025-03-09 11:54:51 +01:00