Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danieloneill/1e4df6a4947e550d20b2656947cc0bf9 to your computer and use it in GitHub Desktop.
Save danieloneill/1e4df6a4947e550d20b2656947cc0bf9 to your computer and use it in GitHub Desktop.
Patch for Proton (wine/dlls/ntdll/loader.c) to allow SKSEVR/F4SEVR to load correctly.
*** loader.c.orig 2023-01-04 01:40:00.048623579 -0800
--- loader.c 2023-01-04 04:16:01.124146104 -0800
*************** static NTSTATUS load_native_dll( LPCWSTR
*** 2604,2611 ****
{
void *module = NULL;
SIZE_T len = 0;
NTSTATUS status = NtMapViewOfSection( mapping, NtCurrentProcess(), &module, 0, 0, NULL, &len,
! ViewShare, 0, PAGE_EXECUTE_READ );
if (status == STATUS_IMAGE_NOT_AT_BASE) status = STATUS_SUCCESS;
if (status) return status;
--- 2701,2709 ----
{
void *module = NULL;
SIZE_T len = 0;
+ ULONG alloc_type = (image_info->DllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE) ? MEM_TOP_DOWN : 0;
NTSTATUS status = NtMapViewOfSection( mapping, NtCurrentProcess(), &module, 0, 0, NULL, &len,
! ViewShare, alloc_type, PAGE_EXECUTE_READ );
if (status == STATUS_IMAGE_NOT_AT_BASE) status = STATUS_SUCCESS;
if (status) return status;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment