On 9/9/21 16:33, Gabriel Ivăncescu wrote:
O
Can't you just add some wine-specific logic to LoadLibrary to handle this? System libs shouldn't be loading non-system-libs anyway. While it may be ugly, you can check the return address and see if it's within a system lib's address range.
Leaving the fragility of such a solution apart, I think it is not supposed to work nicely with numerous hotpatchers which hook LoadLibrary at various API levels. The return address will point to the hooker in this case, besides potentially breaking the hotpatcher's logic.