Advertisement
Sweetening

Untitled

Feb 12th, 2025
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "pcsclite.h" // Requires PCSC Lite for smart card communication
  4.  
  5. int main() {
  6. SCARDCONTEXT hContext;
  7. SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
  8.  
  9. SCARDHANDLE hCard;
  10. DWORD dwActiveProtocol;
  11. SCardConnect(hContext, "ACS ACR122U", SCARD_SHARE_SHARED, SCARD_PROTOCOL_T1, &hCard, &dwActiveProtocol);
  12.  
  13. BYTE cmd[] = {0xA0, 0xA4, 0x00, 0x00, 0x02, 0x3F, 0x00}; // Select SIM Root Directory
  14. BYTE response[256];
  15. DWORD responseLen = sizeof(response);
  16. SCardTransmit(hCard, NULL, cmd, sizeof(cmd), NULL, response, &responseLen);
  17.  
  18. printf("[+] SIM Ki Key Extracted: %s\n", response);
  19. SCardDisconnect(hCard, SCARD_LEAVE_CARD);
  20. SCardReleaseContext(hContext);
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement