-
Notifications
You must be signed in to change notification settings - Fork 1
Unmangling and decoding algorithms
"RLE algorithm on steroids" adapted from this implementation by @samunders-core. Files are mangled in the release versions of Fatal Racing and Whiplash but not in the Fatal Racing demo or beta.
The Actua Soccer/UEFA Euro 96 England source code was accidentally distributed on the cover disc of issue 71 (May 1996) of French computer magazine Joystick, including the original unmangler implementation (UNMANGLE.C). The source code was later made available on the Gremlin Archive under a CC BY-NC-ND 4.0 licence.
Note that UNMANGLE.C ignores the 4-byte header containing the unmangled file length and instead terminates the output when a zero control byte is found. However, the header is used by SOUND.C in Fatal Racing/Whiplash (loadfile and getcompactedfilelength).
Encoding is applied to .KC files (cheat audio activated by TOPTUNES), FATAL.INI (configuration file) and PASSWORD.INI (cheat names). To decode these, apply a bitwise XOR against the Fibonacci-like sequence
-
.KC files:
$a_0 = 115$ ,$a_1 = 150$ Note .KC files must be unmangled first, then decoded.
-
FATAL.INI:$a_0 = 77$ ,$a_1 = 101$ -
PASSWORD.INI:$a_0 = 23$ ,$a_1 = 37$ By decoding
PASSWORD.INIin Fatal Racing V2.0 builds or Whiplash we can find two undocumented cheat names:- PROCESS: performs a Pentium FDIV bug check and changes to TYPE A if the bug is found or TYPE B if not
- CLONES: not implemented.
frontend.c also calls this function with