mhook
mhook copied to clipboard
BlockAlloc: Try to allocate a block rather than returning null.
Like the title implies, noticed that the library would fail in some contexts so copy/pasted the allocation as a fallback. May want to refactor it properly in the future.
Oh, that's an interesting finding. I think it's better to fix the original allocation loop. Random allocation can be more than 2GB away. By the way, do you have a sample that reproduces allocation failure, so we can test the fix?
Sorry, I do not. Was in a large game where a dependency created a thread in DllMain and later would try to install hooks after prompting the user. The interesting part is that other DLLs that hooked things after the executables main() had no issues. If that helps the investigating.
Yes, the bug is clear. The allocation loop starts from the module base and goes up and down symmetrically. If it hits a memory limit from high or below then it stops iterating. However there is still plenty of memory in another direction.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.