forked from LudovicRousseau/PCSC-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ltrace.conf
119 lines (103 loc) · 6.21 KB
/
ltrace.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
; ltrace.conf: Configuration file for ltrace(1)
; Copyright (C) 2010 Ludovic Rousseau
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program; if not, write to the Free Software Foundation, Inc.,
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
; Usage: ltrace -l/usr/lib/libpcsclite.so [args] binary
;
; Installation:
; Copy or link the file in ~/.ltrace.conf
;
; Limitations:
; - does not work with pcscd autostart since the setuid bit of pcscd
; will not be honored and pcscd will not have the access rights to
; create files in /var/run/pcscd/
; Useful arguments
; -A maxelts
; Maximum number of array elements to print before suppressing the
; rest with an ellipsis ("...")
;
; -c Count time and calls for each library call and report a summary
; on program exit.
;
; This argument will generate a statistics table like:
; % time seconds usecs/call calls function
; ------ ----------- ----------- --------- --------------------
; 43.44 0.111906 111906 1 SCardReconnect
; 29.36 0.075627 75627 1 SCardDisconnect
; 18.55 0.047784 47784 1 SCardConnect
; 4.69 0.012089 12089 1 SCardTransmit
; 2.54 0.006530 6530 1 SCardControl
; 0.50 0.001284 256 5 SCardGetAttrib
; 0.28 0.000733 28 26 pcsc_stringify_error
; 0.24 0.000613 613 1 SCardEstablishContext
; 0.10 0.000256 256 1 SCardReleaseContext
; 0.07 0.000172 28 6 SCardFreeMemory
; 0.07 0.000169 169 1 SCardStatus
; 0.06 0.000165 82 2 SCardListReaders
; 0.05 0.000117 117 1 SCardSetAttrib
; 0.03 0.000081 81 1 SCardGetStatusChange
; 0.02 0.000041 20 2 SCardIsValidContext
; 0.01 0.000021 21 1 SCardListReaderGroups
; ------ ----------- ----------- --------- --------------------
; 100.00 0.257588 52 total
; ********************
; Types and structures
; ********************
typedef scope = enum(SCARD_SCOPE_USER=0, SCARD_SCOPE_TERMINAL=1, SCARD_SCOPE_SYSTEM=2)
; use an enum to display the value in hex
typedef scardcontext = enum();
typedef scardhandle = enum();
typedef atr = array(char, 33);
; typedef struct
; {
; const char *szReader;
; void *pvUserData;
; unsigned long dwCurrentState;
; unsigned long dwEventState;
; unsigned long cbAtr;
; unsigned char rgbAtr[MAX_ATR_SIZE];
; }
; SCARD_READERSTATE;
typedef scard_readerstate = struct(string, addr, uint, uint, int, atr);
typedef share_mode = enum(SCARD_SHARE_EXCLUSIVE=1, SCARD_SHARE_SHARED=2, SCARD_SHARE_DIREC=3);
typedef protocol = enum(SCARD_PROTOCOL_UNDEFINED=0, SCARD_PROTOCOL_T0=1, SCARD_PROTOCOL_T1=2, SCARD_PROTOCOL_T0_SCARD_PROTOCOL_T1=3 SCARD_PROTOCOL_RAW=4, SCARD_PROTOCOL_T15=8);
typedef scard_io_request = struct(protocol, long);
typedef disposition = enum(SCARD_LEAVE_CARD=0, SCARD_RESET_CARD=1, SCARD_UNPOWER_CARD=2, SCARD_EJECT_CARD=3);
; not all possible error codes are present since ltrace has a limit of
; 1024 characters per line
typedef scarderror = enum(SCARD_S_SUCCESS=0, SCARD_F_INTERNAL_ERROR=-2146435071, SCARD_E_CANCELLED=-2146435070, SCARD_E_INVALID_HANDLE=-2146435069, SCARD_E_INVALID_PARAMETER=-2146435068, SCARD_E_NO_MEMORY=-2146435066, SCARD_E_INSUFFICIENT_BUFFER=-2146435064, SCARD_E_UNKNOWN_READER=-2146435063, SCARD_E_TIMEOUT=-2146435062, SCARD_E_SHARING_VIOLATION=-2146435061, SCARD_E_NO_SMARTCARD=-2146435060, SCARD_E_PROTO_MISMATCH=-2146435057, SCARD_E_NOT_READY=-2146435056, SCARD_E_INVALID_VALUE=-2146435055, SCARD_F_COMM_ERROR=-2146435053, SCARD_F_UNKNOWN_ERROR=-2146435052, SCARD_E_INVALID_ATR=-2146435051, SCARD_E_NOT_TRANSACTED=-2146435050, SCARD_E_READER_UNAVAILABLE=-2146435049, SCARD_E_DUPLICATE_READER=-2146435045, SCARD_E_NO_SERVICE=-2146435043, SCARD_E_UNSUPPORTED_FEATURE=-2146435041, SCARD_E_NO_READERS_AVAILABLE=-2146435026, SCARD_W_UNRESPONSIVE_CARD=-2146434970, SCARD_W_UNPOWERED_CARD=-2146434969, SCARD_W_RESET_CARD=-2146434968, SCARD_W_REMOVED_CARD=-2146434967);
typedef attrib_id = enum(SCARD_ATTR_DEVICE_FRIENDLY_NAME=2147418115, SCARD_ATTR_ATR_STRING=590595, SCARD_ATTR_VENDOR_IFD_VERSION=65794, SCARD_ATTR_MAXINPUT=499719, SCARD_ATTR_VENDOR_NAME=65792);
; *********
; Functions
; *********
scarderror SCardBeginTransaction(scardhandle);
scarderror SCardCancel(scardcontext);
scarderror SCardCancelTransaction(scardhandle);
scarderror SCardConnect(scardcontext, string, share_mode, protocol, +scardhandle*, +protocol*);
scarderror SCardControl(scardhandle, int, array(char, arg4)*, uint, +array(char, arg6)*, uint, +uint*);
scarderror SCardDisconnect(scardhandle, disposition);
scarderror SCardEndTransaction(scardhandle, disposition);
scarderror SCardEstablishContext(scope, addr, addr, +scardcontext*);
scarderror SCardFreeMemory(scardcontext, addr);
scarderror SCardGetAttrib(scardhandle, attrib_id, +array(char, arg4)*, +uint*);
scarderror SCardGetStatusChange(scardcontext, int, +scard_readerstate*, int);
scarderror SCardIsValidContext(scardcontext);
scarderror SCardListReaderGroups(scardcontext, +string*, +uint*);
scarderror SCardListReaders(scardcontext, string, +string*, +uint*);
scarderror SCardReconnect(scardhandle, share_mode, protocol, disposition, +protocol*);
scarderror SCardReleaseContext(scardcontext);
scarderror SCardSetAttrib(scardhandle, attrib_id, array(char, arg4), uint);
scarderror SCardStatus(scardhandle, +string*, +uint*, +uint*, +protocol*, +atr*, +uint*);
scarderror SCardTransmit(scardhandle, scard_io_request*, array(char, arg4)*, uint, +scard_io_request*, char*, +uint*);
string pcsc_stringify_error(scarderror);