Commit Graph
22640 Commits
Author SHA1 Message Date
iceman1001 bbc8cc25b2 OLD/MIX convert to NG, Phase B 2026-08-29 13:30:07 +02:00
iceman1001 99c58f9dea NG: iso14a_raw_cmd_t, convert hf 14a raw, dual-mode reader handler. A multi step process, this is the first step. Thanks Claude 2026-08-29 13:06:28 +02:00
iceman1001 795d6f6fe3 simplify hf em 4x50 eload. all fits in one usb package 2026-08-29 12:48:20 +02:00
iceman1001 d71ee36996 reserve space for cmd struct and proper available space 2026-08-29 12:47:13 +02:00
iceman1001 7bfbde93fc widen detection for flipper ultralight dump files 2026-08-29 12:36:59 +02:00
iceman1001 2677ee541e added support for flipper iso15693 .nfc dump files. Thanks Claude 2026-08-29 12:33:05 +02:00
iceman1001 b3048064f6 converted CMD_LF_EM4X50_ESET to NG frame, thanks Claude 2026-08-29 12:20:56 +02:00
iceman1001 899ad1d467 NG: retag bootloader CMD_PING as SendCommandBL 2026-08-29 11:28:55 +02:00
iceman1001 d7ed0d5a96 NG: convert CMD_LF_T55XX_SET_CONFIG to t55xx_setconfig_t 2026-08-29 11:28:29 +02:00
iceman1001 0dc844ace6 text 2026-08-29 11:19:56 +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
iceman1001 80388c8fea adapt tear off parameter to handle limits correct 2026-08-29 06:53:58 +02:00
iceman1001 9b61ef867c fix SpinDelayUsPrecision() clock, no more wrapping 43ms> issues. Still capped at 1390ms. This affects a bunch of tearoff attacks 14b especially win 100ms actually being 16ms wrapped. Should be handled according to new HAL layer. Next things is rate renegotiated at reconnect for sim module. Makes things a more stable if something fails. Thanks Claude! 2026-08-29 06:42:17 +02:00
iceman1001 41c1809404 less dropfield means less complete select... 2026-08-28 23:04:53 +02:00
iceman1001andClaude Opus 5 cb48c928a5 hf felica: make reading actually work
FeliCa reading was broken on every card tested: 'hf felica reader' returned PM3_ETIMEOUT while the tag was answering correctly. The cause was in the FPGA demodulator, not the ARM.

fpga/hi_flite.v
---------------
Adaptive hysteresis thresholds. The envelope tracker clamped curmin to <= 70 and curmax to >= 180, so curminthres/curmaxthres were pinned near 91/160 no
matter where the signal actually sat. Measured on a RDV4 with the field on, the peak detector idles near 112 and a tag swings it by about +/-35, ie entirely
inside that window - so nothing ever crossed a threshold and every frame demodulated as a constant. The band is now derived from the tracked envelope,
3/16 of its span, floored at +/- 8 to stay clear of the 4..6 counts of carrier ripple.

Matched-filter bit detector. The slicer counted comparator trips (+1 above curmaxthres, -1 below curminthres, repeat the last crossing direction inside
the dead band), so every bit depended on where the band happened to sit. A mispositioned band railed the output to a constant and, since only the stable
branch can recompute thresholds or desync, it stayed that way for the rest of the session. It also discarded amplitude, gaining nothing from 32x
oversampling. Each half-bit is now integrated in the ADC domain and the larger half wins. Thresholds still drive bit phase and the desync, they no longer
decide bit values, so a clipped or mispositioned envelope can no longer rail the output.

Polarity lock guard. try_sync arms part way through a half-bit, so the first decision after arming is meaningless and could latch 'zero' inverted, decoding
the whole frame with the wrong polarity and losing the sync word. Skip the first two decisions; the preamble is 48 bits.

curbit re-timing. The bit decision was made in the bit-phase domain, which is aligned to the tag's edges, but sampled by the SSC in the carrier domain. The
ARM could latch a bit mid-transition at a phase that varied per frame. Both run at 64 carrier periods per bit, so re-timing curbit half an SSP bit away from the
sampling edge is a re-time, not a resample.

Envelope watchdog. FPGA registers persist across PM3 commands - only a bitstream reload clears them - so the tracker could enter a state it never left and the
first command after the client started would work while every one after it failed. Force a re-centre when the demodulator has not reached a known-good idle
for 19.3 ms, held off at the start of each frame so it cannot fire mid-reply.

state is marked (* fsm_extract = 'no' *). The project synthesises with -fsm_style bram; once XST recognised this register as a state machine it placed
the state ROM in a block RAM, and the xc2s30's six were already spoken for. MAP then failed to fit with nothing but a generic 'design is too large' error, no
BITGEN, and no new bitstream.

armsrc/felica.c
---------------
- felica_select_card() returning 4 (response too short for IDm+PMm) fell through to PM3_SUCCESS, so 'hf felica reader' reported an all-zero IDm as a good read.
- After a poll timeout the code still read FelicaFrame; with a stale POLLING_RES and len == 0, check_crc() was handed (len - 2) as a size_t, ie 65534.
- WaitForFelicaReply() could only time out from STATE_UNSYNCD/TRYING_SYNC and would spin forever if a frame never completed.
- felica_sniff() decremented and broke before LogTrace, so '-s 10' logged nine frames and '-s 0' logged none. CRC-failed noise no longer pollutes the trace.
- felica_sendraw() sent no reply at all for some flag combinations, leaving the client blocked until its own timeout.
- Polling used time slot 0 only, so several cards in the field collided forever. Retries now widen the TSN window.
- BuildFliteRdblk() warned about a bad block count and built the frame anyway.

Signal probe
------------
'hf felica raw -p' streams the per-window envelope min and max instead of demodulated bits, so reading distance and coupling can be measured rather than
guessed. This is what told 'tag out of range' apart from 'demodulator not locking', which are otherwise identical from the ARM's point of view.

Measured on a RDV4, both cards previously unreadable:
  FeliCa Standard RC-S830 (CJRC 0003): reader 4/4, info 4/4, 39 nodes discovered, dump complete in 2.0 s, 37/40 single polls.
  FeliCa Standard RC-S962 (Octopus 8008): reader 10/10, 23 nodes discovered, dump complete in 1.5 s, 40/60 single polls. This one drives the envelope onto the bottom ADC rail; the matched filter reads it anyway.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 22:35:08 +02:00
Philippe Teuwen ff6954f8a6 First attempt at providing guidance to LLMs, don't hesitate to try it out 2026-08-28 15:17:11 +02:00
MsprgandClaude Fable 5 d852118de5 client: build the tab completion vocabulary at runtime from the command tree
Tab completion used a generated table (pm3line_vocabulary.h, refreshed by
hand via `make commands`) that drifted from the real command tables: new
commands were missing (e.g. `hw bwm*`), removed ones lingered, and the
"offline" flag depended on the platform of whoever regenerated it
(IfPm5() returns true offline on PM5 builds).

Build the vocabulary at startup instead:

- cmdparser: add walkCommandsRecursive(), a tree walk using a fourth
  internal sentinel (XX_internal_command_walk_XX) next to the dump ones.
  It hands each leaf to a visitor as its command_t chain (ancestors +
  leaf). A dispatch counter detects entries shown like a category but
  with their own parser (reveng) and reports them as leaves.
- pm3line_vocabulary: dynamic vocabulary holding the IsAvailable()
  predicates of every command and its ancestor categories, so completion
  applies exactly the rule CmdsHelp() uses, live, for both offline and
  connected devices. Script entries ("script run <relpath>") come from
  the same directories `script list` scans, sorted, including
  subdirectories with the path `script run` needs.
- pm3line: readline and linenoise completers consume the live vocabulary.
  The walk runs with output disabled so category handlers stay silent.
- Drop pm3_help2list.py and the header regeneration from `make commands`.

Behaviour change: entries whose category is hidden by `help` (e.g. `mem`,
`usart` offline) are no longer offered, matching `help`; when connected,
commands the device does not support are no longer offered either.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 14:29:04 +02:00
Shaw InnesandClaude Opus 5 b6e9d48a35 Fix standalone mode button trigger on non-PM5 platforms
The 1-second button hold that launches a standalone mode has been a
no-op on every platform except PM5 since e3511c535 ("Used HAL layer").

That commit repurposed the long press as a power-off gesture for PM5,
but commented out the RunMod() call unconditionally while guarding only
the new power-off code with #ifdef PM5. On PM3 builds the BUTTON_HOLD
branch therefore compiles down to an empty block, leaving CMD_STANDALONE
(the client's `hw standalone` command) as the only remaining entry point
to a standalone mode -- which defeats their purpose, since standalone
modes exist to run without a host attached.

Restore the call under #ifndef PM5 and move the PM5 power-off code to
the #else branch, matching the guard style used elsewhere in the same
commit.

Verified: PM3RDV4 and PM3GENERIC images now have two RunMod call sites
(AppMain + CMD_STANDALONE); PM5 still has one and retains its power-off
path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 14:16:02 +02:00
Niel Nielsen bd52734774 Modify PLATFORM_EXTRAS comments in Makefile
Updated commented PLATFORM_EXTRAS options for clarity.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Niel Nielsen 755fdc7c7a Implement low-battery shutdown and update comments
Added support for low-battery shutdown features and updated comments for clarity.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Niel Nielsen d35ddce206 Update low-battery options in Makefile.hal
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Niel Nielsen 98abc5d5f7 Clarify low-battery options in Makefile.hal
Updated comments for clarity on low-battery options.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Niel Nielsen b7b20ef698 Update Makefile with PLATFORM_EXTRAS comments
Added comments for PLATFORM_EXTRAS options in Makefile.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 14:14:29 +02:00
Philippe Teuwen a6b4107066 Add --on to hw bwmcharge, same syntax as hw bwmautooff 2026-08-28 13:17:05 +02:00
Niel Nielsen c2aec48b49 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 4cf2e83c3a Add support for BWM charger, buzzer, and RGB indicator
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 2535307642 Add BWM charger and PM5 RGB indicator support
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 4ec53ea2e6 Add newline at end of appmain.c
Fix missing newline at end of file

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 767f7b2531 Refactor battery management functions and integrate buzzer
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen e9688db826 Refactor BWM_WIFI command handling logic
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen b3fc31f58f Fix header file formatting and add missing defines
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 33535330e1 Enhance WiFi command with stop option and error messages
Updated command handling for WiFi configuration to include a stop option and adjusted error messages accordingly.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen fd2cfbd194 Define DHCP wait and poll times in bwm_wifi.h
Added definitions for DHCP wait and poll times.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Niel Nielsen 26cb7495a6 Adjust DHCP wait time and improve IP handling
Increase DHCP wait time to accommodate slower hotspots and improve IP acquisition reliability.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-28 13:10:24 +02:00
Philippe Teuwen f08792fef0 Add -n to hf 14a reader 2026-08-28 10:29:26 +02:00
Iceman 9a2ba4f5d6 Merge pull request #3542 from Antiklesys/master
Fixing bugs from 76181dfb8 and 377d7cd61
2026-08-28 13:07:14 +07:00
Antiklesys f5dc8ab42f FIxing bugs from 76181dfb8 and 377d7cd61
FIxing bugs from 76181dfb8 and 377d7cd61 breaking secure channel operations
2026-08-28 13:43:11 +08:00
iceman1001 77a9f45db6 texts 2026-08-28 01:16:30 +02:00
iceman1001 377d7cd612 since it still felt a bit slow, Claude came up with the idea of burst mode transfers. A new sim module firmware 'sim022.bin' and we now can auto-negotiate for TA1 = 0x95 which give us 125 000 bits/s which is almost 10x from the 10752 bits/s we were doing before. Thanks Claude! 2026-08-28 01:16:11 +02:00
Iceman 9c962ed537 Merge pull request #3541 from Msprg/fix-install-simfw
Fix make install after sim014 firmware removal
2026-08-28 05:23:53 +07:00
Iceman d92ae331b3 Merge pull request #3540 from Msprg/felica-argtable-longopt
hf felica liteauth: use NULL instead of "" for options without a long name
2026-08-28 05:23:08 +07:00
Msprg 2d898d31e7 fix make install after sim014 firmware removal
e2cf7dee5 removed sim014.bin but the top-level Makefile still lists it
in INSTALLSIMFW, so 'make install' fails on cp. Install sim020 instead,
and point the pm3_tests.sh existence check at the same file.
2026-08-27 23:55:50 +02:00
MsprgandClaude Fable 5 f2c214722c hf felica liteauth: use NULL instead of "" for options without a long name
argtable treats the long option field as a string to scan; an empty
literal makes arg_parse() read one byte past it. AddressSanitizer flags
it as a global-buffer-overflow whenever the command's help is built,
e.g. on every `proxmark3 --fulltext`. Every other command in the client
passes NULL here.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 23:34:45 +02:00
Niel Nielsen 4353c0bb8c Implement low-battery beep functionality
Added low-battery audible warning feature with buzzer control and checks for battery status.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 23:02:46 +02:00
iceman1001 e2cf7dee5f clean up old firmware files 2026-08-27 22:40:50 +02:00
iceman1001 7bdd6760a2 maur 2026-08-27 22:37:59 +02:00
iceman1001 76181dfb8e sim module firmware is now v4.60, (sim020.bin) it adds a better drain when T=0 exits abnormal (abort). Better waiting time floor, with faster ETU which doesnt shrink with WWT.\n Changes to i2c with SDA timings, also modified the fixed msleep(100) with an idle time waiting which leads to 107 ms off from every iteration.\n Added a ATR cache to remember which TA1 was autonegotiated. This impact i2c comms speed with sim module for same card. 'smart pps' is better documented.\n The sam_common.c now also logs 61xx and GET_RESPONSE :) and generic long-form ASN-1 lengths. trace list -t 7816 now also shows rdr frames in us. \n All in all, this should lead for 'emv reader -w' to go from 5.87sec to 2.78sec. 'hf seos sam' is down to 1.92sec. 'hw ping' is down to 0.57sec. A USB round trip is down from 20.8ms to 1.3ms. It should give a snappier end user experience 2026-08-27 22:37:32 +02:00
Niel Nielsen d996b75578 Update BWM-USAGE.md for clearer power-off instructions
Clarified note regarding auto power-off behavior and usage.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 21:15:24 +02:00
Niel Nielsen 96d9a5de9a Update description for hw bwmautooff command
Clarify the behavior of the auto power-off feature.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-27 21:09:06 +02:00
Niel Nielsen f92d4714df Merge branch 'RfidResearchGroup:master' into WIFI-test 2026-08-27 21:07:23 +02:00