fix reinitialization of sim module

This commit is contained in:
iceman1001 committed 2026-08-27 09:37:18 +02:00
1 parent aeb5347b87
commit 8cef2d5822
2 files changed
+26

No files matched your search

+13
View File
@@ -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);
+13
View File
@@ -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);