[Muscle] PCSCD Not reading Smart Card

Wesley Nugent wnugent at abcsinc.com
Mon Aug 11 09:25:27 PDT 2008


Any suggestions on getting scriptor to read and write to the card? 

I am somewhat new to reverse engineering, and honestly don't know where 
to begin.  I do know a little about bash scripting and have hacked some 
perl programs before and minor C.  I've only had programming training 
with 1 class in Java.  Nowhere near the level of ability as people such 
as yourself.

I have gotten it to read but would like to use scriptor if I can find 
out what commands to give to read and write the card.

Thanks for all your help.

Wesley

Ludovic Rousseau wrote:
> On Mon, Aug 11, 2008 at 3:47 PM, Wesley Nugent <wnugent at abcsinc.com> wrote:
>   
>> Ok, this got it running and I'm able to connect now.  I still get a seg
>> fault when I try to run my read or write programs.  What happens, it
>> says please select reader from the list.  If I hit enter, I get
>> segfault, if I type anything in, it doesn't recognize the reader.  I did
>> a gdb with backtrace and get:
>>
>> #0 0xb7e2e463 in strlen () from /lib/tls/i686/cmov/libc.so.6
>> #1 0xb7f0c457 in SCardConnect (hContext=16996003,
>>   szReader=0x1000 <Address 0x1000 out of bounds>, dwShareMode=2,
>>   dwPreferredProtocols=4, phCard=0xbf9e1758, pdwActiveProtocol=0xbf9e12f8
>>   at winscard_clnt.c:745
>> #2 0x08048c50 in ?? ()
>>     
>
> SCardConnect() is called with szReader=0x1000. szReader is supposed to
> be a pointer to a C string containing the reader name to use.
> It is clear that your application is using a wrong value here and can
> only crash.
>
> I am surprised your application ever worked.
>
>   
>> On a side note, I do have scriptor installed and can connect to the
>> smart card reader using scriptor.  It uses RAW protocol and comes up
>> says reading commands from STDIN.
>>
>> Unfortunately, I don't know what commands to give it.  If you could
>> point me to the commands to read and write in raw mode, or where I can
>> find these commands, I would appreciate it.  Either help with the
>> segfault or the commands to read/write with scriptor in RAW mode would
>> be of great benefit to me.
>>     
>
> I think you will have to reverse engineer the scard-read and
> scard-write program (since you do not have the source code) and
> rewrite them.
>
> The --apdu pcscd option to log the apdu exchanged was introduced in
> pcsc-lite 1.1.2beta1 and your "working" configuration is using
> pcsc-lite 1.1.1. So it will not be easy to get the exchanged APDU.
>
> Good luck,
>
>   


-- 
-------------- next part --------------
Skipped content of type multipart/related


More information about the Muscle mailing list