Search the Community
Showing results for tags 'research'.
Found 5 results
-
Hey everyone! My Name is Lane. Some of you know me from Kotor Speedrunning, and others from my various Youtube exploits. I don't ever really post on Deadly Stream, but I've been lurking in and around the KotOR modding community for about a decade now. I have a degree in computer Science and decided to put it to good use, and reverse engineer KotOR 1 (the GoG version). This has been an on-going project for about 2-3 years now, and I've been sharing my progress with friends, and in some Youtube Videos. However, I've pretty much hit a wall with what I can do with this effort now. So I wanted to release my progress publicly, so other smart and clever people can start doing fun stuff with this. Linked below is a Google Drive with several useful things: A Ghidra SARIF export that contains all data types, function labels, parameters, Classes, and other additions I've made A Ghidra Format XML that contains the labels and function adjustments I've worked on. This is lighter weight than the SARIF file, but has more limitations when it comes to import fidelity. A generated `.h` file, that contains the Header information I have pieced together over time. Even lighter-weight, and more limited than the above What this is not: True Debug Symbols for kotor BioWare Intellectual Property A runnable or compilable program Kotor's Source Code A reverse engineering of Kotor 2 A reverse engineering of the Steam version * * A note about Kotor 1 Steam: While this reverse engineering effort targeted the GoG release of KotOR 1, the Steam version has MANY similarities; often times having identical memory addresses for most functions. Any Patch made for the GoG version can be pretty reasonably ported to Steam with a little bit of effort. What this is: A decently representative result of what Kotor's debug symbols might look like (format and terminology pulled from the MacOS symbols, and existing NWN docs) A research-based labeling and reverse engineering of the GoG version of Kotor 1 A labor of love for the past several years that I'm happy to share Why this is cool/important: This provides a stepping off point for creating proper patches for KotOR 1 This also provides a means for researching underlying issues with things such as memory management, graphical limitations, and compatibility This also provides a researching angle for coming to understand some of the more mysterious file formats, and how they interact with the game itself There are also a variety of fundamental similarities between this and KotOR 2. Which may unlock some insights for that game This is also the first step towards a proper re-compilation (though that is a long-ways off) How do I use this? You need Ghidra installed, with a modern Java Runtime Create a new project, and import swkotor.exe (as purchased from GoG) Open the EXE in Ghidra's code browser When it asks if you want it analyzed, select 'Yes" The default analyzers are fine, technically you could speed this up by stripping out a few unneeded analyzers The analyzers will take several minutes to complete (progress can be tracked in the bottom right) Once the analyzers have run, we can proceed Select "File > Add To Program..." and select the SARIF (or XML) file (download below) The importer will analyze the symbols and apply them to the project You now have a decently labeled/decompiled instance of KotOR 1 Limitations: 99.9% of the functions have been labeled, however there were a few stragglers that I was never able to work out. These will appear as `FUN_<address>` 92.3% of the Data is labeled, with stragglers being named `DAT_address` Data Types are VERY incomplete. The labeled ones consist mostly of frequently used types, and known fields. Unknown fields are marked `field<index>_<offset>` Virtual Function calls are very under labeled (largely due to the difficultly of labeling vtables in Ghidra). Though you can determine the underlying function by applying the offset to the associated Class vtable. Most functions have only automatic variables defined within their decomp. Typing and purpose of underlying variables beyond function names, and parameter types, are left up to inference. Overlapping functions. Certain functions overlap in this compilation, due optimizations within the Visual C++ runtime. As a result some functions such as `GetProperty0x30` are shared by multiple classes, and thus lack a name-space. You can usually work out their purpose by checking the associated data type at that offset. If you used the XML import, you will be missing a lot of typing and Function Class/Namespace info Final Notes: Please feel free to ask me any questions about this effort, or any thing strange you might find within the decomp. I've grown to be quite the kotor expert over the years, and I'd be happy to share any insights. You can reach out to me on Discord @lane_d, I'm in the Kotor Reddit server, as well as the kotor speedrunning server. I will be periodically posting updates to this drive, whenever I get the chance to work on this more. If anyone has any major contributions they'd like to see added, please reach out! I'd be happy to chat. Both the XML and SARIF formats have some limitations, unfortunately they are the best I can do without publicly sharing Bioware intellectual property. If there is something missing from these that you are in need of, please reach out and I can see if I can help you. (Note: I will not be abetting piracy though. Buy the damn game, it goes on sale all the time) Google Drive Link Here
-
Has anyone tried to fully understand what is saved by the client in Kotor 1 in the swkotor.exe? I know that movie resolutions, letterbox dimensions, and resolution are saved in the exe. Is there a list that explains which hex sequence attributes to what? And if not, is there a way or does anyone already have an idea on how to decode it? We could fix a lot of issues if we can understand the hex data fully, like the map size after the widescreen fix ( which Im mainly interested in ) My ideal dream would be at least understanding the important things in the hex data and making a list or even a script that reads the exe and spits out a text file, that says this sequence means XX and has YY values. An interpreter of sorts
-
- kotor 1
- hex-editing
-
(and 1 more)
Tagged with:
-
Just a simple information to share to save ones from getting burnt-out, lol. Why we don't want to use TPC format for lightmaps? It broke the maps When put into a module/MOD file, it crashes your game upon reloading and/or exiting the game Stick only with the TGA for that one...
-
Greetings, fellow Jedi! Hope you all doin' fine. On my latest attempt, I tried to edit an ASCII to attach MaskHook and GoogleHook with standard Notepad and when I convert the ASCII to Binary, it works. But when I load the Binary with MDLedit an error occurred which leaves the Binary model can't be loaded. So, I surfed the net looking for an answer and then I found this freeware: PlainEdit.NET I'm an amateur with tools and stuffs but as stated in the description; In short; when I edit the ASCII with the said tool and then save the changes, convert it again to Binary and load it with MDLedit- it loads, and all changes does loaded to the model! The MaskHook and GoogleHook does working seamlessly despite the fact some further changes would be necessary for their positioning and orientation. So I thought I share the news with fellows here whom perhaps having the same problem which I hope it can be helpful. I know many have known about editing ASCII and stuffs but I'm certain a few haven't known about it. I hope the information kind of helps; may the Force be with you all!
-
Greetings, fellow Jedi! May the Force be with you. Along with the compiling-decompiling model attempt I have done recently, some discoveries were found regarding the end-result of using both MDLedit v1.0.3 and MDLOps v1.0.0. First, this comparison purpose is to give the potential user of both tools a preview of the compiled model using each of the tools mentioned. This also had no intention to show which tools are best and which are less; it's simply to share the discoveries been found. Here's a screenshot for details: Left image is TSL's n_quarren [Quarren's F model] model compiled using MDLedit v1.0.3 with tangentspace enabled by not ticking the bumpmap flag, but instead changing its value inside the ASCII file from 0 to 1 using a text editor. Right image is TSL's n_quarren [Quarren's F model] model compiled using MDLOps v1.0.0 with tangentspace enabled by changing its value inside the ASCII file from 0 to 1 using a text editor. As we can see there is a difference in the head part; which MDLOps version produce a noticeable line whilst MDLedit version isn't. This occurrence already emerging several times on my end; such with compiled TSL's n_commf model. I hope this discovery kind of helps with any future modding attempt, and gave an insight of what will and what won't regarding the implementation of the aforementioned method. Edit: Be advised that they had nothing to do with normal maps. It's a smoothing error, as informed by DarthParametric. The normal maps activation is just part of the compiling process.
- 3 replies
-
- discovery
- comparison
- (and 6 more)
