mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-25 08:35:56 +08:00
Merge pull request #13 from RfidResearchGroup/master
fix: 'trace list des' - now deals with wrapped native commands
This commit is contained in:
commit
f01c37aff4
1 changed files with 121 additions and 114 deletions
|
@ -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, "?");
|
||||
|
|
Loading…
Reference in a new issue