PCSC-SPY(1) User Contributed Perl Documentation PCSC-SPY(1)

# [NAME](#NAME)

pcsc-spy - A PC/SC spy command

# [SYNOPSIS](#SYNOPSIS)

pcsc-spy \[**-n**|**--nocolor**] \[**-d**|**--diffable**] \[**-h**|**--help**] \[**-v**|**--version**] \[**-t**|**--thread**] \[*fifo\_filename*]

# [DESCRIPTION](#DESCRIPTION)

pcsc-spy displays PC/SC calls of an application. It must be used with the *libpcscspy.so.0* library.

To be able to spy the PC/SC layer, the application flow must be modified using "LIBPCSCLITE\_DELEGATE" so that all PC/SC calls are redirected.

# [OPTIONS](#OPTIONS)

[**-d**, **--diffable**](#d)

Remove the variable parts (like handler values) from the output so that two execution can be more easily compared.

[**-h**, **--help**](#h)

Display a short help text.

[**-n**, **--nocolor**](#n)

Disable the output colorization (if you want redirect the output in a file for example).

[**-v**, **--version**](#v)

Print the version of the *pcsc-spy* program plus a copyright, a list of authors.

[**-t**, **--thread**](#t)

Add a thread number before each line of log to identify the calls from the same threads.

# [EXAMPLES](#EXAMPLES)

We will use the "LIBPCSCLITE\_DELEGATE" environment variable to load our spying library.

Example:

```
 sh /usr/share/doc/libpcsclite-dev/setup_spy.sh
 export LIBPCSCLITE_DELEGATE=/lib/x86_64-linux-gnu/libpcscspy.so.0
 LIBPCSCLITE_DELEGATE=/lib/x86_64-linux-gnu/libpcscspy.so.0 my_application
```

## [Starting the spy tool](#Starting_the_spy_tool)

```
 pcsc-spy
```

If a command argument is passed we use it instead of the default *~/pcsc-spy* FIFO file. It is then possible to record an execution log and use pcsc-spy multiple times on the same log.

To create the log file just do:

```
 mkfifo ~/pcsc-spy
 cat ~/pcsc-spy > logfile
```

and run your PC/SC application.

# [FILES](#FILES)

*~/pcsc-spy* FIFO file is used by *libpcscspy.so.0* to send the raw log lines

# [SEE ALSO](#SEE_ALSO)

[**pcscd**(8)](/man/os/pcsc-lite/pcscd.8)

# [AUTHOR](#AUTHOR)

This manual page was written by Ludovic Rousseau &lt;rousseau@free.fr&gt;

2024-01-01 perl v5.44.0

---

Document: pcsc-spy(1) from pcsc-lite 2.5.3-r2 (Chainguard OS)
Source: https://github.com/LudovicRousseau/PCSC
