style
Some checks failed
CodeQL / Analyze (push) Has been cancelled
MacOS Build and Test / macos-make (push) Has been cancelled
MacOS Build and Test / macos-make-btaddon (push) Has been cancelled
MacOS Build and Test / macos-cmake (push) Has been cancelled
Ubuntu Build and Test / ubuntu-make (push) Has been cancelled
Ubuntu Build and Test / ubuntu-make-btaddon (push) Has been cancelled
Ubuntu Build and Test / ubuntu-cmake (push) Has been cancelled
Windows Build and Test / proxspace (push) Has been cancelled
Windows Build and Test / wsl (push) Has been cancelled

This commit is contained in:
iceman1001 2025-08-12 19:06:38 +02:00
commit 8ab2f2b5a0
4 changed files with 24 additions and 20 deletions

View file

@ -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) {

View file

@ -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" },

View file

@ -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 <hex> set card key, 16 bytes",
"--key <hex> set card key, 16 bytes",
"-c, <hex> set random challenge, 16 bytes",
"-i, <hex> set custom IDm"
"-i, <hex> set custom IDm",
"-k, keep signal field ON after receive"
],
"usage": "hf felica liteauth [-h] [-k <hex>] [-c <hex>] [-i <hex>]"
"usage": "hf felica liteauth [-hk] [--key <hex>] [-c <hex>] [-i <hex>]"
},
"hf felica litedump": {
"command": "hf felica litedump",
@ -2730,9 +2732,11 @@
],
"offline": false,
"options": [
"-h, --help This help"
"-h, --help This help",
"-i, <hex> set custom IDm",
"--key <hex> set card key, 16 bytes"
],
"usage": "hf felica litedump [-h]"
"usage": "hf felica litedump [-h] [-i <hex>] [--key <hex>]"
},
"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"
}
}

View file

@ -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