mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
some of MAD2 code
This commit is contained in:
parent
5122e1289d
commit
20be5c5d9f
2 changed files with 12 additions and 4 deletions
|
@ -122,7 +122,10 @@ int madCRCCheck(uint8_t *sector, bool verbose, int MADver) {
|
|||
}
|
||||
|
||||
uint16_t madGetAID(uint8_t *sector, int MADver, int sectorNo) {
|
||||
return (sector[16 + 2 + (sectorNo - 1) * 2] << 8) + (sector[16 + 2 + (sectorNo - 1) * 2 + 1]);
|
||||
if (MADver == 1)
|
||||
return (sector[16 + 2 + (sectorNo - 1) * 2] << 8) + (sector[16 + 2 + (sectorNo - 1) * 2 + 1]);
|
||||
else
|
||||
return (sector[2 + (sectorNo - 1) * 2] << 8) + (sector[2 + (sectorNo - 1) * 2 + 1]);
|
||||
}
|
||||
|
||||
int MAD1DecodeAndPrint(uint8_t *sector, bool verbose, bool *haveMAD2) {
|
||||
|
@ -185,6 +188,11 @@ int MAD2DecodeAndPrint(uint8_t *sector, bool verbose) {
|
|||
if (res)
|
||||
return res;
|
||||
|
||||
for(int i = 1; i < 8 + 8 + 7; i++) {
|
||||
uint16_t AID = madGetAID(sector, 2, i);
|
||||
PrintAndLogEx(NORMAL, "%02d [%04X] %s", i + 15, AID, GetAIDDescription(AID));
|
||||
};
|
||||
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue