[Dev] How's the external allocator actualy works ?

about everything
Post Reply
  • Author
  • Message
Offline
Posts: 2
Joined: 07 Nov 2015, 16:43

[Dev] How's the external allocator actualy works ?

Hello, i've been using ENB on Skyrim for months and i'm wondering how is it possible to malloc() skyrim's textures (or whatever is the ENB Host APP malloc()'ing) on an external app and in x64.

Are you "redirecting" or hooking the malloc function ?

I never really worked on reverse-engineering and the module is protected so don't get how it works.




If i'm trying to get how it works it's because i would like to make an external allocator for garry's mod (Which has a lot of segfaults because it's an x86 app).


Thanks.

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17427
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: [Dev] How's the external allocator actualy works ?

Geometry and textures at their creation time are moved to enbhost.exe process(es) via VirtualAllocEx->WriteProcessMemory. When they are visible on screen, callback function load them back to game process and create them as d3d objects in video memory. Of course this is not so simple like it sounds, many d3d functions hooked to detect when resources required and which could be unloaded or force unload by priority if not enough video memory. I don't think malloc or any other basic functions can be replaced to free some ram of the process, the trick is just removes dx9 specific issue - managed resources.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
Posts: 2
Joined: 07 Nov 2015, 16:43

Re: [Dev] How's the external allocator actualy works ?

Thanks :)
Post Reply