Thursday, July 10, 2008

Strider Password Generator

I have fun with classic games. I grabbed the Capcom Classics Mini Mix for the Game Boy a while back, mostly for Bionic Commando, but Strider was a nice bonus.

Back in the 1980's, game consoles didn't have memory sticks, and it was rare for a cartridge to actually have persistent storage. So most adventure games used "passwords" to store the game state: a long string of digits that you could re-enter to continue playing later.

Some were very easy to reverse-engineer; MegaMan 2 barely even bothered making it tough, and MegaMan 3 wasn't that much trickier. Some were obviously complicated -- Metroid, for instance, although Metroid has such a big following that many people have analyzed the entire ROM, giving direct access to the code for the password so that the checksum could be analyzed.

Strider fits a bit in the middle. The password at the start of the game is AAIA AAAA AAIA, practically begging to be understood. Trying to change it to all A's fails, but it's technically a valid password, just one the game is hardwired not to accept.

Each letter of the password can range from A to P, making it one hex digit. So we're looking at a total of just six bytes. There's a little bit of slack available, because 26 bits could encode all possible game states. I'll refer to each letter in the password as a nibble.

Slowly iterating through the game state and comparing passwords takes a while, but the simple form is that a password starts with all A's, and then adds values in pairs, using the second-last nibble as a very rough checksum.

  • Keys: Add 8, 4, 2, 1 for keys 1, 2, 3, 4 to the third and eleventh nibbles.
  • Boots: Add 8, 4, 2 for Aqua, Magnet, Attack to the fifth and eleventh nibbles.
  • Disks: Add 8, 4, 2, 1 for disks 1, 2, 3, 4 to the seventh and eleventh nibbles.
  • Disks Analyzed: Add 8, 4, 2, 1 for disks 1, 2, 3, 4 to the ninth and eleventh nibbles.
So AAIA AAAA AAIA is the password for having key 1, which you have when the game begins. The game doesn't let you start without key 1, which is why the AAAA AAAA AAAA password is rejected.

So if you forget all the above, you can just change the I's in the default password into P's and you'll start with 4 keys. Pretty quick for skipping ahead in the game.

If you're familiar with the game you'll notice that I've left some other stuff out, including the keys and disks that are higher than 4. These aren't nearly as simple, but I'll give it a shot. Really, the Javascript code might be clearer.

  • For each level above 1: Add 1 to all nibbles, but 2 to the second and 0 to the eleventh.
  • Key 5: Add 14 to all nibbles, except 10 to the fourth, 0 to the sixth, and 0 to the eleventh.
  • Disk 6: Add 4 to all nibbles, except 8 to the eighth, and 0 to the eleventh.
  • Disk 5: Double the previous.
  • Analyzed Disk 6: Add 4 to all nibbles, except 8 to the tenth and 0 to the eleventh.
  • Analyzed Disk 5: Double the previous.
  • Plasma Arrow: Add 1 to all nibbles, but 2 to the sixth and 0 to the eleventh.
  • Red Dragon Open: Add 1 to all nibbles, but 2 to the fourth and 0 to the eleventh.
  • Fought Kain: Double the previous.
So there's one common theme to this set: adding 0 to the eleventh nibble. If you look at it sideways and squint, you can kind of see a connection between the values for disks 5-6 and disks 1-4. The key 5 value is totally bonkers.

One obvious point comes up that when you are adding all these numbers, you get overflows. The rule is just to toss them away, except for the first nibble. However many times it overflows, you increment the eleventh nibble that many times. This is why key 5 is described as adding 14 instead of subtracting 2.

By messing with game data like this, you can easily create unwinnable games:

  • Often times the game will lock you into an area to level up and not let you leave until you pick up a key item. If you already have the item but not the level, the game won't let you leave.
  • If you give yourself all the boots and grab key 4 out of the upper room of Kazakh, you'll be stuck in a room you can't exit without key 2.
  • If you go to the Red Dragon without both Slide In and the Magnetic Boots, you can't get to the boss. And I don't think you can defeat that boss if you don't have Plasma Arrow.
The level-up logic is pretty straightforward: if you accomplish something to get you to level X, your level is bumped up to X -- unless it's already higher, in which case you stay at that level. Sometimes I found the game awarding me with a level up even when my level stayed the same. ("BKAP BDAN ANAB" might do this, but my notes are messy right there.) Which level you are at determines the "story" you get at the password screen.

"BBJC BBEB EBOB" will generate an interesting bug if you analyze disk 4. (I've found another way of getting this bug, with Kain instead of Matic, but don't recall exactly the code path I took to get to it.)

I can't quite figure out the logic for what areas you can travel to after analyzing disks. I do know that once "Red Dragon" is checked, though, that's the only place you can ever travel to. For a real challenge, try doing that at level 2 with only Plasma Arrow and Magnetic Boots.

Feel free to play around with this. Let me know if you find any interesting stuff.

PLEASE ENABLE JAVASCRIPT

Selects your level, HMax, Emax, S.level, Trick

Keys: 1    2    3    4    5   

Disks: 1    2    3    4    5    6   

Disks Analyzed: 1    2    3    4    5    6   

Boots: Aqua    Magnet    Attack   

Others: Plasma Arrow    Fought Kain    Red Dragon Open   

5 comments:

  1. I love this post.

    ReplyDelete
  2. To generate a secure password, I always use a password generator. I like the PasswordWrench one because I can manage them all right there and it’s affordable

    ReplyDelete
  3. I wonder if all password generators block out all regular words, like querty and password. I use a complex password generator

    ReplyDelete
  4. I believe a secure password is something is entirely confidential and stays with you. i think you must make your own password.

    ReplyDelete
  5. I has generated me a really unique and secure pasword. thanks for sharing the post with us.

    ReplyDelete