Skip to content

Instantly share code, notes, and snippets.

@cyxx
cyxx / AW_copy_protection.md
Last active October 2, 2023 05:00
# Delphine Software Another World copy protection sheet

Delphine Software Another World copy protection sheet

AW Copy Protection Sheet

@cyxx
cyxx / deobfuscate_another_exe.py
Created November 5, 2022 14:57
Deobfuscate Another World DOS executable.
#!/usr/bin/env python3
#
# Deobfuscate Another World DOS executable.
#
# The 20kb executable of the game can be divided in three main sections.
#
# 1. From offset 0x20, LZ91 packed data (https://bellard.org/lzexe.html). Each byte is xor'ed with the previous byte.
# 2. Some relocation code that jumps to the LZ91 decompression routine. Each byte of the x86 bytecode is off by 0xD.
# 3. The start code that patches the relocation code.
#
@cyxx
cyxx / OS_copy_protection.md
Created May 6, 2022 14:25
Operation Stealth copy protection sheet

Delphine Software Operation Stealth copy protection sheet

The game bytecode in auto00.prc checks for a subset of all shapes from the card shipped with the game.

[0002] (09) localvars[1] = random(104)
[0006] (0F) SET object[236].costume, localvars[1]

The sheet below contains the 104 shapes that can be requested on game start.

Flashback Protection Notes

Being released in the early 90s, the developers from Delphine Software protected the game code to prevent piracy.

On start (and later in the game !), the player would have to lookup some symbols in the manual provided with the game.

This document tries to list the game engine routines related to the game protection.

The addresses and routines are based on the disassembly of the French DOS version executable.

#!/usr/bin/env python
#
# Compress .ISO to .CSO (v1), similar to https://sourceforge.net/projects/ciso/
#
# - compression level is set to 9 (maximum)
# - each block is compressed using the 3 zlib strategies (default, filtered, huffman), the smallest is kept
#
from __future__ import print_function
@cyxx
cyxx / README.md
Last active October 2, 2023 05:02
Reverse engineering Heart of Darkness PSX bitmaps

Reverse engineering HoD PSX bitmaps

Heart of Darkness from Amazing Studio is known for its long development time. When released in 1998, the game was available on both Windows and PlayStation platforms.

The Windows version uses a 256 colors palette for its graphics. This is likely inherited from its early development years when DOS and VGA cards were the principal gaming configuration on PC.

The PlayStation version was released a few months after the Windows version. Let’s figure out the native graphics file format used.