Local DLL shims?

While randomly contemplating keeping local injections “up-to-date” or provide an “update functionality” to them, I randomly through of whether a tiny DLL shim could be used as a replacement for the full Special K DLL file, and the tiny DLL would then basically load Special K proper from its main installation folder?

So basically:

  1. Tiny “dxgi.dll” or whatever DLL file is stored in the game folder.
  2. When the game launches the DLL file looks for the full Special K DLL file in the main installation folder (probably through a registry path).
  3. The tiny DLL file loads the full DLL file.
  4. If the main Special K DLL file would be removed, the tiny DLL file basically does nothing, and no issues are caused in the game from the presence of that DLL file.

This would basically mirror the symlink approach I mentioned a few weeks ago without causing crashes on launch of the games of the main Special K DLL file was removed.

Now whether this is even theoretically possible or not is not something I am clear on, but I’m hoping it is?

It’s possible, but since I asked about this over in steam: the point of local injection is to freeze the version of Special-K, when required. Otherwise I thought the developer intent was that global injection was used.

Anyway. To do that you would want a tiny shim DLL that more or less just found the latest “global” version, and loaded it. …or maybe to use the SDB Application Shimming system directly, and keep that pointed at the latest.

SDB can target individual applications, inject whatever. Could inject the full thing, or just a partial one. (I’m pretty sure you need a custom shim for 64-bit processes, but 32-bit ones have InjectDLL out of the box.)

I suppose you could also, eg, dynamically load your code from another image into the current DLL or smth if you really wanted to be fancy live dangerously.

Mhm, but it’s preferable if SK supported both approaches – both an auto-updatable one (through the use of shimming a central Special K DLL file) and a frozen one (through the normal local injection type).

SKIF should be able to handle both separately and note which approach is being done.