You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-5Lines changed: 24 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,18 +21,37 @@ The APDUPlay project is providing following functionality:
21
21
See more details at https://github.com/petrs/APDUPlay/wiki.
22
22
23
23
## Installation
24
-
1. Find out if your targeted application is 32- or 64-bit [(howto)](https://superuser.com/questions/103071/quick-way-to-tell-if-an-installed-application-is-64-bit-or-32-bit#103073).
25
-
1. Copy Winscard.dll from your system folder (c:\Windows\winscard.dll for 32-bit target application or c:\Windows\SysWOW64\winscard.dll for 64-bit application) to the folder with target application and rename it to original32.dll or original64.dll respectively
24
+
1. Find out if your targeted application is 32- or 64-bit [(Use Microsoft Sysinternals Sigcheck utility)](https://docs.microsoft.com/en-us/sysinternals/downloads/sigcheck). Run sigcheck.exe targetApp.exe and look for MachineType: 32-bit or 64-bit (works also for dll files)
25
+
1. Copy Winscard.dll from your system folder (c:\Windows\System32\winscard.dll for 64-bit target application (if you are running 64-bit OS) or c:\Windows\SysWOW64\winscard.dll for 32-bit application) to the folder with target application and rename it to original32.dll or original64.dll respectively. NOTE: c:\Windows\System32\ will contain either 32-bit or 64-bit version based on your OS.
26
26
2. Copy Winscard.dll from APDUPlay project to the folder with target application (the folder should contain winscard.dll binary from APDUPlay project AND originalXX.dll which is original Microsoft's winscard.dll)
27
27
3. Run the application and inspect resulting files winscard_log.txt and winscard_rules_log.txt
28
28
4. (Optional) Change configuration file winscard_rules.txt to modify default behavior (see below)
29
29
30
-
## Troubleshooting
30
+
## Examples
31
31
32
-
* If you use (wrongly) 64bit version of library Microsoft's winscard.dll (renamed as original32.dll), it will fail with "The procedure entry point original.g_rgSCardT1Pci could not be located in the dynamic link library WinSCard.dll."
33
-
32
+
The localization of correct winscard.dll path can be tedious task for some applications. Here are some examples with increasing difficulty:
33
+
1. Simple application directly using winscard.dll (CAProfiler)
34
+
2. Application with persistent agent (gpg2.exe --card-edit)
35
+
3. Java-based application accessing smartcards via JRE: (GlobalPlatformPro gp -l)
34
36
35
37
38
+
## Troubleshooting
39
+
40
+
* 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](https://docs.microsoft.com/en-us/sysinternals/downloads/sigcheck) to verify that both libraries as either 64-bit or 32-bit (based on your target application needs).
41
+
42
+
* 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](https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) 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.
43
+
44
+
* Problem: Logging seems to work, but only for the first of 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 computer (will force component to restart again).
45
+
46
+
* Problem: Target application always opens winscard.dll from system folders (either system32 or sysWOW64 folder).
47
+
Run cmd as admin, then:
48
+
```
49
+
cd target_folder (either system32 or sysWOW64)
50
+
takeown /f winscard.dll
51
+
cacls winscard.dll /G your_username:F
52
+
rename winscard.dll to winscard_MS.dll (winscard.dll might be currently used by some other process so direct copy woudl not be possible)
0 commit comments