Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DFSembbly, the DF assembly indexing project  (Read 1258 times)

MoonyTheHuman

  • Bay Watcher
  • I think the DEC VAX hates me.
    • View Profile
    • hellomouse
DFSembbly, the DF assembly indexing project
« on: June 20, 2016, 12:51:54 am »

 Some of us out there have fiddled with DF binpatches and compiles plugins, only to find everything obfuscated and generally unreadable, So i decided to start Project DFsembbly, the Function and Memory mapping project for DF (windows & maybe linux)
General common sense:
Don't include functions from common librarys (please), i will not filter these yet, but i will make the list of functions in the executable, if you see any, please alert me and i will remove it.
VERIFY WHAT A FUNCTION DOES, DON'T ASSUME (this happens too much)
Memory mapping should also not be based on assumptions
If you find a value that has to get its location calculated to find it, please post how you would do that in NASM assembly/C
Spoiler: Functions to find (click to show/hide)
See you in the morning (=
« Last Edit: June 20, 2016, 11:53:06 am by MoonyTheHuman »
Logged

MoonyTheHuman

  • Bay Watcher
  • I think the DEC VAX hates me.
    • View Profile
    • hellomouse
Re: DFSembbly, the DF assembly indexing project
« Reply #1 on: June 20, 2016, 11:41:05 am »

Im now awake, and i will assemble a list of all functions (unidentified, tho, thats for everyone to do), memory locations may be a little harder, ill look into it. give me a few minutes for IDA Pro to process and put the list of functions in my clipboard

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFSembbly, the DF assembly indexing project
« Reply #2 on: June 23, 2016, 02:41:15 pm »

This is for global function (not methods like what DFHack knows about) right?

How hard would it be to replace such functions, or, better yet, allow users to call them from DFHack plugins?
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFSembbly, the DF assembly indexing project
« Reply #3 on: June 23, 2016, 02:51:56 pm »

This is for global function (not methods like what DFHack knows about) right?

How hard would it be to replace such functions, or, better yet, allow users to call them from DFHack plugins?
As a person that did this some time ago: not very hard. basically you replace call <offset> with your own call <other offset>. then in that function you can choose to call or not the original.

Nasty part is finding the functions and then updating them between versions. This is somewhat easier using dfhack tools (e.g. ida dfhack structs, and global offsets) if they are updated to the new version. Otherwise it would take <very long>. Exceptions exist e.g. mifki is using one function that loads a png/bmp file for graphics and another that renders the map. He has quite easy to follow instructions to find the functions for new df version.

This is with the old df that was build with older visual studio. Haven't tried anything on the new one...