The change in the previous commit was a silly case of not thinking
things through, not realizing that the .data range moved to Core.obj was
nowhere near the beginning of the section as it should be. g_game has
been moved back into Jet2.obj (time will tell if this is correct) and a
missed data strucure at the beginning of .data (where it ought to be)
now makes up Core.obj's .data portion.
objdiff assumes that all symbols in executable memory sections are code,
which led to misbehaviour due to .rdata and .data being marked as
executable in JSRF. We now set these sections to non-executable in
Ghidra to work around this.
Some notes on keeping data structure definitions in decompiled source
files have been added, and a section was added for specific topics in
the future.
We can now create a fresh Ghidra project, import the JSRF executable
into it, import symbols into it, delink object files from it, and then
decompile with objdiff. Just needs some documentation.
If you've cloned this repository on Windows, you have either a POSIX
environment or Git Bash and can run this script. It just needs to call
the right headless Ghidra script depending on the OS (which it now tries
to do).
This is intended more as a proof of concept as we figure things out
than the start of an actual decompilation in this repository. Target
object files are currently "bring your own."
The way the VC++7 compiler places exception-handling code and data at
the end of `.text` and `.rdata` is by putting them in sections named
`.text$x` and `.rdata$x`* that then get merged onto the ends of the
`$x`-free versions. To better match what's seen in objdiff, we apply
the same naming convention here.
*It's actually `.xdata$x`, but we'll merge it into `.rdata` manually if
we have to.
There's actually a chunk at the end of the section with static object
constructors and exception handling code, which might need to be paired
up with each component as well, but this covers the whole section
otherwise.
The release binary was called Jet2.exe (according to the XBE header), so
they were apparently capitalizing file names. This was already
reflected in objects.csv, but not the source files.