Good afternoon, dear users.
Recently I wrote a post about password generation for the first and second Road Rash. In the
comments to the article I was asked to clarify how the password system in the game Rock n 'Roll Racing is arranged. About this I would like to talk to you. But I would like to start with the game Super Castlevania IV. Well, let's get started.

Super Castlevania IV
Games for SNES, I have never "hacked". Well, until one moment. I once saw my brother playing this game. And he somehow casually said that it would be very good if it were possible to generate passwords on Super Castlevania IV. Without thinking, I set to work. After three sleepless nights, I realized what and how the password is stored.
')
Theory
The password consists of 16 cells (positions), each cell consists of 2 bits, a total of 16 * 2 = 32 bits. These bits save game data parameters:
- level number (0-14)
- 8 character player name
- quest (1-4)
Now let's see what the raw password consists of:
* in brackets will be indicated the number of bits.
C4 (1) , C4 (0) | D (1) , D (0) | ? (1) (0) | C2 (1) , C2 (0) |
C6 (1) , C6 (0) | N (15) , N (14) | U1 (1) , U1 (0) | C5 (1) , C5 (0) |
U2 (1) , U2 (0) | C1 (1) , C1 (0) | ? (1) (0) | L (1) , L (0) |
N (13) , N (12) | C3 (1) , C3 (0) | L (3) , L (2) | U3 (1) , U3 (0) |
Legend
? - always equal to zero.
U - unused bits.
D - (quest -1) (1-4) in binary number system. (00 - normal difficulty, 01 - increased complexity. I did not find passwords for Quest 3 and 4. On the Internet, the game records this data for some reason. Difficulty will not grow, but suddenly, if you complete the fourth quest, the secret ending will open? Although ... most likely nothing will change.)
N - the value of the name in the binary number system. The total of the name values ​​is subtracted from the initial value.
* in brackets recorded values ​​of characters.
* [] - space.
A (11) | B (12) | C (13) | D (14) | E (15) | F (16) | G (17) | H (18) | I (19) |
J (20) | K (21) | L (22) | M (23) | N (24) | O (25) | P (26) | Q (27) | R (28) |
S (29) | T (30) | U (31) | V (32) | W (33) | X (34) | Y (35) | Z (36) | [] (0) |
12) | 2 (3) | 3 (4) | 4 (5) | 5 (6) | 6 (7) | 7 (8) | 8 (9) | 9 (10) |
L - (level number (0-14) div3) in binary number system.
* Level B-3 consists of three parts.
room | Level | Initial value of the name |
0 | 1-1 | 2040 |
one | 2-1 | 10240 |
2 | 3-1 | 14340 |
3 | 4-1 | 34826 |
four | 5-1 | 10256 |
five | 6-1 | 43026 |
6 | 7-1 | 51226 |
7 | 8-1 | 43042 |
eight | 9-1 | 47142 |
9 | A-1 | 55343 |
ten | B-1 | 14388 |
eleven | B-3 (1) | 63543 |
12 | B-3 (2) | 2104 |
13 | B-3 (3) | 18489 |
14 | B-4 | 34874 |
Checksums
C1 = N
(1) , N
(0) + D
(1) , D
(0)C2 = N
(3) , N
(2) + C1
(3) , C1
(2) + U2
(1) , U2
(0)C3 = N
(5) , N
(4) + C2
(3) , C2
(2) + U1
(1) , U1
(0)C4 = N
(7) , N
(6) + C3
(3) , C3
(2) + U3
(1) , U3
(0)C5 = N
(9) , N
(8) + C4
(3) , C4
(2)C6 = N
(11) , N
(10) + C5
(3) , C5
(2)I want to draw your attention to the fact that the two high-order bits from one checksum pass into the next checksum.
Coding

0 (00) is empty.
1 (01) - the ax.
2 (10) - holy water.
3 (11) - the heart.
Password generation exampleCreate a password that saves these parameters:
- Name: "AWL [] VITA"
- quest (4)
- all unused bits are one
- level B-3 (2)
We translate the values ​​into the binary number system:
level number (12div3 = 4) = 0100
Quest (4) = 4-1 = 3 = 11
Calculate the value of the name:
AWL [] VITA = 11 + 33 + 22 + 0 + 32 + 19 + 30 + 11 = 158
2104-158 = 1946 = 11110011010
N
(15) , N
(14) = 00
N
(13) , N
(12) = 00
N
(11) , N
(10) = 01
N
(9) , N
(8) = 11
N
(7) , N
(6) = 10
N
(5) , N
(4) = 01
N
(3) , N
(2) = 10
N
(1) , N
(0) = 10
Calculate checksums:
C1 = 10 + 11 = 0101
C2 = 10 + 01 + 11 = 0110
C3 = 01 + 01 + 11 = 0101
C4 = 10 + 01 + 11 = 0110
C5 = 11 + 01 = 0100
C6 = 01 + 01 = 10
We write the data in the table:
ten | eleven | 00 | ten |
ten | 00 | eleven | 00 |
eleven | 01 | 00 | 00 |
00 | 01 | 01 | eleven |
It remains to translate the numbers into a graphic image.
Rock n 'Roll Racing
I “hacked” this game for a long time and then did not use the method of bit parsing. Therefore, the approach to this game will be slightly different.

Theory
The password consists of 12 positions in which game data is saved:
- difficulty (recruit, veteran, warrior)
- Division (A, B)
- cars (5 normal + 3 glukukuty)
- color of the car (5 normal + 1 gluknuty)
- planets (6 normal + 2 glued)
- characters (6 normal + 1 secret + 1 glitchy)
- car armor (1-4)
- car engine (1-4)
- car suspension (1-4)
- car tires (1-4)
- spikes / mines (depending on the machine selected) (0-7)
- nitro / jump (depending on the machine chosen) (0-7)
- rockets / cartridges (depending on the machine chosen) (0-7)
- the amount of money ($ 0-1599000) in increments = 1000.
Now let's see how the values ​​in the positions change depending on the selected game parameters:
Complexity | 1 position | 4 position |
Rookie | +0 | XOR5 |
Veteran | XOR8 | XOR1 |
Warrior | XOR16 | XOR13 |
Division | 1 position | 7 position |
A | XOR8 | +0 |
B | +0 | +2 |
A machine | 2 position | 3 position | 9 position |
Glitch | +0 | +0 | +0 |
Glitch | +0 | XOR16 | +4 |
Glitch (self-destructing machine) | XOR1 | +0 | +8 |
Air blade | XOR1 | XOR16 | +12 |
Marauder | XOR2 | +0 | +16 |
Dirt Devil | XOR2 | XOR16 | +20 |
Havac | XOR3 | +0 | +24 |
Battle trak | XOR3 | XOR16 | +28 |
Car color | 2 position | 8 position |
Red | XOR20 | +0 |
Green | XOR16 | +1 |
The black | XOR28 | +2 |
Blue | XOR4 | +4 |
Glitch (pink-green color) | +0 | +5 |
Yellow | XOR12 | +6 |
Engine | 1 position | 10 position | 11 position |
one | +0 | +0 | +16 |
2 | XOR4 | +0 | +0 |
3 | XOR8 | +1 | +16 |
four | XOR12 | +1 | +0 |
Tires | 1 position | 4 position | 10 position |
one | +0 | +0 | +6 |
2 | XOR16 | +0 | +4 |
3 | +0 | XOR16 | +2 |
four | XOR16 | XOR16 | +0 |
Armor | 3 position | 9 position |
one | XOR4 | +1 |
2 | +0 | +0 |
3 | XOR12 | +3 |
four | XOR8 | +2 |
Suspension | 3 position | 10 position |
one | +0 | +8 |
2 | XOR1 | +0 |
3 | XOR2 | +24 |
four | XOR3 | +16 |
Nitro / jump | 1 position | 2 position | 11 position |
0 | +0 | +0 | +8 |
one | +0 | XOR16 | +10 |
2 | XOR1 | +0 | +12 |
3 | XOR1 | XOR16 | +14 |
four | XOR2 | +0 | +0 |
five | XOR2 | XOR16 | +2 |
6 | XOR3 | +0 | +4 |
7 | XOR3 | XOR16 | +6 |
Spikes / Mines | 2 position | 11 position | 12 position |
0 | +0 | +1 | +0 |
one | XOR2 | +1 | +8 |
2 | XOR4 | +1 | +16 |
3 | XOR6 | +1 | +24 |
four | XOR8 | +0 | +0 |
five | XOR10 | +0 | +8 |
6 | XOR12 | +0 | +16 |
7 | XOR14 | +0 | +24 |
Missiles / ammo | 2 position | 3 position | 12 position |
0 | +0 | +0 | +0 |
one | +0 | XOR8 | +1 |
2 | +0 | XOR16 | +2 |
3 | +0 | XOR24 | +3 |
four | XOR1 | +0 | +4 |
five | XOR1 | XOR8 | +5 |
6 | XOR1 | XOR16 | +6 |
7 | XOR1 | XOR24 | +7 |
Planets | 1 position | 7 position | 8 position |
Bogmire | +0 | +1 | +0 |
New mojave | XOR1 | +1 | +8 |
Chem VI | XOR2 | +1 | +16 |
Drakonis | XOR3 | +1 | +24 |
Glitch | XOR4 | +0 | +0 |
Glitch | XOR5 | +0 | +8 |
NHO | XOR6 | +0 | +16 |
Inferno | XOR7 | +0 | +24 |
Characters | 1 position | 3 position | 4 position | 7 position |
Tarquim | +0 | XOR1 | XOR16 | +0 |
Jake badlance | XOR16 | XOR1 | XOR16 | +4 |
Glitch | +0 | XOR1 | +0 | +8 |
Olaf (secret character) | XOR16 | XOR1 | +0 | +12 |
Cyberhawk | +0 | +0 | XOR16 | +16 |
Snake sanders | XOR16 | +0 | XOR16 | +20 |
Katarina lions | +0 | +0 | +0 | +24 |
Ivanzypher | XOR16 | +0 | +0 | +28 |
Now let's see how the positions change depending on the amount of money:
X
1z. X
2z. X
3z. X
4z. 000 $
The amount of money needs to be divided by 1000 and the balance to determine changes in positions.
1 position = XOR (x $ div 200)
2 position = XOR (3z. + 0, if x $ div 100 is an even number, or +16, if an odd number)
3 position = XOR (4. * 2)
4 position = XOR (x $ div 400)
5 position = ((x $ div 100) mod4) XOR ((x $ div 20) mod5)
(↓)
(The resulting number is converted)
in accordance with
0 → 13
1 → 5
2 → 29
3 → 21
6 position = ((x $ div 10) mod2) XOR 4h.
(↓)
(The resulting number is converted)
in accordance with
0 → 12
1 → 28
Coding
Characters in the positions take the values ​​“BCDFGHJKLMNPQRSTVWXYZ0123456789!”, Where B = 0, C = 1 ... 9 = 30,! = 31.
Password generation exampleCreate a password that saves these parameters:
- complexity (veteran)
- Division (A)
- car (Dirt Devil)
- car color (red)
- planet (new mojave)
- character (Cyberhawk)
- armor (1)
- engine (3)
- suspension (2)
- tires (4)
- spikes / mines (5)
- nitro / jump (3)
- rockets / cartridges (7)
- money ($ 1257,000)
Calculate money:
1257000/1000 = 1257
1 position = 1257 div 200 = 6 = XOR6
2 position = 5+ (1257 div 100) = 5 + 12 (since the number is even, then +0) = 5 + 0 = XOR5
3 position = 7 * 2 = 14 = XOR14
4 position = 1257 div 400 = 3 = XOR3
5 position = ((1257 div 100) mod4 = 0 → 13. 13 XOR (1257 div 20) mod5 = 13 XOR 2 = 15
6 position = ((1257 div 10) mod2 = 1 → 28. 28 XOR 7 = 27
Now write the position values ​​in the table:
* n. - position.
1 p. | 2 p. | 3 p. | 4 p. | 5 p. | 6 p. | 7 p. | 8 p. | 9 p. | 10 p. | 11 p. | 12 p. |
XOR6 | XOR5 | XOR14 | XOR3 | 15 | 27 | +1 | +8 | +20 | +1 | +16 | +8 |
XOR8 | XOR2 | XOR16 | XOR1 | +0 | +0 | +16 | +0 | +1 | +0 | +14 | +7 |
XOR8 | XOR20 | XOR4 | XOR16 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 |
XOR8 | XOR10 | XOR1 | XOR16 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 |
XOR16 | XOR16 | XOR24 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 |
XOR1 | XOR1 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 |
XOR1 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 | +0 |
We make the necessary calculations and get:
30,8,3,2 15,27,17,8 21,1,30,15
Now we encode this string:
9LFD T6WL 0C9T
Conclusion
Well, I hope that I didn’t confuse you too much with Rock n 'Roll Racing. Good luck, thanks for reading.