mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-14 00:53:12 +08:00
fixed aid selection
This commit is contained in:
parent
2a4a9745c9
commit
6eb7c8e7a5
1 changed files with 7 additions and 3 deletions
|
@ -123,13 +123,17 @@ int PrintAIDDescription(char *aid, bool verbose) {
|
|||
goto out;
|
||||
|
||||
json_t *elm = NULL;
|
||||
int maxaidlen = 0;
|
||||
for (int elmindx = 0; elmindx < json_array_size(root); elmindx++) {
|
||||
json_t *data = AIDSearchGetElm(root, elmindx);
|
||||
if (data == NULL)
|
||||
continue;
|
||||
if (aidCompare(jsonStrGet(data, "AID"), aid)) {
|
||||
elm = data;
|
||||
break;
|
||||
const char *dictaid = jsonStrGet(data, "AID");
|
||||
if (aidCompare(aid, dictaid)) { // dictaid may be less length than requested aid
|
||||
if (maxaidlen < strlen(dictaid) && strlen(dictaid) <= strlen(aid)) {
|
||||
maxaidlen = strlen(dictaid);
|
||||
elm = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue