Commit graph

64 commits

Author SHA1 Message Date
KeybadeBlox
e6d7acfa05 Fix some disconnected symbols in objdiff
This will be so much easier when we can export with name mangling.
2026-02-07 22:09:26 -05:00
KeybadeBlox
576a60d331 Mostly finish function name mangling
Still need to do function pointers.
2026-02-07 22:08:02 -05:00
KeybadeBlox
76e39fdd27 Begin Ghidra mangling script
Looks like we'll be writing our own Ghidra scripts.  At least these
should enable pretty thorough sharing of work and decent UX.
2026-02-05 22:31:36 -05:00
KeybadeBlox
e668b52cd0 Add to GameObj::removeChildrenFromObjList() 2026-02-05 21:11:11 -05:00
KeybadeBlox
35c8844529 Move everything else to ghidra/ directory
The only stuff left in delink/ was also for using with Ghidra, so we may
as well also put it in ghidra/.
2026-02-04 20:01:06 -05:00
KeybadeBlox
63002e0f08 Add data type import for Ghidra 2026-02-04 19:52:12 -05:00
KeybadeBlox
30f8a5879e Include namespace in symbol table
This introduces its own issues, but without namespaces, symbol names end
up repeated and delinking fails.  The delinked symbols also end up
without namespaces, introducing yet more problems.  This is an
improvement for now, but we'll need proper namespace importing into
Ghidra at some point.
2026-02-01 21:11:26 -05:00
KeybadeBlox
cef08bf624 Documentation enhancements for delink.sh
Thanks to Shanghao for helping find and test these different issues.
2026-02-01 17:35:49 -05:00
KeybadeBlox
91537e765a Fix unwanted delinking path expansion on Windows
In short, we ran afoul of this issue because the Ghidra delinking
headless script begins its arguments with slashes, making them look like
absolute paths:

    https://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line
2026-02-01 17:02:13 -05:00
KeybadeBlox
a8b04d24d5 Fix POSIX shell compatibility of delink script
Accidentally used == for a comparison instead of =, while only the
latter is in the standard.

Ref. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
2026-02-01 15:36:35 -05:00
KeybadeBlox
ddc10a878c Minor correction to Decompiling C++
Destructors are not directly registered for exit, but instead called by a
tiny function that's registered.
2026-01-13 21:55:22 -05:00
KeybadeBlox
44a8d704ef Populate JSRF/GameData.cpp 2026-01-12 22:59:47 -05:00
KeybadeBlox
cbcc22ec9d Fix contribution guide link 2026-01-12 09:51:56 -05:00
KeybadeBlox
fbc5619d6a Begin populating JSRF/GameData.hpp 2026-01-12 09:46:56 -05:00
KeybadeBlox
d11f2fd538 Delink JSRF/GameData 2026-01-11 20:46:54 -05:00
KeybadeBlox
8c9f622ab5 Decompiling C++: Add static object initialization 2026-01-09 21:06:28 -05:00
KeybadeBlox
ee519090c1 Add "estimated total progress"
There have been cases of the "decompilation progress" metric being
confused for total progress, so a new figure has been added (in bold)
roughly estimating the total progress by multiplying the other two
together.
2026-01-09 19:29:44 -05:00
KeybadeBlox
d06de00855 Complete Decompiling C++ article (for now) 2026-01-05 23:04:51 -05:00
KeybadeBlox
547f2ba179 Create docs directory; begin "Decompiling C++" 2026-01-03 23:20:39 -05:00
KeybadeBlox
683818b637 Separate compiler optimization flags
The /O2 used before was actually a preset for a bunch of more specific
flags, which are now written explicitly for clarity and easier
modification later.
2026-01-03 16:13:44 -05:00
KeybadeBlox
4dae5206c0 Minor decompiling in JSRF/Core 2026-01-02 23:14:59 -05:00
KeybadeBlox
1b08163c08 Disable inlining
JSRF appears to have it disabled despite other optimizations.  Even if
it was enabled, anyways, we'd still be decompiling the post-inlining
functions and wouldn't want any further inlining to take place (we want
the compiler to compile each function the way we write it).
2026-01-02 22:38:23 -05:00
KeybadeBlox
08abfd3913 Finish populating JSRF/Core 2026-01-02 00:05:52 -05:00
KeybadeBlox
f8578b0871 Continue populating JSRF/Core 2025-12-31 23:03:36 -05:00
KeybadeBlox
f65876135d Remove redundant compilation flag
The flag in question was already the default setting.
2025-12-31 23:02:58 -05:00
KeybadeBlox
71937e4a97 Begin populating JSRF/Core 2025-12-31 11:14:07 -05:00
KeybadeBlox
22a8c350eb Correct .data section ranges in delinked objects
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.
2025-12-30 00:39:14 -05:00
KeybadeBlox
9e638e0ec2 Add note to avoid symbol conflicts when delinking 2025-12-29 09:43:59 -05:00
KeybadeBlox
22a0e1fa9a Update progress 2025-12-29 00:54:59 -05:00
KeybadeBlox
a25790e8a6 Delink Core.obj 2025-12-29 00:44:27 -05:00
KeybadeBlox
8eda56dcdf Change executable section flags to please objiff
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.
2025-12-21 19:36:09 -05:00
KeybadeBlox
70cc4ca688 Add stylistic consistency to contribution guide 2025-12-21 09:39:55 -05:00
KeybadeBlox
fe94d467df Update repository URLs 2025-12-18 22:41:08 -05:00
KeybadeBlox
115052d2a5 Rewrite readme for official decomp repository
I guess this isn't just notes anymore.
2025-12-18 22:38:21 -05:00
KeybadeBlox
5692ee9531 Minor code tidying
Mostly consistency with file headers and other such trifling things.
2025-12-18 22:09:47 -05:00
KeybadeBlox
b40e9a0c56 Rename Microsoft decompile directory to XDK
Felt more appropriate to name it after the library it's implementing
than the vendor.
2025-12-18 21:55:03 -05:00
KeybadeBlox
6ac4cdc5ed First-er draft of contributing.md
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.
2025-12-18 21:53:53 -05:00
KeybadeBlox
83553a3d24 Remove padding from Jet2.obj address ranges 2025-12-18 09:30:29 -05:00
KeybadeBlox
070b2f9376 Finish first draft of contributing.md 2025-12-18 00:16:21 -05:00
KeybadeBlox
aabd8337b3 Complete "Setting Up Decompilation" documentation 2025-12-17 22:08:15 -05:00
KeybadeBlox
1c8eb137ee Arrange decompilation source/target in directories 2025-12-17 21:46:17 -05:00
KeybadeBlox
21c3864bb7 Begin contributing.md 2025-12-17 10:26:34 -05:00
KeybadeBlox
1a48d4323e Complete delink workflow; separate from decomp
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.
2025-12-16 22:30:49 -05:00
KeybadeBlox
87c56f01d6 Update delink.sh for Windows
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).
2025-12-14 23:55:08 -05:00
KeybadeBlox
8e62579f34 Point delink.sh at correct headless Ghidra script
The pitfalls of development on a Cygwin setup.
2025-12-14 22:57:14 -05:00
KeybadeBlox
fe20d64d27 Add delink POSIX script
Also reworked the directory structure a little.
2025-12-14 22:53:33 -05:00
KeybadeBlox
7e1785e466 Add objdiff setup
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."
2025-12-14 19:27:11 -05:00
KeybadeBlox
10b3c8c273 Use $x prefix for exception portion of sections
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.
2025-12-14 16:45:44 -05:00
KeybadeBlox
9ad0f2a807 Update matching status of main()
For whatever reason, it doesn't match on decomp.me, but using the same
compiler and options locally, it produces a perfect match.
2025-12-13 19:12:58 -05:00
KeybadeBlox
e9080510ab Finish XDK peripherals object(s) in objects.csv 2025-12-13 19:12:13 -05:00