From 8ab2f2b5a0987159fd6f6a6e7183bf32a750fb4d Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 12 Aug 2025 19:06:38 +0200 Subject: [PATCH] style --- client/src/cmdhffelica.c | 20 ++++++++++---------- client/src/pm3line_vocabulary.h | 2 +- doc/commands.json | 20 ++++++++++++-------- doc/commands.md | 2 +- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/client/src/cmdhffelica.c b/client/src/cmdhffelica.c index 300887c42..5c48bbefe 100644 --- a/client/src/cmdhffelica.c +++ b/client/src/cmdhffelica.c @@ -2311,7 +2311,7 @@ static int send_rd_multiple_plain(uint8_t flags, uint16_t datalen, uint8_t *data return PM3_ERFTRANS; } - uint8_t block_data[FELICA_BLK_SIZE*4]; + uint8_t block_data[FELICA_BLK_SIZE * 4]; memset(block_data, 0, sizeof(block_data)); uint8_t outlen = 0; @@ -2453,13 +2453,13 @@ static int write_with_mac( const uint8_t blk_number, const uint8_t *block_data, uint8_t *out) { - + uint8_t initialize_blk[FELICA_BLK_HALF]; memset(initialize_blk, 0, sizeof(initialize_blk)); - + uint8_t wcnt[3]; memcpy(wcnt, counter, 3); - + memcpy(initialize_blk, wcnt, sizeof(wcnt)); initialize_blk[4] = blk_number; initialize_blk[6] = 0x91; @@ -2471,7 +2471,7 @@ static int write_with_mac( return ret; } - uint8_t payload[FELICA_BLK_SIZE*2]; + uint8_t payload[FELICA_BLK_SIZE * 2]; memset(payload, 0, sizeof(payload)); memcpy(payload, block_data, FELICA_BLK_SIZE); @@ -2510,7 +2510,7 @@ static int felica_internal_authentication( felica_status_response_t res; if (send_wr_plain(flags, datalen, data, false, &res) != PM3_SUCCESS) { - return PM3_ERFTRANS; + return PM3_ERFTRANS; } if (res.status_flags.status_flag1[0] != 0x00 && res.status_flags.status_flag2[0] != 0x00) { @@ -2530,7 +2530,7 @@ static int felica_internal_authentication( AddCrc(data, datalen); datalen += 2; - uint8_t pd[FELICA_BLK_SIZE*sizeof(blk_numbers2)]; + uint8_t pd[FELICA_BLK_SIZE * sizeof(blk_numbers2)]; memset(pd, 0, sizeof(pd)); ret = send_rd_multiple_plain(flags, datalen, data, pd); @@ -2565,7 +2565,7 @@ static int felica_internal_authentication( if (memcmp(mac_blk, mac, FELICA_BLK_HALF) != 0) { PrintAndLogEx(ERR, "\nInternal Authenticate: " _RED_("Failed")); - return PM3_ERFTRANS; + return PM3_ERFTRANS; } PrintAndLogEx(SUCCESS, "Internal Authenticate: " _GREEN_("OK")); @@ -2607,7 +2607,7 @@ static int felica_external_authentication( ext_auth[0] = 1; // After Authenticate - uint8_t mac_w[FELICA_BLK_SIZE*2]; + uint8_t mac_w[FELICA_BLK_SIZE * 2]; ret = write_with_mac(ctx, auth_ctx, wcnt_blk, FELICA_BLK_NUMBER_STATE, ext_auth, mac_w); if (ret) { @@ -2630,7 +2630,7 @@ static int felica_external_authentication( felica_status_response_t res; if (send_wr_plain(flags, datalen, data, false, &res) != PM3_SUCCESS) { - return PM3_ERFTRANS; + return PM3_ERFTRANS; } if (res.status_flags.status_flag1[0] != 0x00 && res.status_flags.status_flag2[0] != 0x00) { diff --git a/client/src/pm3line_vocabulary.h b/client/src/pm3line_vocabulary.h index 248a4a667..3bf14d7a0 100644 --- a/client/src/pm3line_vocabulary.h +++ b/client/src/pm3line_vocabulary.h @@ -252,8 +252,8 @@ const static vocabulary_t vocabulary[] = { { 0, "hf felica rqspecver" }, { 0, "hf felica resetmode" }, { 0, "hf felica litesim" }, - { 0, "hf felica litedump" }, { 0, "hf felica liteauth" }, + { 0, "hf felica litedump" }, { 1, "hf fido help" }, { 1, "hf fido list" }, { 0, "hf fido info" }, diff --git a/doc/commands.json b/doc/commands.json index ea1ffa469..98afb786e 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -2710,17 +2710,19 @@ "description": "Authenticate", "notes": [ "hf felica liteauth -i 11100910C11BC407", - "hf felica liteauth -k 46656c69436130313233343536616263", - "hf felica liteauth -c 701185c59f8d30afeab8e4b3a61f5cc4 -k 46656c69436130313233343536616263" + "hf felica liteauth --key 46656c69436130313233343536616263", + "hf felica liteauth --key 46656c69436130313233343536616263 -k", + "hf felica liteauth -c 701185c59f8d30afeab8e4b3a61f5cc4 --key 46656c69436130313233343536616263" ], "offline": false, "options": [ "-h, --help This help", - "-k, --key set card key, 16 bytes", + "--key set card key, 16 bytes", "-c, set random challenge, 16 bytes", - "-i, set custom IDm" + "-i, set custom IDm", + "-k, keep signal field ON after receive" ], - "usage": "hf felica liteauth [-h] [-k ] [-c ] [-i ]" + "usage": "hf felica liteauth [-hk] [--key ] [-c ] [-i ]" }, "hf felica litedump": { "command": "hf felica litedump", @@ -2730,9 +2732,11 @@ ], "offline": false, "options": [ - "-h, --help This help" + "-h, --help This help", + "-i, set custom IDm", + "--key set card key, 16 bytes" ], - "usage": "hf felica litedump [-h]" + "usage": "hf felica litedump [-h] [-i ] [--key ]" }, "hf felica litesim": { "command": "hf felica litesim", @@ -13485,6 +13489,6 @@ "metadata": { "commands_extracted": 775, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2025-08-04T17:50:35" + "extracted_on": "2025-08-12T16:26:32" } } diff --git a/doc/commands.md b/doc/commands.md index fc80c4404..6fbd8f18f 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -343,8 +343,8 @@ Check column "offline" for their availability. |`hf felica rqspecver `|N |`acquire the version of card OS.` |`hf felica resetmode `|N |`reset Mode to Mode 0.` |`hf felica litesim `|N |`Emulating ISO/18092 FeliCa Lite tag` -|`hf felica litedump `|N |`Wait for and try dumping FelicaLite` |`hf felica liteauth `|N |`authenticate a card.` +|`hf felica litedump `|N |`Wait for and try dumping FelicaLite` ### hf fido