mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 22:33:48 -07:00
print transaction counter
This commit is contained in:
parent
d3fbf3e596
commit
a78c6a7721
1 changed files with 12 additions and 3 deletions
|
@ -4658,8 +4658,8 @@ static int DesfileReadFileAndPrint(DesfireContext *dctx, uint8_t fnum, int filet
|
||||||
// MF2DLHX0.pdf, 10.3.2.1 Transaction MAC Counter, page 41
|
// MF2DLHX0.pdf, 10.3.2.1 Transaction MAC Counter, page 41
|
||||||
uint32_t actTMC = MemLeToUint2byte(&resp[0]);
|
uint32_t actTMC = MemLeToUint2byte(&resp[0]);
|
||||||
uint32_t sessTMC = MemLeToUint2byte(&resp[2]);
|
uint32_t sessTMC = MemLeToUint2byte(&resp[2]);
|
||||||
PrintAndLogEx(SUCCESS, "Session tr counter : %d (0x%08x)", sessTMC, sessTMC);
|
PrintAndLogEx(SUCCESS, "Session tr counter : %d (0x%04x)", sessTMC, sessTMC);
|
||||||
PrintAndLogEx(SUCCESS, "Actual tr counter : %d (0x%08x)", actTMC, actTMC);
|
PrintAndLogEx(SUCCESS, "Actual tr counter : %d (0x%04x)", actTMC, actTMC);
|
||||||
}
|
}
|
||||||
PrintAndLogEx(SUCCESS, "Transaction MAC : %s", sprint_hex(&resp[4], 8));
|
PrintAndLogEx(SUCCESS, "Transaction MAC : %s", sprint_hex(&resp[4], 8));
|
||||||
}
|
}
|
||||||
|
@ -5166,7 +5166,16 @@ static int CmdHF14ADesWriteData(const char *Cmd) {
|
||||||
PrintAndLogEx(INFO, _GREEN_("Commit result:"));
|
PrintAndLogEx(INFO, _GREEN_("Commit result:"));
|
||||||
uint32_t cnt = MemLeToUint4byte(&resp[0]);
|
uint32_t cnt = MemLeToUint4byte(&resp[0]);
|
||||||
transactionCounter = cnt;
|
transactionCounter = cnt;
|
||||||
|
if (dctx.secureChannel != DACLRP) {
|
||||||
PrintAndLogEx(SUCCESS, "Transaction counter: %d (0x%08x)", cnt, cnt);
|
PrintAndLogEx(SUCCESS, "Transaction counter: %d (0x%08x)", cnt, cnt);
|
||||||
|
} else {
|
||||||
|
// For composing TMC the two subparts are concatenated as follows: actTMC || sesTMC. Both subparts are represented LSB first.
|
||||||
|
// MF2DLHX0.pdf, 10.3.2.1 Transaction MAC Counter, page 41
|
||||||
|
uint32_t actTMC = MemLeToUint2byte(&resp[0]);
|
||||||
|
uint32_t sessTMC = MemLeToUint2byte(&resp[2]);
|
||||||
|
PrintAndLogEx(SUCCESS, "Session tr counter : %d (0x%04x)", sessTMC, sessTMC);
|
||||||
|
PrintAndLogEx(SUCCESS, "Actual tr counter : %d (0x%04x)", actTMC, actTMC);
|
||||||
|
}
|
||||||
PrintAndLogEx(SUCCESS, "Transaction MAC : %s", sprint_hex(&resp[4], 8));
|
PrintAndLogEx(SUCCESS, "Transaction MAC : %s", sprint_hex(&resp[4], 8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue