mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
thanks @DidierA for the sharp eyes
This commit is contained in:
parent
ce741d3b44
commit
1c35f14c76
1 changed files with 8 additions and 5 deletions
|
@ -32,7 +32,7 @@ const char *getAtrInfo(const char *atr_str) {
|
||||||
if (strlen(AtrTable[i].bytes) != slen)
|
if (strlen(AtrTable[i].bytes) != slen)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strstr(AtrTable[i].bytes, "..") != NULL) {
|
if (strstr(AtrTable[i].bytes, ".") != NULL) {
|
||||||
char *tmp_atr = calloc(slen, sizeof(uint8_t));
|
char *tmp_atr = calloc(slen, sizeof(uint8_t));
|
||||||
if (tmp_atr == NULL) {
|
if (tmp_atr == NULL) {
|
||||||
PrintAndLogEx(FAILED, "failed to allocate memory");
|
PrintAndLogEx(FAILED, "failed to allocate memory");
|
||||||
|
@ -40,7 +40,7 @@ const char *getAtrInfo(const char *atr_str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < slen; j++) {
|
for (int j = 0; j < slen; j++) {
|
||||||
tmp_atr[j] = AtrTable[i].bytes[j] == '.' ? '.' : atr_str[j];
|
tmp_atr[j] = (AtrTable[i].bytes[j] == '.') ? '.' : atr_str[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncmp(tmp_atr, AtrTable[i].bytes, slen) == 0) {
|
if (strncmp(tmp_atr, AtrTable[i].bytes, slen) == 0) {
|
||||||
|
@ -50,9 +50,12 @@ const char *getAtrInfo(const char *atr_str) {
|
||||||
free(tmp_atr);
|
free(tmp_atr);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (strncmp(atr_str, AtrTable[i].bytes, slen) == 0) return AtrTable[i].desc;
|
if (strncmp(atr_str, AtrTable[i].bytes, slen) == 0) {
|
||||||
|
return AtrTable[i].desc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (match >= 0) {
|
if (match >= 0) {
|
||||||
return AtrTable[match].desc;
|
return AtrTable[match].desc;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue