- Remove wall-of-text comment block (moved to PR description)
- Simplify output: "Genuine" vs "Weak" per Iceman's feedback
- Remove explanatory INFO line
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The existing mfulc_fingerprint() detects known counterfeit families
(Lab401 DW, Feiju FJ8010, USCUID-UL v1/v2, Giantec GT23SC4489,
Hospitality) by their deterministic command and CRC tells, returning
early on a match. This commit adds a generic weak-PRNG catch-all for
clones that evade those fixed profiles.
mfulc_prng_test() runs on the genuine-looking fallthrough, right before
the "likely MF0ICU2" verdict. It collects RndB nonces via repeated 1A00
auth starts and flags a duplicate:
- Genuine NXP draws RndB from a hardware TRNG (2^64 space), so it
never repeats across a realistic batch.
- Giantec/USCUID use a 16-bit LFSR whose wakeup-timing seed
concentrates the observed pool to roughly 2^6.5, so a duplicate
appears within 12 authentications.
A single collision is proof of a weak PRNG. This backstop catches
weak-RNG clones, including future variants the profile table does not
know. MFULC_PRNG_SAMPLES (40) and MFULC_PRNG_CLEAR (39) are tunable.
Tested on genuine NXP MF0ULC (UID 04 1C BE 92 E7 7A 80): 40 unique
nonces, no collision, verdict "consistent with a genuine TRNG".
Ref: "BREAKMEIFYOUCAN!", eprint.iacr.org/2026/100, Section 11.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012e7xUDfDUXJQU7SWV3ULS1
The sum of y2, y4, y7, y8, y10, y11, y14 and y16 comes from a 2014
forum post that says "I believe", and with fc bit 6 added it still
missed one of the seven genuine Indala cards now on record (FC 20 CN
9045). The same post gives Keri 26-bit W as the same calculation with
"11" and "00", and five such cards are on record. Adding fc bits x1,
x2, x3, x5, x6 and x7 fits all twelve. With these card number bits and
"01" for an even sum, no other fc set does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three more genuine cards came to light in the repository traces. The
checksum over the card number bits alone matched three of the five,
with fc bit 6 in the sum it matches all five.
Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
The sim sent ATQA 02 00 for 4, 7 and 10 byte UIDs, because the ATQA
override replaces the size bits the firmware sets. The PN533 of an
SCL3711 stopped after cascade level 1 and never found a 7 or 10 byte
UID. The ATQA now codes the size of the UID the device simulates, 4
bytes from emulator memory when the UID is all zero, and the start
message says when that happens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clone took negative FC and CN, and MS values above 5 and 22 bits,
without a word: MS FC 40 wrote the card of FC 8. sim let ids of 32
bits or more change the fixed bits, so --id 2147483648 simulated id 0,
and printed the shifted frame as Internal Id. The sim help example
used --cn, the option is --id, and the clone hint named lf keri read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clone and sim accepted FC up to 999 and CN up to 99999, but the frame
holds 8 bits of FC and 16 of CN, so FC 300 wrote the card of FC 44.
The clone hint also named lf paradox read, which does not exist.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR #2453 computed the parity bits over stream positions and PR #2947
inverted the checksum, so --fc/--cn clones did not match the genuine
cards on record, from issue #2939 and the DangerousThings forum. Both
carry the 26-bit Wiegand parity of getIndalaBits4041x and the checksum
from before #2947, and the encoder now reproduces them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HPP32 wrote its card number 10 bits past the 32-bit frame, it now uses
bits 13-30 as cardinfo shows. H10320 wrote its first digit over the
leading one, so decode refused most numbers, and two of its parity
masks had typos. S12906b needed ParityValid, which no caller sets.
HGen37 decode checked bit 28 instead of 26. The limits of nine formats
did not match the fields Pack writes. wiegand list printed the usage
of wiegand info.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A NULL TLV has no length, so a run of them swallowed the TLVs after
it. Lock and Memory Control sizes of 0 mean 256, the nibbles of their
third byte are powers of two and the Memory Control size counts bytes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enter leaves a simulation running on the device, by design. The next
hf thinfilm sim stopped it, took the PM3_EOPABORTED reply left behind
for its own and printed "Done!" at once. A ping round trip before
starting drops that reply.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeQL installs its packages with apt and stalls on
azure.archive.ubuntu.com like the Ubuntu jobs did
(actions/runner-images#14823). #3747 left this workflow out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The values went through uint8_t or & 0xFF, so --max 300 ran with 44
and --samples 1000 with 232. The --fs clocks stay 8-bit in the FSK
demod and are now refused above 255.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since cd5906674 the flash animation runs whatever stdout is, and a
redirected flash of fullimage.elf wrote a 7 MB log.
flash_pm3() replaced a flash error with the result of
flash_stop_flashing(), always PM3_SUCCESS, so a failed flash ended with
"All done". main() exited 0 after --flash, --dumpmem and
--reboot-to-bootloader whatever happened. dumpmem printed its negative
error code with %u.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
actions/checkout v6 hands the Windows path of its credentials config to
git config --unset as a regex, which MSYS2's git rejects in the
ProxSpace job (actions/checkout#2528, fixed in v7.0.1). The
persist-credentials: false added for it did not help and is dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Ubuntu jobs drop azure.archive.ubuntu.com from the runner's mirror
list. It sometimes serves at tens of kB/s, held apt-get install for up
to 50 minutes and apt never fails over (actions/runner-images#14823).
The ProxSpace job no longer asks for arm-none-eabi-gdb, which MSYS2
replaced with gdb-multiarch in 2023, and no longer persists the
checkout credentials, whose cleanup failed with MSYS2's git on PATH.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mfulc_des_brute added the Homebrew openssl@3.6 include directory, which
the macOS runners no longer have, and -Wmissing-include-dirs under
-Werror stopped the build. It now uses brew --prefix openssl, as #3734
did for mfd_aes_brute.
Since MSYS2 filesystem 2026.10.18 /etc/profile runs post-install
scripts on the first start only, so ProxSpace never installed its
packages and the build found no arm-none-eabi-gcc. The workflow now
runs ProxSpace's setup script when setup\installed is missing.
The third mfulc_des_brute test in pm3_tests.sh is now labelled 3/3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
caa76f57b ("Fix pm5 recovery image") also moved the AT91 pad from
0x00102000 to 0x00104000, but the AT91 boot area is 8 KB and the OS
image starts at 0x102000. recovery.bin had every fullimage section
0x2000 too high and 0xFF at the OS entry, so a JTAG recovery would
leave the bootrom in flash mode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gen2 branch refused `-u` with "Not supported on this card". These
cards do take a UID write: a five command knock, the new UID one byte
per command (always seven commands, zero padded), then a HLTA which
commits it. The card answers the halt instead of staying silent, and
without it everything before is discarded when the field drops - which
is why the sequence is absent from the vendor app, whose HLTA is emitted
by the Android NFC stack on teardown.
The new UID must match the card's current UID length, the parts are
physically 4b or 7b. Outcome is decided by re-selecting and comparing
the UID, not by the status byte.
Verified on a 4 byte card. The 7 byte path is inferred from the sequence
always carrying seven UID bytes and is untested.
A refused -r / -u now returns an error instead of PM3_SUCCESS.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>