The Calormen website provides an online Applesoft BASIC emulator developed in javascript. You can enter or upload your code into the emulator and run it immediately, without needing to install an emulator on your PC. The website also offers many examples of Applesoft BASIC source code, including games and graphic demos.
Among these programs, I found a text adventure game called Tays House Adventure, developed by Floyd McWilliams. The goal is to find treasures while avoiding traps in the house of your obviously mad Uncle Tays. While the concept itself is not very original, what really caught my attention was the way the BASIC program was written; all character strings are encrypted, preventing a hacker – or a curious player – from inspecting the source code to crack the game.
For example :
300 DATA "7UVYAO5", "2UQWVJ3", "2GCUV1", "7DLZA3", "9DY5", "5ITBS2", "6T8", "2U3", "2G9", "2Y7", "8C5", "8L8"
305 DATA "2K3", "1JOWFOUPSZ8", "1TDPSF0", "8RCUX6", "3KHOS7"
310 DATA "4XEOI3", "7KYVW9", "6RUUQ9", "3UHDG4", "9NGJVRWN9", "5ZSQTHP0", "9NJC8", "6YVOT4"
To better understand how the game works, I wrote a Python program that decrypts all the character strings and outputs a BASIC program in which everything is readable. The goal is to obtain a clean Applesoft BASIC program with no encrypted data.
Continuer la lecture de « Tays house adventure deciphered »