Asterix Gaming Guild Logo GeneralXXLXXL 2XXL 3XXXLOlympic GamesXXL EditorToolsOff-TopicXXL RomasteredXXL 2 RemasteredOther GamesModsCaesar's ChallengeUnfair XXLPatchesFan ArtPersonal ArtSpeedrunningMediaRandomizerBETA RomeHSKALPresence AdrienPresence SPQRSupport Bot Helpdesk

#general

spider_
AH
spider_
I knew it!
spider_
the "MR" in Dolphin is a shorthand!
spider_
Ghidra picks it up as what it actually does
spider_
I guess its similar to `nop` in other languages lmao
spider_
Which translates to `mov r0,r0`
spider_
Blegh, the PowerPC decomp is awful. It’s not finding any of the parameters
spider_
How did you reverse engineer the KXX files in the first place?
adrientd
Well, it's been 4-5 years since I started reverse engineering so I don't know remember exactly, but I probably reverse engineered it by mainly looking at the files with a hex editor, and only look at the disassembly when I feel like I need or wouldn't manage to continue progress otherwise.
adrientd
If you look at a KXX file you might notice that some 32-bit values are actually offsets in this file. And often, if for example you see an offset, and go there with a hex editor, you will see at that offset you have another value containing an offset in the file.
adrientd
In fact a lot of parts of the file are prefixed with a "skip offset". The game generally doesn't use them when it reads the data, but if the game needs to skip that part, it will use that skip offset to jump to the offset and go the next part without having to read the data.
adrientd
And after more research I notice that there is basically a "tree" of data chunks (that is a chunk can contains chunks, and "skip offset" would skip to the next chunk of the same level)
adrientd
At the same time, in the executable, you can find strings of names of all classes in the game (such as CKLevel, CKHkSomething, CTextureDictionary, ...)
adrientd
and if you search for references to the class name, you will find code like this:
adrientd
Such code exists for every class and is executed at the start of the game, which "registers" the class
adrientd
so something I did was hooking that class registering function (sub_4DB940 in the screenshot) to get a list of all classes along with the arguments
adrientd
The most interesting ones are the first two ones, which look like IDs for the classes, in this case CKLevel has an ID of (12, 5)
adrientd
```8 22 CKDisplayPictureCinematicBloc 8 23 CKManageCameraCinematicBloc 8 25 CKStartEventCinematicBloc 8 26 CKSkyCinematicBloc 8 27 CKLightningCinematicBloc 8 28 CKPlaySoundCinematicBloc 9 1 CAnimationDictionary 9 2 CTextureDictionary 9 3 CKSoundDictionary 9 4 CKSoundDictionaryID 10 1 CParticleGeometry 10 2 CGeometry 10 3 CSkinGeometry 11 1 CSGRootNode 11 2 CSGSectorRoot 11 3 CNode 11 5 CSGMovable```
adrientd
If you look at the list you can see that the first number is for a "category of classes": for example 8 are cinematic blocs, 9 are dictionaries, 10 are geometries and 11 are scene nodes.
adrientd
There are a total of 15 categories of these classes.