Uninformed: Informative Information for the Uninformed

Vol 1» 2005.May


Memory Dump

To explain how the cards handle credits and refunds, I'll first show you how the memory on the card is laid out. This dump was done using my Towitoko ChipDrive 130 using Towitoko's SmartCard Editor Software (very useful). I highly suggest that you use a commercial smart card reader or some sort of non-dumb reader for dealing with synchronous cards, dumb mouse (and most home-brew) readers only work with asynchronous cards.

             0x00:  9814 ff3c 9200 46b1 ffff ffff ffff ffff
             0x10:  ffff ffff ffff ff00 0000 0000 0000 0000
             0x20:  0000 0000 0000 0000 0000 0000 0000 0000
             0x30:  0000 0000 0000 0000 0000 0000 0000 0000
             0x40:  0000 0000 0000 0000 0000 0000 0000 0000
             0x50:  0000 0000 f8ff ffff ffff ffff fffc ffff
             0x60:  ffff ffff ffff ffff ffff ffff ffff ffff
             0x70:  ffff ffff ffff ffff ffff ffff ffff ffff
             0x80:  ffff ffff ffff ffff ffff ffff ffff ffff
             0x90:  ffff ffff ffff ffff ffff ffff ffff ffff
             0xa0:  fcff ffff ffff ffff ffff ffff ffff ffff
             0xb0:  ffff ffff ffff ffff ffff ffff ffff ffff
             0xc0:  ffff ffff

Now.. if we convert over the 0x50 line to bits and analyze it, we'll notice this (note that bit-endianness is reversed):

             0x50: 0000 0000 0000 0000 0000 0000 0000 0000
             0x54: 0001 1111 1111 1111 1111 1111 1111 1111
             0x58: 1111 1111 1111 1111 1111 1111 1111 1111
             0x5a: 1111 1111 0011 1111 1111 1111 1111 1111

For every bit that is 1 between 0x17 and 0x55:1 (note: :x notation specifies bit offset), you get $0.10 on your card. For every bit that is 0 between 0x5b and 0xb0 you get $0.10 in refunds. The total of these two counters equals the amount of credits on your card. Now, how they handle people using the refunds is by having the buffer of bits inbetween 0x55:1 and 0x5b that can be used if there are refund bits that can be spent. This only allows the user to use   $5 worth of refund bits. On this particular card, the user has $0.60 worth of credits and $0.20 worth of refunds making a total of $0.80 on the card (I know, I'm poor :-/).