Alkatraz obfuscation?

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
Irmak
Drutt
Posts: 6
Joined: Sat Mar 26, 2022 10:04 am

Re: Alkatraz obfuscation?

Post by Irmak »

jpnz wrote: Sun Apr 10, 2022 10:51 pm Which titles are you working with?
Right now I'm looking at Temple of Terror (graphics version). The other titles that use Alkatraz are Terraquake (Masters of the Universe) and Kayleth.

Thanks a lot for the link to the source code!

The actual decryption seems to happen in the "Fast Load" routine at line 330 in the file named C.S, line 327 in the file M.S and 328 in MC.S. A byte is loaded from the tape pretty much as in the ROM tape loading routine, into the L register. A stored byte value (called LOACON in the source) is loaded into A which is then XORed with D, E, IXh, IXl, and then finally the with the byte loaded from tape, held in L. At this stage i think DE holds the remaining number of bytes to be read from tape, and IX is the address to be written to. After this, A holds the final decrypted byte value, which is written to (IX+0).

The tricky part is the calculation of the LOACON value. I haven't figured that out yet.
Irmak
Drutt
Posts: 6
Joined: Sat Mar 26, 2022 10:04 am

Re: Alkatraz obfuscation?

Post by Irmak »

Update: I can now decrypt the Temple of Terror tzx file on the fly.

I cheat a little by looking at the memory contents in Fuse at the start of the decryption process and copying some "magic numbers" rather than trying to calculate them in the same way that Akatraz does, but as I'm only doing this for three games, it is not much of a problem.

Thanks a lot to all who helped!
Post Reply