Merge pull request #3527 from kormax/felica-info-auth-idi-pmi

Determine IDi and PMi in `hf felica info` for cards with known keys
This commit is contained in:
Iceman authored and GitHub committed 2026-08-26 18:15:00 +07:00
commit 48458b6ba7
8 files changed
+1123 -72

No files matched your search

+1
View File
@@ -502,6 +502,7 @@ set (TARGET_SOURCES
${PM3_ROOT}/client/src/hidsio.c
${PM3_ROOT}/client/src/iso4217.c
${PM3_ROOT}/client/src/jansson_path.c
${PM3_ROOT}/client/src/jsonutils.c
${PM3_ROOT}/client/src/lua_bitlib.c
${PM3_ROOT}/client/src/parsers/parsehrt.c
${PM3_ROOT}/client/src/parsers/hrtparser/hrtparser.c
+1
View File
@@ -873,6 +873,7 @@ SRCS = mifare/aiddesfire.c \
graph.c \
hidsio.c \
jansson_path.c \
jsonutils.c \
iso4217.c \
iso7816/apduinfo.c \
iso7816/iso7816core.c \
+1
View File
@@ -422,6 +422,7 @@ set (TARGET_SOURCES
${PM3_ROOT}/client/src/hidsio.c
${PM3_ROOT}/client/src/iso4217.c
${PM3_ROOT}/client/src/jansson_path.c
${PM3_ROOT}/client/src/jsonutils.c
${PM3_ROOT}/client/src/lua_bitlib.c
${PM3_ROOT}/client/src/parsers/parsehrt.c
${PM3_ROOT}/client/src/parsers/hrtparser/hrtparser.c
@@ -0,0 +1,6 @@
{
"created": "proxmark3",
"file_type": "felicagroupuserkeys",
"version": 1,
"keysets": []
}
+6
View File
@@ -0,0 +1,6 @@
{
"created": "proxmark3",
"file_type": "felicanodekeys",
"version": 1,
"keys": []
}
+1035 -72
View File
File diff suppressed because it is too large. Load diff
+45
View File
@@ -0,0 +1,45 @@
//-----------------------------------------------------------------------------
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// See LICENSE.txt for the text of the license.
//-----------------------------------------------------------------------------
#include "jsonutils.h"
#include <stdbool.h>
#include <string.h>
#include "commonutil.h" // hexstr_to_byte_array
json_t *json_object_get_ci(const json_t *object, const char *key) {
if (json_is_object(object) == false || key == NULL) {
return NULL;
}
const char *object_key = NULL;
json_t *value = NULL;
json_object_foreach((json_t *)object, object_key, value) {
if (object_key != NULL && strcasecmp(object_key, key) == 0) {
return value;
}
}
return NULL;
}
bool json_string_hex(const json_t *value, uint8_t *out, size_t len) {
if (json_is_string(value) == false || out == NULL) {
return false;
}
const char *hex = json_string_value(value);
size_t parsed = 0;
return hex != NULL && strlen(hex) == len * 2U &&
hexstr_to_byte_array(hex, out, &parsed) && parsed == len;
}
+28
View File
@@ -0,0 +1,28 @@
//-----------------------------------------------------------------------------
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// See LICENSE.txt for the text of the license.
//-----------------------------------------------------------------------------
#ifndef JSONUTILS_H__
#define JSONUTILS_H__
#include <stdbool.h>
#include <stdint.h>
#include "jansson.h"
json_t *json_object_get_ci(const json_t *object, const char *key);
// Decode a JSON string of exactly len*2 hex digits into len bytes.
bool json_string_hex(const json_t *value, uint8_t *out, size_t len);
#endif // JSONUTILS_H__