2010/4/9 Ralf Schlatterbeck <[email protected]>: > On Fri, Apr 09, 2010 at 10:47:24AM +0200, Ludovic Rousseau wrote: >> Hello, >> >> I would like to log every PC/SC calls from an application. The >> solution would be a dynamic library loaded using LD_PRELOAD. The >> library would log the parameters and results or every (or most) PC/SC >> functions. >> >> I may have seen such a piece of code some time ago but I don't >> remember where and Google does not help much. >> >> Does anybody know of such a WinSCard logger? >> Or do I have to write one myself? > > ltrace on Linux? Or are you targeting windows?
Unix only for now. I was not aware that ltrace would trace arbitrary library. I thought it was for the libC only and I was wrong. ltrace works but does not interpret the arguments. All I get is $ ltrace -l/usr/lib/libpcsclite.so -o/tmp/st .libs/testpcsc SCardEstablishContext(2, 0, 0, 0xbf961700, 0xb7f1c0f7) = 0 SCardIsValidContext(0x103a581, 0, 0, 0xbf961700, 0xb7f1c0f7) = 0x80100003 SCardConnect(0x103a580, 0x8223260, 2, 3, 0xbf961704) = 0 etc. I have the function name and the return value. That is nice. In some cases I would also display the argument in a human readable format instead of just pointers. Another problem is that ltrace does not work with a program using dlopen() instead of linking to use a library. LD_PRELOAD would not work either is this case. Thanks for the feedback. After more research I found: - WinSCard APDU View Utility http://www.fernandes.org/apduview/index.html It is GPL but for WIndows and only logs SCardTransmit - ScardSpy http://www.idrix.fr/Root/content/category/7/25/48/ It is proprietary and for Windows but logs other winscard functions (but not all) -- Dr. Ludovic Rousseau _______________________________________________ Muscle mailing list [email protected] http://lists.drizzle.com/mailman/listinfo/muscle
