1PCSC-SPY(1) PC/SC lite PCSC-SPY(1)
2
3
4
6 pcsc-spy - A PC/SC spy command
7
9 pcsc-spy [-n|--nocolor] [-d|--diffable] [-h|--help] [fifo_filename]
10
12 pcsc-spy displays PC/SC calls of an application. It must be used with
13 the libpcscspy.so library.
14
15 To be able to spy the PC/SC layer, the application flow must be
16 modified so that all PC/SC calls are redirected. Two options are
17 available:
18
19 - the application is linked with libpcsclite.so.1
20 - the application loads the libpcsclite.so.1 library using dlopen(3)
21
23 -d, --diffable
24 Demove the variable parts (like handler values) from the output so
25 that two execution can be more easily compared.
26
27 -h, --help
28 Display a short help text.
29
30 -n, --nocolor
31 Disable the output colorization (if you want redirect the output in
32 a file for example).
33
34 -v, --version
35 Print the version of the pcsc-spy program plus a copyright, a list
36 of authors.
37
39 Applications linked with libpcsclite.so.1
40 We will use the standard LD_PRELOAD loader option to load our spying
41 library.
42
43 Example:
44 LD_PRELOAD=/usr/lib/libpcscspy.so pcsc_scan
45
46 Application loading libpcsclite.so.1
47 This is the case for the PC/SC wrappers like pyscard (for Python) and
48 pcsc-perl (for Perl). The LD_PRELOAD mechanism can't be used. Instead
49 we replace the libpcsclite.so.1 library by the spying one.
50
51 You may use install_spy.sh and uninstall_spy.sh to install and
52 uninstall the spying library.
53
54 Using the spying library without pcsc-spy is not a problem but has side
55 effects:
56
57 - a line "libpcsclite_nospy.so.1: cannot open shared object file: No
58 such file or directory" will be displayed
59
60 - some CPU time will be lost because of the PC/SC calls redirection
61
62 Starting the spy tool
63 pcsc-spy
64
65 If a command argument is passed we use it instead of the default
66 ~/pcsc-spy FIFO file. It is then possible to record an execution log
67 and use pcsc-spy multiple times on the same log.
68
69 To create the log file just do:
70
71 mkfifo ~/pcsc-spy
72 cat ~/pcsc-spy > logfile
73
74 and run your PC/SC application.
75
76 Mac OS X
77 The installation is not automatic. In the pcsc-lite/src/spy directory
78 do:
79 make framework
80
81 Then copy the PCSC.framework directory in /tmp
82 cp -a PCSC.framework /tmp
83
84 Copy the official PCSC.framework (binary only) in /tmp
85 cp /System/Library/Frameworks/PCSC.framework/PCSC /tmp
86
87 Run the application to debug as:
88 DYLD_FRAMEWORK_PATH=/tmp pcsctest
89
91 ~/pcsc-spy FIFO file is used by libpcsclite.so.1 to send the raw log
92 lines
93
95 pcscd(8)
96
98 This manual page was written by Ludovic Rousseau <rousseau@free.fr>
99
100
101
102pcsc-lite 1.8.8 2012-08-25 PCSC-SPY(1)