Author Topic: Dll hacking help needed  (Read 1830 times)

Offline HaXtOr

  • Sr. Member
  • ****
  • Posts: 423
    • http://www.wtfmoogle.com
Dll hacking help needed
« on: September 20, 2004, 08:24:19 PM »
Can someone tell me how to edit mines fully and how to edit buildings when you start?

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Dll hacking help needed
« Reply #1 on: September 21, 2004, 12:36:36 AM »
It's all controlled by the DLL associated with the level.

Anyways, the best way to setup a level properly right now would probably be to create a DLL from scratch using the C++ template project. Mind you, I'm not aware of any complete and playable levels made this way so this might be a little impractical. Plus we don't really know all we should about the DLL calls.

The faster way, and probably easier for small tweaks is just to edit existing DLLs. Basically, you have to view the DLL file with a disassembler to find the section of code you want to edit, find the file offset of this code and use a hex editor to modify it. In some cases, it's simply a matter of changing one of the parameter values (either PUSHed onto the stack or passed in ECX, or EDX). It's not always that simple though. Anyways, try a disassembler/debugger like W32DASM, or if that doesn't work try OllyDbg (which is somewhat scarier for the inexperienced). You can try searching for references to the Imported function "CreateBeacon" to edit mine locations/yields, and "CreateUnit" to edit starting vehicles and buildings. Keep in mind, those names are C++ decorated so they will look a little different.

Also, it might be helpful to look at the Exported function "InitProc", and the routines that it calls. This is where the mines should be setup and you can probably get a better idea as to what code corresponds to what mine by looking at it this way. You should probably be looking for a sequence of CALLs in InitProc and when you examine the code for the call (once you find the right one) it will likely contain code initializing player resources. (Note: this is just a general rule based on how the DLLs I've looked at have been coded. It need not hold for any others.)

If you need more help, PM me, find me on IRC, or get enough people to bug me that's its worth my time to write a tutorial on it (probably not too likely).
« Last Edit: September 21, 2004, 12:37:31 AM by Hooman »