TsudaKageyu / minhook

The Minimalistic x86/x64 API Hooking Library for Windows
http://www.codeproject.com/KB/winsdk/LibMinHook.aspx
Other
4.43k stars 897 forks source link

Access Internal Buffer #68

Closed xchgrbprsp closed 6 years ago

xchgrbprsp commented 6 years ago

I was wondering if you can add the ability to access the internal buffer since it's conveniently allocated within the 2GB jump distance of the target. I'm aware that a full malloc like allocator may require major changes and that you hope to keep this library as minimal as possible, it would still be better than nothing to implement a fixed size allocator that can only allocate say MEMORY_SLOT_SIZE bytes at a time.

m417z commented 6 years ago

I'm not sure that I understand what you mean. Are you looking for a malloc like function that will be able to get an address as an input, and allocate memory which is up to 2GB away from this address? If so, you can create such a function based on the code of this library, but I don't think that exposing this functionality as a part if the MinHook interface is a good fit.

xchgrbprsp commented 6 years ago

Yes that's basically what I need. I guess I'll just have to write my own. Thanks for your thoughts though.

m417z commented 6 years ago

Look at the function GetMemoryBlock, it's almost exactly what you're looking for. Just remove the blocks which refer to the g_pMemoryBlocks global variable, and if I'm not mistaken you're done.