Programming: Help reading Smart Card. - Page 1
Forum section: electronics / projects

author: gcain
author_rank: Newbie
timestamp: August 31, 2017, 09:46:45 am
content: I found a gaming kiosk that was made by a company that has long since gone bust.The game seems to authenticate against a Smart Card, but the card expired eons ago.I was hoping someone could give me some direction on how to read the card. My programming skills are fine, it's my understanding of the card that might be the issue.The reader is an ACR38 and the card, I think, is an SLE4442 (it has no markings at all). Although I suspect it is actually a Memory Smart Card or simply EEPROM even.The little program I wrote uses the PCSC library but complains that the card 'Cannot be started' or 'Cannot be reset' yet I can ready other cards, such as my bank card or debit card etc., this is why I suspect the card is actually not a "Smart Card" but just a memory card.The goal is to do a memory dump, open the data in some sort of hex editor and find where the expiry date is set, then write a new card with the updated binary.Any one have any suggestions?The game looks pretty cool and would be a cool "garage toy" (wife won't allow it in the house).

author: Rerouter
author_rank: Super Contributor
timestamp: August 31, 2017, 09:49:58 am
content: http://lmgtfy.com/?q=smart+card+pinoutSmart cards have a standard pinout, and generally follow the same general method to read or write to it, you should be able to bash something together pretty easily with your microcontroller of choice.

author: gcain
author_rank: Newbie
timestamp: August 31, 2017, 09:59:22 am
content: Yeh, I know the pin out already, thanks.Would I read it using something an USBASP Programmer?Or maybe even just a Raspberry Pi and flashrom (whats the chip type though)?

author: CJay
author_rank: Super Contributor
timestamp: August 31, 2017, 10:07:18 am
content: What you need to do is get an ISO-7816 card reader and find some tools that will let you talk to the card, there were plenty of them around in the Videocrypt hacking days that would allow you to analyse card responses but ISTR the one that will give you an 'in' would be the ATR string which I think will allow you to identify the card.Of course not all smartcards are actually smart and there were many places that made fairly dumb I2C EEPROM cards, there were also PIC based, ATMEL based etc. cards for 'hobbyist' use (generally used for hacking various pay TV services) so you could be looking at almost anything, programmed in almost any way with any sort of non standard protocol if it's not answering to an ISO-7816 reset, you could of course also be looking at a faulty card.Best way forward if you can't identify the card positively would be to grab a cheap logic analyser and hook up to the card reader in the kiosk then try to analyse the traffic you capture.

author: DrGeoff
author_rank: Frequent Contributor
timestamp: August 31, 2017, 10:24:08 am
content: Stick a logic analyser on the clock and I/O pin and see what the transaction looks like. It's entirely possible that you can replace the card with a microcontroller to emulate the interface. If the card is an SLE4442 then I think this had a write-once memory region, but it can be freely read. Start doing some reverse engineering on the interface and see where you get.

author: PA0PBZ
author_rank: Super Contributor
timestamp: August 31, 2017, 10:32:09 am
content: Looks like you have a lot to choose from:Quote

author: DrGeoff
author_rank: Frequent Contributor
timestamp: August 31, 2017, 10:44:27 am
content: Quote from: PA0PBZ on August 31, 2017, 10:32:09 amWell it sure isn't going to be a PIV or CAC card is it!

author: gcain
author_rank: Newbie
timestamp: August 31, 2017, 11:29:57 am
content: Thanks guys, I'll follow up on your suggestions and report back.