mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-24 06:24:11 +00:00
fix reinitialization of sim module
This commit is contained in:
1 parent
aeb5347b87
commit
8cef2d5822
2 files changed
+26
No files matched your search
@@ -641,6 +641,19 @@ int sam_picopass_get_pacs(PacketCommandNG *c) {
|
||||
set_tracing(true);
|
||||
StartTicks();
|
||||
|
||||
// Resetting the module resets the card, which then sends an ATR nobody
|
||||
// asked for. Read it here rather than letting the first SAM APDU collide
|
||||
// with it, and take the chance to say plainly when the slot holds
|
||||
// something that is not a SAM.
|
||||
smart_card_atr_t card;
|
||||
if (GetATR(&card, false) == false) {
|
||||
if (g_dbglevel >= DBG_ERROR) {
|
||||
DbpString("SAM: no ATR - is a SAM in the slot?");
|
||||
}
|
||||
res = PM3_ECARDEXCHANGE;
|
||||
goto err;
|
||||
}
|
||||
|
||||
// step 1: ping SAM
|
||||
sam_get_version(info);
|
||||
|
||||
|
||||
@@ -296,6 +296,19 @@ int sam_seos_get_pacs(PacketCommandNG *c) {
|
||||
set_tracing(true);
|
||||
StartTicks();
|
||||
|
||||
// Resetting the module resets the card, which then sends an ATR nobody
|
||||
// asked for. Read it here rather than letting the first SAM APDU collide
|
||||
// with it, and take the chance to say plainly when the slot holds
|
||||
// something that is not a SAM.
|
||||
smart_card_atr_t card;
|
||||
if (GetATR(&card, false) == false) {
|
||||
if (g_dbglevel >= DBG_ERROR) {
|
||||
DbpString("SAM: no ATR - is a SAM in the slot?");
|
||||
}
|
||||
res = PM3_ECARDEXCHANGE;
|
||||
goto err;
|
||||
}
|
||||
|
||||
// step 1: ping SAM
|
||||
sam_get_version(false);
|
||||
|
||||
|
||||
Reference in new issue
Block a user