From 1cfeb7900345b7a74de728d23c2df9ecd0879843 Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski <740168+henrygab@users.noreply.github.com> Date: Fri, 14 Nov 2025 21:06:41 -0800 Subject: [PATCH] automated from `make style` --- client/src/cmdhf14b.c | 8 +++---- client/src/cmdhfmf.c | 2 +- client/src/pm3line_vocabulary.h | 5 ++--- doc/commands.json | 40 +++++++++++++-------------------- doc/commands.md | 11 +-------- 5 files changed, 23 insertions(+), 43 deletions(-) diff --git a/client/src/cmdhf14b.c b/client/src/cmdhf14b.c index 9d22777f1..ea7df2569 100644 --- a/client/src/cmdhf14b.c +++ b/client/src/cmdhf14b.c @@ -2631,15 +2631,15 @@ int CmdHF14BNdefRead(const char *Cmd) { } // take offset from response uint8_t offset = response[1]; - + // Parse CC data uint8_t cc_data[resplen - 2]; memcpy(cc_data, response, sizeof(cc_data)); uint8_t file_id[2] = {cc_data[9], cc_data[10]}; - + uint16_t max_rapdu_size = (cc_data[3] << 8 | cc_data[4]) - 2; - + max_rapdu_size = max_rapdu_size < sizeof(response) - 2 ? max_rapdu_size : sizeof(response) - 2; // --------------- NDEF file reading ---------------- uint8_t aSELECT_FILE_NDEF[30]; @@ -2739,7 +2739,7 @@ int CmdHF14BNdefRead(const char *Cmd) { PrintAndLogEx(HINT, "Hint: Try " _YELLOW_("`hf 14b ndefread -v`") " for more details"); // So far this prints absolutely nothing } - + // get total NDEF length before save. If fails, we save it all size_t n = 0; if (NDEFGetTotalLength(response + 2, resplen - 4, &n) != PM3_SUCCESS) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index c6d6c7694..c7ffab56c 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -5008,7 +5008,7 @@ void printKeyTableEx(size_t sectorscnt, sector_t *e_sector, uint8_t start_sector _YELLOW_("H") ":Hardnested / " _YELLOW_("C") ":statiCnested / " _YELLOW_("A") ":keyA " - " )" + " )" ); if (sectorscnt == 18) { PrintAndLogEx(INFO, "( " _MAGENTA_("*") " ) These sectors used for signature. Lays outside of user memory"); diff --git a/client/src/pm3line_vocabulary.h b/client/src/pm3line_vocabulary.h index 2c894eced..9d99a6486 100644 --- a/client/src/pm3line_vocabulary.h +++ b/client/src/pm3line_vocabulary.h @@ -359,7 +359,7 @@ const static vocabulary_t vocabulary[] = { { 0, "hf mf fchk" }, { 1, "hf mf decrypt" }, { 0, "hf mf supercard" }, - { 1, "hf mf bambukeys" }, + { 1, "hf mf keygen" }, { 0, "hf mf auth4" }, { 1, "hf mf acl" }, { 0, "hf mf dump" }, @@ -511,6 +511,7 @@ const static vocabulary_t vocabulary[] = { { 1, "hf saflok decrypt" }, { 0, "hf saflok interrogate" }, { 0, "hf saflok cksum" }, + { 1, "hf saflok selftest" }, { 1, "hf seos help" }, { 1, "hf seos list" }, { 0, "hf seos sam" }, @@ -550,8 +551,6 @@ const static vocabulary_t vocabulary[] = { { 1, "hf vas help" }, { 0, "hf vas reader" }, { 1, "hf vas decrypt" }, - { 1, "hf waveshare help" }, - { 1, "hf waveshare load" }, { 1, "hf xerox help" }, { 1, "hf xerox list" }, { 0, "hf xerox info" }, diff --git a/doc/commands.json b/doc/commands.json index ec0c14f48..07263b760 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -3256,7 +3256,7 @@ }, "hf help": { "command": "hf help", - "description": "-------- ----------------------- High Frequency ----------------------- 14a { ISO14443A RFIDs... } 14b { ISO14443B RFIDs... } 15 { ISO15693 RFIDs... } cipurse { Cipurse transport Cards... } epa { German Identification Card... } emrtd { Machine Readable Travel Document... } felica { ISO18092 / FeliCa RFIDs... } fido { FIDO and FIDO2 authenticators... } fudan { Fudan RFIDs... } gallagher { Gallagher DESFire RFIDs... } iclass { ICLASS RFIDs... } ict { ICT MFC/DESfire RFIDs... } jooki { Jooki RFIDs... } ksx6924 { KS X 6924 (T-Money, Snapper+) RFIDs } legic { LEGIC RFIDs... } lto { LTO Cartridge Memory RFIDs... } mf { MIFARE RFIDs... } mfp { MIFARE Plus RFIDs... } mfu { MIFARE Ultralight RFIDs... } mfdes { MIFARE Desfire RFIDs... } ntag424 { NXP NTAG 4242 DNA RFIDs... } saflok { Saflok MFC RFIDs... } seos { SEOS RFIDs... } st25ta { ST25TA RFIDs... } tesla { TESLA Cards... } texkom { Texkom RFIDs... } thinfilm { Thinfilm RFIDs... } topaz { TOPAZ (NFC Type 1) RFIDs... } vas { Apple Value Added Service... } waveshare { Waveshare NFC ePaper... } xerox { Fuji/Xerox cartridge RFIDs... } ----------- --------------------- General --------------------- help This help list List protocol data in trace buffer search Search for known HF tags --------------------------------------------------------------------------------------- hf list available offline: yes Alias of `trace list -t raw` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", + "description": "-------- ----------------------- High Frequency ----------------------- 14a { ISO14443A RFIDs... } 14b { ISO14443B RFIDs... } 15 { ISO15693 RFIDs... } cipurse { Cipurse transport Cards... } epa { German Identification Card... } emrtd { Machine Readable Travel Document... } felica { ISO18092 / FeliCa RFIDs... } fido { FIDO and FIDO2 authenticators... } fudan { Fudan RFIDs... } gallagher { Gallagher DESFire RFIDs... } iclass { ICLASS RFIDs... } ict { ICT MFC/DESfire RFIDs... } jooki { Jooki RFIDs... } ksx6924 { KS X 6924 (T-Money, Snapper+) RFIDs } legic { LEGIC RFIDs... } lto { LTO Cartridge Memory RFIDs... } mf { MIFARE RFIDs... } mfp { MIFARE Plus RFIDs... } mfu { MIFARE Ultralight RFIDs... } mfdes { MIFARE Desfire RFIDs... } ntag424 { NXP NTAG 4242 DNA RFIDs... } saflok { Saflok MFC RFIDs... } seos { SEOS RFIDs... } st25ta { ST25TA RFIDs... } tesla { TESLA Cards... } texkom { Texkom RFIDs... } thinfilm { Thinfilm RFIDs... } topaz { TOPAZ (NFC Type 1) RFIDs... } vas { Apple Value Added Service... } xerox { Fuji/Xerox cartridge RFIDs... } ----------- --------------------- General --------------------- help This help list List protocol data in trace buffer search Search for known HF tags --------------------------------------------------------------------------------------- hf list available offline: yes Alias of `trace list -t raw` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ "hf list --frame -> show frame delay times", "hf list -1 -> use trace buffer" @@ -7815,7 +7815,7 @@ }, "hf saflok help": { "command": "hf saflok help", - "description": "help This help encode Encode Saflok card data decode Decode Saflok card data modify Modify Saflok card data encrypt Encrypt 17-byte decrypted block decrypt Decrypt 17-byte encrypted block --------------------------------------------------------------------------------------- hf saflok read available offline: no Read Saflok card (MIFARE Classic only)", + "description": "help This help encode Encode Saflok card data decode Decode Saflok card data modify Modify Saflok card data encrypt Encrypt 17-byte decrypted block decrypt Decrypt 17-byte encrypted block selftest Run self-test --------------------------------------------------------------------------------------- hf saflok read available offline: no Read Saflok card (MIFARE Classic only)", "notes": [ "hf saflok read" ], @@ -7875,6 +7875,18 @@ ], "usage": "hf saflok provision [-h] -d data" }, + "hf saflok selftest": { + "command": "hf saflok selftest", + "description": "Validate internal functionality of Saflok routines", + "notes": [ + "hf saflok selftest" + ], + "offline": true, + "options": [ + "-h, --help This help" + ], + "usage": "hf saflok selftest [-h]" + }, "hf search": { "command": "hf search", "description": "Will try to find a HF read out of the unknown tag. Continues to search for all different HF protocols.", @@ -8438,28 +8450,6 @@ ], "usage": "hf vas reader [-h@v] [--pid ] [-f ] [--url ]" }, - "hf waveshare help": { - "command": "hf waveshare help", - "description": "help This help load Load image file to Waveshare NFC ePaper --------------------------------------------------------------------------------------- hf waveshare load available offline: yes Load image file to Waveshare NFC ePaper", - "notes": [ - "hf waveshare load -f myfile -m 0 -> 2.13 inch e-paper ( 122, 250 )", - "hf waveshare load -f myfile -m 1 -> 2.9 inch e-paper ( 296, 128 )", - "hf waveshare load -f myfile -m 2 -> 4.2 inch e-paper ( 400, 300 )", - "hf waveshare load -f myfile -m 3 -> 7.5 inch e-paper ( 800, 480 )", - "hf waveshare load -f myfile -m 4 -> 2.7 inch e-paper ( 176, 276 )", - "hf waveshare load -f myfile -m 5 -> 2.13 inch e-paper B (with red) ( 104, 212 )", - "hf waveshare load -f myfile -m 6 -> 1.54 inch e-paper B (with red) ( 200, 200 )", - "hf waveshare load -f myfile -m 7 -> 7.5 inch e-paper HD ( 880, 528 )" - ], - "offline": true, - "options": [ - "-h, --help This help", - "-m model number [0 - 7] of your tag", - "-f, --file specify image to upload to tag", - "-s, --save save paletized version in file" - ], - "usage": "hf waveshare load [-h] -m -f [-s ]" - }, "hf xerox dump": { "command": "hf xerox dump", "description": "Dump all memory from a Fuji/Xerox tag ISO/IEC 14443 type B based communications", @@ -13701,6 +13691,6 @@ "metadata": { "commands_extracted": 785, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2025-11-10T17:48:24" + "extracted_on": "2025-11-15T03:41:46" } } diff --git a/doc/commands.md b/doc/commands.md index 9bf0f776a..fde136f36 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -722,6 +722,7 @@ Check column "offline" for their availability. |`hf saflok decrypt `|Y |`Decrypt 17-byte encrypted block` |`hf saflok interrogate `|N |`Interrogate saflok card` |`hf saflok cksum `|N |`Generate checksum for data block` +|`hf saflok selftest `|Y |`Run self-test` ### hf seos @@ -819,16 +820,6 @@ Check column "offline" for their availability. |`hf vas decrypt `|Y |`Decrypt a previously captured VAS cryptogram` -### hf waveshare - - { Waveshare NFC ePaper... } - -|command |offline |description -|------- |------- |----------- -|`hf waveshare help `|Y |`This help` -|`hf waveshare load `|Y |`Load image file to Waveshare NFC ePaper` - - ### hf xerox { Fuji/Xerox cartridge RFIDs... }