Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Bug/Patch Discussion => Topic started by: Threen on May 18, 2022, 07:32:22 AM

Title: OpenSMACX and function names
Post by: Threen on May 18, 2022, 07:32:22 AM
I want to contribute to OpenSMACX and I wondering how function names have been extracted from the binary.

I have the GOG version of SMACX and I cannot find function names in any of the files.

Is there a different version I can extract these from, or is there is a list of them available somewhere?
Title: Re: OpenSMACX and function names
Post by: DrazharLn on May 18, 2022, 08:32:25 AM
That's cool! What would you like to contribute?

As I recall, most of the names were extracted from a binary for Mac that still contained symbols. Others were invented by scient and occasionally other modders.

I don't think there are.more names to copy that aren't already in the IDA database, but for an authoritative answer you will need to ask scient. You can sometimes catch them on this board or on GitHub.
Title: Re: OpenSMACX and function names
Post by: Threen on May 18, 2022, 09:32:09 AM
Thank you very much, I'll take a look at the IDA file.

I have some knowledge of Ghidra, so I figured I could decompile
and clean up some of the functions which haven't been done yet.

I have a very different setup to Scient.
I have CLion under Linux able to create the DLL, and have written a standalone python script which inserts the imports into the EXE. So maybe I could also add that to the git repo as an alternative build method?
Title: Re: OpenSMACX and function names
Post by: DrazharLn on May 18, 2022, 10:31:37 AM
Nice. Good luck! IDA can be made to emit C header files that ghidra might be able to easily consume.

I can't speak for scient, but if I were you I would open a pull request with your build method. Then either it will be accepted or it will be moderately visible to others who might benefit from it.
Title: Re: OpenSMACX and function names
Post by: Threen on May 18, 2022, 12:12:29 PM
Thanks DrazharLn!

I have tried IDA Freeware, but it cannot open IDB files.
I have also tried the Demo of IDA Pro 7.7, which tells me "Sorry, the demo version can't load old databases."
The file is binary, so notepad gives me nothing useful.

Sorry for my ignorance here, but is there another method I can use to open this file?
Or is purchasing IDA Pro the way?
Title: Re: OpenSMACX and function names
Post by: DrazharLn on May 18, 2022, 02:00:49 PM
Realistically, most amateurs just pirate it. You could ask scient (who has a legit copy of IDA) to generate an output file from the database that ghidra is likely to be able to consume.

In the meantime, you might use the terranx* files from the thinker project: https://github.com/induktio/thinker/tree/master/src or from OpenSMACX. You can probably find some way of turning those into something ghidra can understand and they define lots of the structures and functions in the binary.
Title: Re: OpenSMACX and function names
Post by: Threen on May 19, 2022, 12:46:25 AM
Much appreciated.
I was not aware of the Thinker project, and terranx.cpp is exactly what I am after.
Thanks again!
Title: Re: OpenSMACX and function names
Post by: DrazharLn on May 19, 2022, 10:58:55 AM
Nice. Happy to help.
Title: Re: OpenSMACX and function names
Post by: Blake00 on August 05, 2022, 09:32:19 AM
Project has gone pretty quiet over the last couple of years so it's good to see someone offer their skills! :)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 31 - 840KB. (show)
Queries used: 15.

[Show Queries]