This DLL will hook Sim::init and load all DLLs found in the Blockland/modules/ folder for you. It provides a dummy symbol named loader that you can add to the import table for automatic loading of this DLL during Blockland startup.
Create a folder named modules (in your Blockland folder) and put all your DLLs in it.
Put Blockland.exe and BlocklandLoader.dll in your Blockland folder.
Build the BlocklandLoader project in Visual Studio, and copy the output file BlocklandLoader.dll to your Blockland folder.
For patching the import table, I recommend StudPE.
- Open
Blockland.exe(File -> Open PE File) - Go to the Functions tab
- Right click in the left panel and click Add New Import.
- Click Dll Select and browse to
BlocklandLoader.dllin your Blockland folder. - Click Select func. and select
loaderfrom the list that appears. - Click
Add to list, thenADDat the bottom. - Close the program by clicking
OK.
BlocklandLoader will load your DLL using LoadLibraryA immediately before Sim::init in the main execution thread of Blockland.exe. You can perform your initialization in DllMain. This loader does not yet provide any addresses or hooks for you, you'll need to do that in your DLL yourself.