Merge pull request #13 from RfidResearchGroup/master

fix:  'trace list des' - now deals with wrapped native commands
This commit is contained in:
Bjoern Kerler 2020-04-07 09:18:35 +02:00 committed by GitHub
commit f01c37aff4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -674,7 +674,8 @@ void annotateIso7816(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
void annotateMfDesfire(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
// it's basically a ISO14443a tag, so try annotation from there
if (!applyIso14443a(exp, size, cmd, cmdsize)) {
if (applyIso14443a(exp, size, cmd, cmdsize) == 0) {
// S-block 11xxx010
if ((cmd[0] & 0xC0) && (cmdsize == 3)) {
switch ((cmd[0] & 0x30)) {
@ -698,12 +699,17 @@ void annotateMfDesfire(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
}
// I-block 000xCN1x
else if ((cmd[0] & 0xC0) == 0x00) {
// PCB [CID] [NAD] [INF] CRC CRC
int pos = 1;
if ((cmd[0] & 0x08) == 0x08) // cid byte following
pos = pos + 1;
pos++;
if ((cmd[0] & 0x04) == 0x04) // nad byte following
pos = pos + 1;
pos++;
for (uint8_t i = 0; i < 2; i++, pos++) {
switch (cmd[pos]) {
case MFDES_CREATE_APPLICATION:
snprintf(exp, size, "CREATE APPLICATION");
@ -816,6 +822,7 @@ void annotateMfDesfire(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
default:
break;
}
}
} else {
// anything else
snprintf(exp, size, "?");