Engine Transplants - trigger-segfault/TriggersTools.CatSystem2 GitHub Wiki
Engine Transplants
Transplanting an engine is the process of changing, upgrading, or swapping the internal 'functions' (or 'body') of a CatSystem2 visual novel, while still retaining the game 'content' (or 'personality'). Similar to porting to another engine/platform, but realistically a 1-man job, requiring very few changes to game files.
This also has the benefit of being less of a legal 'gray area' for copyright, as diff patches would not be adding game content from other sources/versions (besides that of the target engine).
🚧 This page is a work in progress
Goals of Transplanting
- Localization / UTF-8 support
- System Compatibility
- Remove DRM
List of Procedures
Case 1: Grisaia no Kajitsu => Nekopara Vol.3
Method: Replace the engine of Grisaia no Kajitsu with a version of CatSystem2 supporting CSTL Localization and UTF-8 features.
Materials:
- Grisaia no Kajitsu (EN, 18+) - denpasoft
- Nekopara Vol.3 (EN, 18+) - denpasoft(?)
- MakeInt.exe - cs2 toolset v4.01
- exkifint (any int extractor)
- Resource Hacker
Procedure:
Step 1: TODO
Desired Result: Add CSTL Localization support and improve ver community localization efforts
Status: FAILURE - eventual followup with alternative engine
Writeup: Character sprite drawing throws errors, and never succeeds. Possibly related to use of E-Mote! in Nekopara Vol.3, which seems to cause awkward behavior with classic character sprite drawing.
Case 2: Happiness! Emotion => Djibril 4 Trial
Method: Replace Happiness! Emotion with similar engine version to remove DRM (of which required external software)
Materials:
- Happiness! Emotion (JP, 18+) - fanza games
- Djibril 4 Trial v1 (JP, 18+?) - trial mirror site
- MakeInt.exe - cs2 toolset v4.01
- exkifint (any int extractor)
- Resource Hacker
- WinRAR (any extractor supporting installers)
- Python 3 Interactive Shell
Procedure:
Step 0: Extract Happiness! Emotion game data from installer using WinRAR, bypassing any possible installation attempts or DRM walls
cs2.exe
from Hapiness! Emotion cs2.exe
(which was named SdWrap in the resources).
Step 1: Extract real The real exe was at file offset 0x1c000
, and went until the end of the file. There was 0x10000
of garbage data between SdWrap and Cs2, it's unknown if this is a fixed length, but Cs2 can reliably be detected by searching for a standard PE executable header past offset 0 (really past the end of the SdWrap exe, which can be determined by the final section offset and length)
This was all done via Python 3's Interactive Shell, Resource Hacker was used during resource inspection.
Step 2: Extract KEY_CODE, V_CODE, V_CODE2 from Happiness! Emotion Cs2 resources
Although V_CODE (1) could easily be found without, and KEY_CODE can be whatever you want, V_CODE2 must be obtained from the game executable.
V_CODE2 is needed to extract resources from Happiness! Emotion int archives
Step 3: Replace KEY_CODE, V_CODE, V_CODE2 in Djibril 4 Trial Cs2
Simply done by exporting the raw binary data of all 3 resources, and replacing them with Resource Hacker (decryption is unnecessary)
Step 4: Replace emotedriver.dll
The single revision version change between engines 2.6.1.67 => 2.6.1.68 and difference in emotedriver.dll libraries, was enough to cause crashing the moment the E-Mote logo was to play on the title intro slides. (It's possible this too had the SdWrap DRM, but it was never checked.)
Step 5: TODO
Status: SUCCESS - game runs correctly, no noticeable issues
Writeup: TODO
Case 3: Grisaia no Kajitsu UTF8 transplant
Method: Replace the engine of Grisaia no Kajitsu with a version of CatSystem2 supporting CSTL Localization and UTF-8 features. (2nd attempt)
Materials:
- Grisaia no Kajitsu (EN, 18+) - denpasoft
- Happiness 2! Sakura Celebration (JP, 18+?) - unknown source
- Nekopara Vol.3 (EN, 18+) - denpasoft(?)
- MakeInt.exe - cs2 toolset v4.01
- exkifint (any int extractor)
- Resource Hacker
- jpcmd (+LocaleEmulator) enable Japanese command prompt for compiling FES files with fes.exe (also for mc.exe, although it was not required)
- cs2_tool / cs2_decompile - personal tools for extracting/decompiling scripts and int archives. Script decompilation is necessary for FES, but only requires Zlib to read the file and extract the full raw text.
- catsys Python3 personal library, used for CSTL file generation, and scanning of the initial EN message sets.
Procedure:
See the full page detailing the entire procedure
Status: SUCCESS - procedure requires modification of game files that may not be predictable with automation or guides alone. Developer/programmer/expert on Cs2 may be required on a team to add the initial UTF-8 support. (FES scripts are terrifying beasts)
Writeup: TODO