Commit graph

134 commits

Author SHA1 Message Date
KeybadeBlox
20fecdd5fb Fixes for delinking
Fixes delink failures in Action.obj and ActSequence.obj.

Some missing data types have been added to each corresponding header
file, and entries have been added to the symbol table to fix errors from
undefined types.  The mangling script has also been amended to handle
method pointers as they're currently imported into Ghidra (which are
missing the calling convention, and likely behind a typedef).
2026-05-02 20:34:05 -04:00
KeybadeBlox
f50945266c Update symbol table
Mostly defined types for a few symbols in SaveData.
2026-04-30 14:56:32 -04:00
KeybadeBlox
6916d3a90c Support name mangling method pointers
ActSequence uses an array of method pointers, meaning we need to support
mangling this obscure corner of the language.  The name mangling code is
admittedly feeling pretty messy, as this appears to require a lot of
special casing.
2026-04-30 14:51:31 -04:00
KeybadeBlox
a6267f4bf0 Update objdiff.json for new name for SaveData 2026-04-30 14:49:31 -04:00
KeybadeBlox
ef16b09a96 Revise progress wording
We're not only counting .text, but any sections meant to hold code (e.g.
MMATRIX).
2026-04-19 17:31:41 -04:00
KeybadeBlox
639bb55108 Update progress 2026-04-19 17:29:59 -04:00
KeybadeBlox
b5e0a157a5 Delink ActSequence.obj
One symbol, fSequenceMethods, won't match up automatically in objdiff
until the mangling script is updated to handle method pointers properly.
2026-04-19 17:16:01 -04:00
KeybadeBlox
46566650e0 Fix exception handling symbol names
Weren't updated when names were pulled from Yakuza.
2026-04-19 09:16:30 -04:00
KeybadeBlox
bb7dfcc017 Update symbol table 2026-04-19 09:05:41 -04:00
KeybadeBlox
5bf24865ac Remove unused make_symboltable.sh
Was obsoleted by the enhanced export/import Ghidra scripts.
2026-04-19 09:04:27 -04:00
KeybadeBlox
4048526736 Function name updates
In the decompilation proper, the SaveData "Vs" methods have been renamed
to "Unused" methods (they have nothing to do with multiplayer).  Other
symbols in the symbol table have also been updated, particularly
relating to CActSequence (previously known as Director).
2026-04-09 21:53:51 -04:00
KeybadeBlox
836b5eaa41 Incorporate known names from Smilebit code
The Yakuza 1 and 2 rereleases on the Wii U export function symbols,
preserving their names, and some debug data was also available in a PS2
release, providing some struct definitions.  These have been used to
rename analogous classes, functions, and member variables to the same
names used by Smilebit, plus a more general imitation of their naming
and typing conventions (i.e. Win32 style).
2026-03-31 20:24:13 -04:00
KeybadeBlox
e7e9d3b1be Add .gitignore entry for Ghidra project
May make it an official recommendation to have a project named "JSRF"
here.
2026-03-22 20:20:46 -04:00
KeybadeBlox
d6a356a0c3 Handle undefined WINDIR on POSIX platforms
The test for whether it was defined was failing with an error on
platforms where it wasn't defined.
2026-03-22 20:18:09 -04:00
KeybadeBlox
57fc53ebfb Add IMAGE_TLS_DIRECTORY32 struct
With this, everything is delinking again.
2026-03-21 22:35:37 -04:00
KeybadeBlox
da6865e5f6 Fix typo in Core.hpp
Was making builds fail.
2026-03-21 20:56:49 -04:00
KeybadeBlox
3e8622f369 Mention Wine for non-Windows OSs in documentation 2026-03-21 20:55:52 -04:00
KeybadeBlox
8fc7d8d918 Add recommended tool versions to Getting Started 2026-03-21 15:23:03 -04:00
KeybadeBlox
b95a664688 Add ehdata.h
Bunch of spooky low-level exception handling stuff needed to delinking
working again.
2026-03-20 23:29:39 -04:00
KeybadeBlox
e58f774d82 Add various data structures
Stuff needed to get Core.obj delinking again.
2026-03-20 23:29:02 -04:00
KeybadeBlox
709bbf9a54 Default to __cdecl for name mangling
It's definitely ideal for everything to be declared explicitly, but it
would require either manual intervention or a new dedicated script to do
this for typedefs (that aren't methods), so we'll do this as the least
worst option.
2026-03-20 23:26:20 -04:00
KeybadeBlox
a2b777d666 Disable function thunking when importing
Thunked functions can confuse the delinker extension into thinking that
multiple symbols have the same name and lead to delinking failures (with
no diagnostic, conveniently).
2026-03-20 23:25:19 -04:00
KeybadeBlox
ac40f3e8cf Update symbol table 2026-03-20 23:24:55 -04:00
KeybadeBlox
69d5bd1dbe Summarize unrecognized types in EnhancedImport
Helps a little to debug things.
2026-03-20 20:10:16 -04:00
KeybadeBlox
98d88cc212 Support earlier Java releases
Existing code was written for Java 25, which is more recent than many
people have on hand.  The modified scripts appear to run well on Java
21.
2026-03-20 13:20:51 -04:00
KeybadeBlox
76e7714722 Typo 2026-03-20 10:09:33 -04:00
KeybadeBlox
c713c2c8ea Fix permissions on symbol table 2026-03-20 10:08:51 -04:00
KeybadeBlox
da67c782e3 Remove unneeded .gitkeep 2026-03-20 10:03:24 -04:00
KeybadeBlox
6b12d397ff Update headers in make_header.sh
Forgot to change after Std.hpp got turned into stddef.h.
2026-03-20 08:27:08 -04:00
KeybadeBlox
4dded02b58 Minor revisions to xapi0.c comments 2026-02-23 08:23:02 -05:00
KeybadeBlox
823b19371c Fully decompile xapi0 2026-02-22 14:04:18 -05:00
KeybadeBlox
4e20347b7c Decompile mainCRTStartup()
Incidental changes include fixes for Xapi in the Makefille and
objdiff.json, as well as new compiler flags for Xapi.
2026-02-22 10:41:15 -05:00
KeybadeBlox
cbd63865e2 Rename Smilebit library to MUSASHI
Strings in the .rdata portion of the Smilebit in-house library code
suggest that this was its name, with its contents having names beginning
with an M (whence MMATRIX, for example).
2026-02-22 10:37:59 -05:00
KeybadeBlox
d7abbb79c0 Update progress
I really need to automate this.
2026-02-20 21:56:45 -05:00
KeybadeBlox
9cfd8b5bf3 Delink/begin decompiling entry point
That is, xapi0.obj, which has been renamed from crt0.obj because it
appears to be part of the Xbox libraries rather than the C runtime.
2026-02-20 21:50:00 -05:00
KeybadeBlox
9b6c91a12e Prevent repeated name mangling
A symbol could be encountered more than once in headless mode if it
appeared in the body of a function.  The mangler script now tracks which
symbols have been seen to avoid this.
2026-02-20 21:44:43 -05:00
KeybadeBlox
bbe9d63294 Update documentation for new scripts
This includes the enhanced export/import scripts and the class fixup
script (with the name mangler being used implicitly).  With this, the
switchover from simple label-based sharing of Ghidra project information
to rich type and class information is complete.
2026-02-19 21:16:38 -05:00
KeybadeBlox
aac010eb71 Add PlayerCharId type 2026-02-19 21:16:11 -05:00
KeybadeBlox
be4946eb98 Replace Matching: with Status:
We'd rather have three stages (unimplemented, nonmatching, matching)
than just matching or not.
2026-02-19 21:11:42 -05:00
KeybadeBlox
73b59a95cd Fix main() detection in mangling script 2026-02-19 21:06:17 -05:00
KeybadeBlox
522bf8be7f Fix static init/exit section names in objects.csv 2026-02-18 20:42:45 -05:00
KeybadeBlox
0b10a02ad7 Fix whitespace in Ghidra export script output
Functions with no arguments had a trailing tab.
2026-02-18 20:41:51 -05:00
KeybadeBlox
e0313fa0ba Add class fixup Ghidra script 2026-02-18 20:24:43 -05:00
KeybadeBlox
adc30bb531 Move Std.hpp into CRT directory
It's also been renamed to stddef.h since all it contained was the
definition of NULL, which lives in that header in a standard C library.
2026-02-18 19:22:13 -05:00
KeybadeBlox
3c4f0e72b8 Miscellaneous Ghidra script tweaks
No behavioural changes.
2026-02-18 18:18:24 -05:00
KeybadeBlox
c020c2e247 jsrf.h scalar deleting destructors return void *
They previously returned a pointer to the class type, but this isn't
accurate to the signature indicated by MSVC's name mangling.
2026-02-18 18:15:25 -05:00
KeybadeBlox
fd6815ae42 Complete Ghidra symbol import script 2026-02-17 22:30:10 -05:00
KeybadeBlox
92179ea9bd Add C symbol support to name mangling Ghida script 2026-02-17 20:19:14 -05:00
KeybadeBlox
d435282a8b Compile XDK code as C
It appears to be all C code (especially the non-C++ parts of the C
runtime, of course), so we'll compile it as such.
2026-02-17 10:27:50 -05:00
KeybadeBlox
149af27b9c Fix CRT calling conventions 2026-02-17 09:56:58 -05:00