This page has been robot translated, sorry for typos if any. Original content here.

Reading Payphone Card Firmware

Connecting cards to a computer for reading and writing is mainly done through the LPT port.

We collect the scheme of the reader. (for 8 contacts).

Scheme of connecting cards to a computer

OR according to the table (for 6 contacts).


the appointment

Where to connect

card desoldering

  1. VCC (Power)

  2. RST (reset)

  3. CLK (Clock)

  4. GND (ground)

  5. not used

  6. I / O (input / output)

one.     - + 5V

2.     - 2 pin LPT

3.     - 3 pin LPT

4.     - 25 pin LPT

6.     - 11 pin LPT

Powered by pulsed diodes (anodes to the port) with a 6-9 pin LPT, you can also take it from the first pin of the GamePort (port for the joystick) or from the keyboard.

Work with software

Download 24 kb

So when everything is connected, you can start working with software. If everything is connected correctly, the following will appear on the screen:

If all the data in the HEX codes will have the value "FF" or in the hexadecimal number system "11111111", it means that it is connected incorrectly or is poorly connected. On this I sit my task complete, it is up to you to dare! This program is not only a simple Reader, it still knows how to remove units from the map ...

  2. ISO Physical Standard
The figure shows the numbering of the contacts of the card chip

Type ISO 7816-1


  1. Vcc + 5V

  2. R / w

  3. Clock

  4. Reset

  5. Gnd

  6. Vpp + 21V

  7. I / O

  8. Fuse

1- VCC (power)

2- RST (reset)

3- CLK (clock pulses)

4- GND (ground)

5- no use (not used)

6- I / O (input / output)

  What is written on the cards? (for St. Petersburg cards)

   the purpose of each bit recorded on the card.

Only 16 bytes are used on the card. All others are 0xFF.

Card memory examples

This 50 unit card is over. Number 0050415503.

Good until 09/30/98

E9, 30, FF, 01, F1, E2, 80, C0

00, 00, 00, 00, 00, FF, 18, EA

This 400 unit card is also empty. Number 0400155921.

Good until 09/30/98

E9, 30, FF, 01, 88, A7, 9B, E8

00, 00, 00, 00, 00, FF, D9, 79

Here is a map for 1000 units. 998 left. Number 1000013039.

Valid until 12/31/99

E9, 30, FF, 01, F7, 3F, 59, DC

00, 01, 7F, 0F, 3F, FF, 68, 6B

Then I called on this card. 6 units left.

E9, 30, FF, 01, F7, 3F, 59, DC

00, 00, 00, 00, 3F, FF, 68, 6B

Finally, it is over.

E9, 30, FF, 01, F7, 3F, 59, DC

00, 00, 00, 00, 00, FF, 68, 6B

Field Assignment

1. The first 4 bytes are some kind of identifier. On all maps

E9, 30, FF, 01.

2. The next 4 bytes are the serial number of the card. By arranging the bits in bytes in the reverse order, and then the bytes themselves, we get a 32-bit unsigned integer. For example, bytes F7, 3F, 59, DC with reverse bit order look like EF, FC, 9A, 3B. Get the card number 0x3B9AFCEF or 1000013039 in decimal. It is easy to see that the number printed on the card always consists of 10 digits, and the first 4 digits are the card capacity.

3. The next 5 bytes are the number of units remaining on the card. The storage format is very interesting: the number of single bits in a byte is used, starting with the lowest. Accordingly, the value of byte 07 corresponds to 3 units, the value of 1F to five, and 7F to seven units. The maximum number of units stored in a byte is seven. Accordingly, the octal number system is used. Thus, bytes 00, 01, 7F, 0F, 3F correspond to 01746 in the octal system or 998 units in the decimal system. The maximum number of units can be expressed as 77777 in octal or 32767 in decimal.

4. The next byte is always equal to FF. It doesn't seem to be used.

5. The last two bytes, apparently, express CRC or another control code for the first 8 constant bytes, because when spending units, they do not change, but by

each card has its own. So far their purpose is not clear. It was found that the expiration date is not recorded on the card. Apparently, it is somehow connected with the card number.

Perhaps each expiration date corresponds to a certain range of numbers.

As already mentioned, of the 10 digits of the number, the first 4 express the card's capacity. The remaining 6 do not uniquely identify the card, as more than a million cards have already been issued. In total, with such a numbering system, 6 million cards can exist:

* For 25 units with numbers from 0025000000 to 0025999999

* For 50 units with numbers from 0050000000 to 0050999999

* For 100 units with numbers from 0100000000 to 0100999999

* For 200 units with numbers from 0200000000 to 0200999999

* For 400 units with numbers from 0400000000 to 0400999999

* For 1,000 units with numbers from 1,000,000,000 to 1,000,999,999