If you're interested in that kind of stuff I highly reccomend watching Karsten Nohl's "Reviving smart card analysis" talk from Chaos Communication Camp 2011 [0].
Basically he takes pictures of the circuits on the smart card and then reverses the logic from that. There's even software to assist with that [1].
As a pure software guy I was pretty baffeled when I saw this the first time.