Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dllhook mode #888

Closed
Andarwinux opened this issue May 6, 2024 · 1 comment
Closed

Add dllhook mode #888

Andarwinux opened this issue May 6, 2024 · 1 comment

Comments

@Andarwinux
Copy link

Hi.
Static override with dynamic UCRT is not feasible on Windows, and dynamic override requires explicit link to mimalloc, or patch exe, which is unacceptable in some use cases, so would it be possible to consider add a "dllhook" mode? Rename mimalloc to a standard library such as WINMM.DLL, and then that WINMM.DLL transparently replaces malloc.
Thanks.

ref: https://github.com/ysc3839/FontMod

@daanx
Copy link
Collaborator

daanx commented May 18, 2024

Interesting approach that you linked. However, since everything starts to allocate very early in the loading process, mimalloc_redirect must be one of the first to load in order to install the hooks before any allocation happens (or a later free will get pointers from the initial allocations from another allocator). I am not sure if WINMM is loaded early enough..
(this is the purpose of the minject program -- to ensure that mimalloc_redirect is loaded early)

@daanx daanx closed this as completed May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants