Skip to content

ChrisNonyminus/sims2_mac_decomp

Repository files navigation

sims2_mac_decomp

A WIP matching decompilation (aiming for logical matching decompilation of individual functions as opposed to raw matching of the entire binary... for now) of The Sims 2 (Bon Voyage update, PowerPC Mac OS X port).

Very barebones, and no function is matching yet. See the bash and python scripts.

Extract a clean ppc executable of the game (see the sha1 file for the hash) from a universal binary of BV's Mac OS X port, dated December 17, 2007, and place it in the root folder as "baserom.ppc".

To generate an asm file, type python3 tools/mach-disasm.py baserom.ppc baserom.sym > asm/sims2.s. To generate an asm file that mips_to_c can read, type python3 tools/mach-disasm_m2c-support.py baserom.ppc baserom.sym > asm/sims2.new-syntax.s.

Prerequisites:

Decompilation Instructions

  1. Pick a function from the generated asm file (must not be the mips_to_c-compatible version).
  2. Extract that function into its own file, to be placed as tmp/orig.s.
  3. Create a cpp file and place it as tmp/code.cpp.
  4. In a linux shell, type and enter COMPILER_FLAGS="-O4" FUNCTION=<symbol name of function> COMPILER_PATH=<path to gcc cross-compiler> ./auto_assemble_tmp_code.sh.
  5. In a seperate text editor, edit and save tmp/code.cpp or the generated file tmp/compiler_flags.txt, while the script loops. (It loops so the code can automatically be compiled every time it's changed.)
  6. View tmp/diff.txt.
  7. Repeat steps 5 and 6 until a function is matching.

Externals:

About

Sims 2 decompilation (WIP)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published