add select way commands
This commit is contained in:
1 parent
b9108d5453
commit
af26a397a7
2 files changed
+34
No files matched your search
@@ -290,6 +290,38 @@ const char *DesfireAuthErrorToStr(int error) {
|
|||||||
return "";
|
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) {
|
uint32_t DesfireAIDByteToUint(uint8_t *data) {
|
||||||
return data[0] + (data[1] << 8) + (data[2] << 16);
|
return data[0] + (data[1] << 8) + (data[2] << 16);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,6 +170,8 @@ void DesfirePrintMADAID(uint32_t appid, bool verbose);
|
|||||||
|
|
||||||
int DesfireGetCardUID(DesfireContext *ctx);
|
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 DesfireSelectEx(DesfireContext *ctx, bool fieldon, DesfireISOSelectWay way, uint32_t id, char *dfname);
|
||||||
int DesfireSelect(DesfireContext *ctx, DesfireISOSelectWay way, uint32_t id, char *dfname);
|
int DesfireSelect(DesfireContext *ctx, DesfireISOSelectWay way, uint32_t id, char *dfname);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user