Dewera / Lunar

A lightweight native DLL mapping library that supports mapping directly from memory
MIT License
584 stars 102 forks source link

System.ApplicationException: "Failed to load a dependency of the DLL" #11

Closed Upbolt closed 4 years ago

Upbolt commented 4 years ago

I've mapped a pretty simple library into a game on Roblox:

BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved) {
  if (dwReason == DLL_PROCESS_ATTACH) {
    MessageBoxA(NULL, "test", "", NULL);
  }

  return TRUE;
}

Which resulted in this exception:

Not quite sure what's happening 🤔🤔 Let me know if this is an issue on my end

Dewera commented 4 years ago

Currently, dependencies are loaded using a standard call to LoadLibrary as I have not found the time to get the required code into the codebase to support the numerous things needed to emulate the process of adding references of a mapped DLL to the process.

Usually, this isn't an issue as processes will whitelist system DLL's, however, in this case, I would presume Roblox has completely disabled access to LoadLibrary. This would need to verified, however, if it is the case there's unfortunately nothing that can be done at the time being due to the limitations mentioned above.

Upbolt commented 4 years ago

Damn, that's unfortunate 😔 Oh well, thanks anyways.