Skip to content
Petr Svenda edited this page Feb 11, 2020 · 2 revisions

Troubleshooting

  • Problem: After running target application, the following error message is displayed: "The procedure entry point original.g_rgSCardT1Pci could not be located in the dynamic link library WinSCard.dll.". You likely mismatched 64-bit and 32-bit versions of APDUPlay's winscard.dll and Microsoft's original library (renamed as original32.dll). Use Microsoft Sysinternals Sigcheck utility to verify that both libraries as either 64-bit or 32-bit (based on your target application needs).

  • Problem: During the linking, unresolved external symbol error is detected. The functions g_rgSCardRawPc, g_rgSCardT0Pci and g_rgSCardT1Pci were removed from Microsoft original winscard.dll libraries some time in year 2019. As a result, current version of APDUPlay source code does not reference these functions (winscard32.def and winscard64.def) and are commented. If you need to compile for older versions, please uncomment relevant definitions in winscard32.def and winscard64.def.

1>Winscard32.def : error LNK2001: unresolved external symbol g_rgSCardRawPci
1>Winscard32.def : error LNK2001: unresolved external symbol g_rgSCardT0Pci
1>Winscard32.def : error LNK2001: unresolved external symbol g_rgSCardT1Pci
1>Winscard.lib : fatal error LNK1120: 3 unresolved externals
  • Problem: Target application is (probably) not loading modified winscard.dll from APDUPlay project, but uses standard Microsoft's one from system folder (no files with logged communication are created). Use Process Monitor utility from Microsoft to find location of loaded libraries (use Filter option to limit results only to target application: CTRL+L -> Process Name is 'targetApp.exe' -> Add). Search for event 'Load Image path_to_folder\Winscard.dll'. The path_to_folder should point to APDUPlay's version of winscard.dll, not Microsoft one.

  • Problem: Logging seems to work, but only for the first of start of an application. When started again, changes done to winscard_rules.txt does not apply. Target application might have persistent component (e.g., GPG have gpg-agent.exe) which loads the dll (and rules from winscard_rules.txt) and runs even when target application is terminated. Try to locate and kill this component, or restart the computer (will force component to restart again).

  • Problem: Target application always opens winscard.dll from system folders (either system32 or sysWOW64 folder). Run cmd as admin, then:

cd target_folder (either system32 or sysWOW64)
takeown /f winscard.dll
cacls winscard.dll /G your_username:F
rename winscard.dll to winscard_MS.dll  (winscard.dll might be currently used by some other process so direct copy would not be possible)
copy APDUPlay's winscard.dll instead winscard.dll
Clone this wiki locally