mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-23 07:37:23 +08:00
add select way commands
This commit is contained in:
parent
b9108d5453
commit
af26a397a7
2 changed files with 34 additions and 0 deletions
|
@ -290,6 +290,38 @@ const char *DesfireAuthErrorToStr(int error) {
|
|||
return "";
|
||||
}
|
||||
|
||||
const char *DesfireSelectWayToStr(DesfireISOSelectWay way) {
|
||||
switch (way) {
|
||||
case ISW6bAID:
|
||||
return "AID";
|
||||
case ISWMF:
|
||||
return "MF";
|
||||
case ISWIsoID:
|
||||
return "ISO ID";
|
||||
case ISWDFName:
|
||||
return "DF Name";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
bool DesfireMFSelected(DesfireISOSelectWay way, uint32_t id) {
|
||||
switch (way) {
|
||||
case ISW6bAID:
|
||||
return (id == 0x000000);
|
||||
case ISWMF:
|
||||
return true;
|
||||
case ISWIsoID:
|
||||
return (id == 0x3f00);
|
||||
case ISWDFName:
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t DesfireAIDByteToUint(uint8_t *data) {
|
||||
return data[0] + (data[1] << 8) + (data[2] << 16);
|
||||
}
|
||||
|
|
|
@ -170,6 +170,8 @@ void DesfirePrintMADAID(uint32_t appid, bool verbose);
|
|||
|
||||
int DesfireGetCardUID(DesfireContext *ctx);
|
||||
|
||||
const char *DesfireSelectWayToStr(DesfireISOSelectWay way);
|
||||
bool DesfireMFSelected(DesfireISOSelectWay way, uint32_t id);
|
||||
int DesfireSelectEx(DesfireContext *ctx, bool fieldon, DesfireISOSelectWay way, uint32_t id, char *dfname);
|
||||
int DesfireSelect(DesfireContext *ctx, DesfireISOSelectWay way, uint32_t id, char *dfname);
|
||||
|
||||
|
|
Loading…
Reference in a new issue