mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 02:27:26 -07:00
sAPDU printing.. these different apdu structs will need to be unified
This commit is contained in:
parent
a8b92f48a7
commit
ac9d33c35f
2 changed files with 19 additions and 0 deletions
|
@ -517,3 +517,21 @@ void APDUPrintEx(APDUStruct apdu, size_t maxdatalen) {
|
|||
if (maxdatalen > 0)
|
||||
PrintAndLogEx(INFO, "data: %s%s", sprint_hex(apdu.data, MIN(apdu.lc, maxdatalen)), apdu.lc > maxdatalen ? "..." : "");
|
||||
}
|
||||
|
||||
void SAPDUPrint(sAPDU apdu, size_t maxdatalen) {
|
||||
PrintAndLogEx(INFO, "APDU: CLA 0x%02x, INS 0x%02x, P1 0x%02x, P2 0x%02x, Lc 0x%02x(%d)",
|
||||
apdu.CLA,
|
||||
apdu.INS,
|
||||
apdu.P1,
|
||||
apdu.P2,
|
||||
apdu.Lc,
|
||||
apdu.Lc
|
||||
);
|
||||
|
||||
size_t len = apdu.Lc;
|
||||
if (maxdatalen > 0)
|
||||
len = MIN(apdu.Lc, maxdatalen);
|
||||
|
||||
PrintAndLogEx(INFO, "data { %s%s }", sprint_hex(apdu.data, len), apdu.Lc > len ? "..." : "");
|
||||
}
|
||||
|
||||
|
|
|
@ -63,4 +63,5 @@ extern int APDUEncodeS(sAPDU *sapdu, bool extended, uint16_t le, uint8_t *data,
|
|||
extern void APDUPrint(APDUStruct apdu);
|
||||
extern void APDUPrintEx(APDUStruct apdu, size_t maxdatalen);
|
||||
|
||||
void SAPDUPrint(sAPDU apdu, size_t maxdatalen);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue