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)

Most upvoted comments

So if anyone is similar to me obsessed with not altering the Game folder and having all mods placed in separate folders and the .toml file 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 .dll that 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:

# Global mod engine configuration
[modengine]
# If set to true the debug console will appear while the game is running
debug = false

# List of files that will be loaded into the game as DLL mods.

external_dlls = [
    "mods/skip_the_intro/mods/SkipTheIntro.dll",
    "mods/adjust_fov/mods/AdjustTheFov.dll",
    "mods/disable_chromatic_aberration/mods/RemoveChromaticAberration.dll",
    "mods/disable_sharpen_filter/DisableSharpenFilter.dll",
    "mods/disable_vignette/mods/RemoveVignette.dll",
    "mods/increase_animation_distance/mods/IncreaseAnimationDistance.dll",
    "mods/unlock_fps/mods/UnlockTheFps.dll",
    "mods/fix_camera/mods/CameraFix.dll",
    "mods/pause_the_game/mods/PauseTheGame.dll",
    "mods/temporal_upscaling/dxgi.dll", 
    "mods/temporal_upscaling/ERSS2.dll",
    "mods/transmogify_armor/ertransmogrify.dll",   
]

# Mod loader configuration
[extension.mod_loader]
enabled = true

# Not currently supported for Elden Ring
loose_params = false

mods = [
    { enabled = true, name = "skip_the_intro", path = "mods/skip_the_intro"},
    { enabled = true, name = "unlock_fps", path = "mods/unlock_fps" },
    { enabled = true, name = "adjust_fov", path = "mods/adjust_fov" },
    { enabled = true, name = "disable_chromatic_aberration", path = "mods/disable_chromatic_aberration" },
    { enabled = true, name = "disable_sharpen_filter", path = "mods/disable_sharpen_filter" },
    { enabled = true, name = "disable_vignette", path = "mods/disable_vignette" },
    { enabled = true, name = "increase_animation_distance", path = "mods/increase_animation_distance" },
    { enabled = true, name = "fix_camera", path = "mods/fix_camera"},
    { enabled = true, name = "pause_the_game", path = "mods/pause_the_game" },
    { enabled = true, name = "ps5_icons", path = "mods/ps5_icons" },
    { enabled = true, name = "temporal_upscaling", path = "mods/temporal_upscaling" },
    { enabled = true, name = "texture_improvement", path = "mods/texture_improvement" },
    { enabled = true, name = "transmogify_armor", path = "mods/transmogify_armor" }
]

[extension.scylla_hide]
enabled = false

All EldenRingModLoader mods are installed like they are uploaded on nexus and I just replaced the .dll files with the ones build from the linked repository.

I did the same with a different .toml to 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):

# Global mod engine configuration
[modengine]
# If set to true the debug console will appear while the game is running
debug = false

# List of files that will be loaded into the game as DLL mods.
external_dlls = [
    "mods/skip_the_intro/mods/SkipTheIntro.dll",
    "mods/adjust_fov/mods/AdjustTheFov.dll",
    "mods/disable_chromatic_aberration/mods/RemoveChromaticAberration.dll",
    "mods/disable_sharpen_filter/DisableSharpenFilter.dll",
    "mods/disable_vignette/mods/RemoveVignette.dll",
    "mods/increase_animation_distance/mods/IncreaseAnimationDistance.dll",
    "mods/unlock_fps/mods/UnlockTheFps.dll",
    "mods/fix_camera/mods/CameraFix.dll",
    "mods/transmogify_armor/ertransmogrify.dll",
    "mods/temporal_upscaling/dxgi.dll", 
    "mods/temporal_upscaling/ERSS2.dll",
    "mods/seamless_coop/SeamlessCoop/ersc.dll"
]

# Mod loader configuration
[extension.mod_loader]
enabled = true

# Not currently supported for Elden Ring
loose_params = false

mods = [
    { enabled = true, name = "skip_the_intro", path = "mods/skip_the_intro"},
    { enabled = true, name = "adjust_fov", path = "mods/adjust_fov" },
    { enabled = true, name = "disable_chromatic_aberration", path = "mods/disable_chromatic_aberration" },
    { enabled = true, name = "disable_sharpen_filter", path = "mods/disable_sharpen_filter" },
    { enabled = true, name = "disable_vignette", path = "mods/disable_vignette" },
    { enabled = true, name = "increase_animation_distance", path = "mods/increase_animation_distance" },
    { enabled = true, name = "fix_camera", path = "mods/fix_camera"},
    { enabled = true, name = "ps5_icons", path = "mods/ps5_icons" },
    { enabled = true, name = "temporal_upscaling", path = "mods/temporal_upscaling" },
    { enabled = true, name = "texture_improvement", path = "mods/texture_improvement" },
    { enabled = true, name = "transmogify_armor", path = "mods/transmogify_armor" },
    { enabled = true, name = "unlock_fps", path = "mods/unlock_fps" },
    { enabled = true, name = "seamless_coop", path = "mods/seamless_coop"}
]

[extension.scylla_hide]
enabled = false

Issue Description

EML (EldenRingModLoader) mods appear to depend on the load_delay which 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.

  • EML for EldenRingMods (and other mods that specify EML)
  • ME2 for other mods

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_dlls in 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 function ModUtils::AobScan(std::string) in ModUtils.h. It uses VirtualQuery at line 323 to check the access protection of the memory pages. If the protection is PAGE_EXECUTE_READWRITE, PAGE_READWRITE, PAGE_READONLY, PAGE_WRITECOPY or PAGE_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 was PAGE_EXECUTE_WRITECOPY whenever the injection succeeded. It was PAGE_EXECUTE_READ whenever the injection failed. Interestingly, sometimes two different dlls receive different access protection constants for the same page. For example, either AdjustTheFov received PAGE_EXECUTE_WRITECOPY and UnlockTheFps recevied PAGE_EXECUTE_READ or 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_READ to the list of accepted access protection constants at line 342:

bool isMemoryReadable = (
	protection == PAGE_EXECUTE_READWRITE
	|| protection == PAGE_READWRITE
	|| protection == PAGE_READONLY
	|| protection == PAGE_WRITECOPY
	|| protection == PAGE_EXECUTE_WRITECOPY
	|| protection == PAGE_EXECUTE_READ	// added by myself
	)
	&& state == MEM_COMMIT;

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_EXECUTE and PAGE_EXECUTE_READWRITE) as well but i didn’t test that.

@EzioTheDeadPoet I tried this but as soon as I added the config file for the SkipTheIntro mod then I got the signature error. Where did you put config files ?

Edit: I have this error when I change hide_initial_white_screen = 1 to hide_initial_white_screen = 0

using

[skip_the_intro]
skip_intro_logos = 1
hide_initial_white_screen = 1
hide_initial_white_screen_duration = 0

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 seems did seem pointless to me.