EldenRingMods: "Could not find signature" issues when loading DLLs with Mod Engine 2
Turns out ME2 has an undocumented, working DLL loader:
Under [modengine] put external_dlls = [ "dllname1.dll", "dllname2.dll" ] etc. (If providing folder paths, use double slashes \\)
Looks like your mods don’t play too well with this, though.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 19 (2 by maintainers)
So if anyone is similar to me obsessed with not altering the
Gamefolder and having all mods placed in separate folders and the.tomlfile configured correctly instead, then compiling the.dlls from https://github.com/gixxpunk/EldenRingMods works. Just make sure to put the skip intro as the very first.dllthat gets loaded by ModEngine2 and make sure to build the whole solution so that it created all the.dlls in one go.This is my
.toml:All EldenRingModLoader mods are installed like they are uploaded on nexus and I just replaced the
.dllfiles with the ones build from the linked repository.I did the same with a different
.tomlto play Seamless CO-OP (Haven’t played this one beyond testing that it launches with seamless coop installed properly, so I don’t know if the stuff I read about corrupted saves when not launched without other mods via the default seemless coop launcher for creating the character and first save are still relevant and would need to do some more testing for that):Issue Description
EML (
EldenRingModLoader) mods appear to depend on theload_delaywhich EML offers.However ME2 (
ModEngine2) instantly loads the mods,without a
load_delay, which causes issues for EML mods.Work Around
Use both EML (
EldenRingModLoader) and ME2 (ModEngine2) in combination with each other.EldenRingMods(and other mods that specify EML)Then launch the game through ME2, which also loads EML with it’s mods.
Linked ME2 Issue
https://github.com/soulsmods/ModEngine2/issues/210
@EzioTheDeadPoet @Yashirow @Rikj000
I had the same problem while using AdjustTheFov, UnlockTheFps and SkipTheIntro (and some unrelated mods that seemingly didn’t have any impact and didn’t fail to inject) with ModEngine 2.
After some testing I found that the order of injection (as specified with
external_dllsin ModEngines’s config_eldenring.toml) affects which of the dlls fails to inject. I am assuming the ordering to affect the timing of the injection which is most likely the actual cause. The failure to inject always stems from the same source: the functionModUtils::AobScan(std::string)in ModUtils.h. It usesVirtualQueryat line 323 to check the access protection of the memory pages. If the protection isPAGE_EXECUTE_READWRITE,PAGE_READWRITE,PAGE_READONLY,PAGE_WRITECOPYorPAGE_EXECUTE_WRITECOPY(line 342) it proceeds to scan the page for given signature. It ignores all other pages. In my testing, the protection of the relevant page wasPAGE_EXECUTE_WRITECOPYwhenever the injection succeeded. It wasPAGE_EXECUTE_READwhenever the injection failed. Interestingly, sometimes two different dlls receive different access protection constants for the same page. For example, either AdjustTheFov receivedPAGE_EXECUTE_WRITECOPYand UnlockTheFps receviedPAGE_EXECUTE_READor vice versa meaning one dll succeeds and the other doesn’t. At no point did both or neither succeed. These two mods scan for different signatures which are however always located on the same memory page. This means that something changes the page’s access protection after the first but before the second dll gets injected. Further testing and experimenting revealed that it is not the dlls themselves that change the access protection (they do change it but those changes aren’t causing the injection of the other dll to fail). Either ModEingine 2 or the game itself have to be responsible for the interference.The solution to the problem is quite simple: Add
PAGE_EXECUTE_READto the list of accepted access protection constants at line 342:The list already contains execute constants and no-write constants. Adding a constant that is both execute as well as no-write shouldn’t cause any problems. I recompiled the two mods, injected them with ModEngine 2 and everything worked as expected.
Delaying the injection might work but IMO it is a band-aid solution. This fix should be a bit more robust.
Btw. it should be fine to add the other two access protection constants (
PAGE_EXECUTEandPAGE_EXECUTE_READWRITE) as well but i didn’t test that.using
and with that it works. I don’t see why one would like to be flahbanged by an unnecessary white screen so testing that functionality
seemsdid seem pointless to me.