Closed xchgrbprsp closed 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.
Yes that's basically what I need. I guess I'll just have to write my own. Thanks for your thoughts though.
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.
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 sayMEMORY_SLOT_SIZE
bytes at a time.