All Projects → Clownacy → Cse2

Clownacy / Cse2

Licence: other
Decompilation of Cave Story (v1.0.0.6)

Projects that are alternatives of or similar to Cse2

Apktool
A tool for reverse engineering Android apk files
Stars: ✭ 12,978 (+7273.86%)
Mutual labels:  reverse-engineering
Anno1800 Mod Loader
The one and only mod loader for Anno 1800, supports loading of unpacked RDA files, XML merging and Python mods.
Stars: ✭ 161 (-8.52%)
Mutual labels:  reverse-engineering
Apkstudio
Open-source, cross platform Qt based IDE for reverse-engineering Android application packages.
Stars: ✭ 2,246 (+1176.14%)
Mutual labels:  reverse-engineering
Js Reverse
JS逆向研究
Stars: ✭ 159 (-9.66%)
Mutual labels:  reverse-engineering
Frida Ios Dump
pull decrypted ipa from jailbreak device
Stars: ✭ 2,223 (+1163.07%)
Mutual labels:  reverse-engineering
Antidebugging
A collection of c++ programs that demonstrate common ways to detect the presence of an attached debugger.
Stars: ✭ 161 (-8.52%)
Mutual labels:  reverse-engineering
Cmd
Command line tools for database operation written by Go, moved to https://gitea.com/xorm/cmd
Stars: ✭ 154 (-12.5%)
Mutual labels:  reverse-engineering
Hl2sdk
Half-Life 2 SDK Mirrors
Stars: ✭ 173 (-1.7%)
Mutual labels:  reverse-engineering
Androidlibrary
Android library to reveal or obfuscate strings and assets at runtime
Stars: ✭ 162 (-7.95%)
Mutual labels:  reverse-engineering
Elf Dump Fix
Utils use to dump android ELF from memory and do some fix including the ELF section header rebuilding
Stars: ✭ 166 (-5.68%)
Mutual labels:  reverse-engineering
Uddbg
A gdb like debugger that provide a runtime env to unicorn emulator and additionals features!
Stars: ✭ 159 (-9.66%)
Mutual labels:  reverse-engineering
Pikachu Volleyball P2p Online
Pikachu Volleyball peer-to-peer online via WebRTC data channels
Stars: ✭ 160 (-9.09%)
Mutual labels:  reverse-engineering
Android Lkms
Android Loadable Kernel Modules - mostly used for reversing and debugging on controlled systems/emulators
Stars: ✭ 164 (-6.82%)
Mutual labels:  reverse-engineering
Binja Retdec
Binary Ninja plugin to decompile binaries using RetDec API
Stars: ✭ 158 (-10.23%)
Mutual labels:  reverse-engineering
Pdbripper
PDBRipper is a utility for extract an information from PDB-files.
Stars: ✭ 173 (-1.7%)
Mutual labels:  reverse-engineering
Degate
Open source software for chip reverse engineering.
Stars: ✭ 156 (-11.36%)
Mutual labels:  reverse-engineering
Iphonebackuptools
iOS Backup Data Extraction
Stars: ✭ 162 (-7.95%)
Mutual labels:  reverse-engineering
Memject
Simple Dll injector loading from memory. Supports PE header and entry point erasure. Written in C99.
Stars: ✭ 176 (+0%)
Mutual labels:  reverse-engineering
Earth Reverse Engineering
Reversing Google's 3D satellite mode
Stars: ✭ 2,083 (+1083.52%)
Mutual labels:  reverse-engineering
Pwnshop
Exploit Development, Reverse Engineering & Cryptography
Stars: ✭ 167 (-5.11%)
Mutual labels:  reverse-engineering

Build Status

Table of Contents

This repo has two main branches:

Branch Description
accurate The main decompilation branch. The code is intended to be as close to the original as possible, down to all the bugs and platform-dependencies.
portable This branch ports the engine away from WinAPI and DirectX, and addresses numerous portability issues, allowing it to run on other platforms.

CSE2

CSE2 is a decompilation of Cave Story.

Screenshot

Background

When Pixel made Cave Story, he compiled the original Windows EXE with no optimisations. This left the generated assembly code extremely verbose and easy to read. It also made the code very decompiler-friendly, since the assembly could be mapped directly back to the original C++ code.

Technically, this alone made a decompilation feasible, as was the case for the Super Mario 64 decompilation project - however, there was more to be found...

In 2007, a Linux port of Cave Story was made by Simon Parzer and Peter Mackay. Details about it can be found on Peter's old blog. This port received an update in 2011, including two shiny new executables. What they didn't realise was that they left huge amounts of debugging information in these executables, including the names of every C++ source file, as well as the variables, functions, and structs they contained.

This was a goldmine of information about not just the game's inner-workings, but its source code. This is the same lucky-break the Diablo decompilation project had. With it, much of the game's code was pre-documented and explained, saving us the effort of doing it ourselves. In fact, the combination of easy-to-decompile code, and a near-full set of function/variable names, reduced much of the decompilation process to mere copy-paste.

To top it all off, some of Cave Story's original source code would eventually see the light of day:

In early 2018, the Organya music engine was released on GitHub by an old friend of Pixel's. On top of providing an insight into Pixel's coding style, this helped with figuring out one of the most complex parts of Cave Story's codebase.

And... that's it! It's not often that a game this decompilable comes along, so I'm glad that Cave Story was one of them. Patching a dusty old executable from 2005 sucks.

Building

Visual Studio .NET 2003

Project files for Visual Studio .NET 2003 are available, and can be found in the 'vs2003' folder.

As proven by the original Doukutsu.exe's Rich Header, Pixel used Visual Studio .NET 2003 to compile Cave Story. This means these project files allow us to check the accuracy of the decompilation by comparing the generated assembly code to that of the original executable. The tool for this can be found in the 'devilution' folder.

CMake (Visual Studio & MinGW-w64)

(A beginner-friendly guide can be found in VISUAL_STUDIO_2019_GUIDE.md)

Switch to the terminal (Visual Studio users should open the Developer Command Prompt) and cd into this folder. After that, generate the files for your build system with:

cmake -B build -DCMAKE_BUILD_TYPE=Release

MSYS2 users should append -G"MSYS Makefiles" to this command, also.

You can also add the following flags:

Name Function
-DJAPANESE=ON Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation)
-DFIX_BUGS=ON Fix various bugs in the game
-DFIX_MAJOR_BUGS=ON Fix bugs that invoke undefined behaviour or cause memory leaks
-DDEBUG_SAVE=ON Re-enable the dummied-out 'Debug Save' option, and the ability to drag-and-drop save files onto the window
-DLTO=ON Enable link-time optimisation
-DMSVC_LINK_STATIC_RUNTIME=ON Link the static MSVC runtime library, to reduce the number of required DLL files (Visual Studio only)

You can pass your own compiler flags with -DCMAKE_C_FLAGS and -DCMAKE_CXX_FLAGS.

You can then compile CSE2 with this command:

cmake --build build --config Release

If you're a Visual Studio user, you can open the generated CSE2.sln file instead, which can be found in the build folder.

Once built, the executable can be found in the game_english/game_japanese folder, depending on the selected language.

Makefile (MinGW-w64) [deprecated - use CMake instead]

Run 'make' in this folder, preferably with some of the following settings:

Name Function
JAPANESE=1 Enable the Japanese-language build (instead of the unofficial Aeon Genesis English translation)
FIX_BUGS=1 Fix various bugs in the game
FIX_MAJOR_BUGS=1 Fix bugs that invoke undefined behaviour or cause memory leaks
DEBUG_SAVE=1 Re-enable the dummied-out 'Debug Save' option, and the ability to drag-and-drop save files onto the window
RELEASE=1 Compile a release build (optimised, stripped, etc.)
STATIC=1 Produce a statically-linked executable (so you don't need to bundle DLL files)

You can pass your own compiler flags by defining CXXFLAGS.

Once built, the executable can be found in the game_english/game_japanese folder, depending on the selected language.

Licensing

Being a decompilation, the majority of the code in this project is proprietary and belongs to Daisuke "Pixel" Amaya.

Modifications and custom code are made available under the MIT licence. See LICENCE.txt for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].