techiew/UltimateProxyDLL

Usage with Xenos (dll loader)

Closed this issue · 4 comments

I mainly wanted to say thank you for this amazing project. i've been using (and struggling) with proxy dlls for so long and in 5 minutes you just made my life so much easier.

I'm using proxy dlls for my mods but i also sometimes just load the dll with xenos so that i don't have to restart the game all the time, so i just rename the dll and load it it.
But of course because UPD creates proxy based on filename, i can't just name my dll: myGame.dll and expect to load with Xenos as i usually do, any idea how i could make that work somehow?

I have never tried it but I guess you could call FreeLibraryAndExitThread from inside your proxy (for example when pressing a key: GetAsyncKeyState), then when the DLL is unloaded you can load it back in with the same name. Maybe Xenos can unload/uninject DLLs?

If that's not an option I guess you could have a DLL somewhat like this: 164580d

This would act as kind of your "base" or "master" DLL. The DLL could call LoadLibrary on a specific keypress, or even just repeatedly call LoadLibrary and sleep for a couple seconds in between. Instead of loading DLLs listed in a file as in the example you could load any DLL with a specific postfix or prefix in the working directory (using wildcards). Note that calling LoadLibrary on any DLLs that are already loaded does not do anything, so it should be safe to just spam it willy-nilly.

Thanks techiew,
I think i should have spent a little bit more time thinking before posting.... because the problem i had can be simply fixed by creating a specific build configuration with macros and then use a preprocessor condition to use UPD or not:

	#ifndef XENOS_MODE_BUILD
			//UPD::OpenDebugTerminal();
			UPD::CreateProxy(hModule);
	#endif // !XENOS_MODE_BUILD	

Sorry for wasting your time, i'm going to be using UPD in my mod here, i'll make sure to credit you on the description page.

Cheers.

Cheers, cool mod.