pcsc-spy(1)

pcsc-spy1

A pc/sc spy command

Usage

pcsc-spy [{-n | --nocolor}] [{-d | --diffable}] [{-h | --help}] [{-v | --version}] [{-t | --thread}] [fifo_filename]

Overview

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

-d, --diffable

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

-h, --help

Display a short help text.

-n, --nocolor

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

-v, --version

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

-t, --thread

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

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

 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

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

Releases

8 releases since Debian 7 (Wheezy); the text changed 7 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13
  8. Arch

--thread since Debian 12 (Bookworm); -t since Debian 12 (Bookworm).

Author

This manual page was written by Ludovic Rousseau <[email protected]>

From pcsclite 2.5.3-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.