hf mf: split HID and VIGIK decoding into client/src/parsers/
The shared viewer had the VIGIK sector assembly inlined, and the HID PACS decode sat in hf mf mad's file branch where hf mf view and hf mf dump --ns could not reach it. Neither scheme had a home of its own. Give each one a parser next to parsehrt.c, same shape as that one - an is_valid_x_card() detector and an x_parser_parse() that prints: parsers/parsehid.c MAD aid 0x484d, PACS sector, Wiegand decode parsers/parsevigik.c MAD aid 0x4910/0x4916, sector assembly parsevigik.c also takes vigik_get_service(), vigik_verify() and vigik_annotate() out of mifare/mifarehost.c, 306 lines that were VIGIK only with a single caller. mf_view_dump() is now two detector calls, so hf mf view -f and hf mf dump --ns both decode a HID credential off a live card for the first time, and adding a scheme is a new file plus two lines. hf mf mad -f keeps its HID decode through the same parser. The sector copy in the VIGIK path gains a bounds check; a MAD entry pointing past the end of a short dump used to read past the buffer. All three source lists get the new files: client/Makefile, client/CMakeLists.txt and client/experimental_lib/CMakeLists.txt. The library one matters because vigik_annotate() moved; without it anything linking libpm3rrg_rdv4 loses the symbol. hf mf mad against a card still cannot decode PACS. It authenticates with the MAD key alone and never reads the application sector, so it has no credential bytes to work with - unchanged here. Co-Authored-By: Claude Opus 5 (1M context)
This commit is contained in:
1 parent
f0b569b507
commit
a9105c5089
11 files changed
+568
-383
No files matched your search
@@ -905,6 +905,8 @@ SRCS = mifare/aiddesfire.c \
|
||||
mifare/gen4.c \
|
||||
nfc/ndef.c \
|
||||
parsers/parsehrt.c \
|
||||
parsers/parsehid.c \
|
||||
parsers/parsevigik.c \
|
||||
parsers/hrtparser/hrtparser.c \
|
||||
pm3.c \
|
||||
pm3_binlib.c \
|
||||
|
||||
Reference in new issue
Block a user