Simplify DLL hook mechanism

This change deletes the GetProcAddress hook and exports symbols
corresponding to the hooked functions from each hook DLL instead;
we stop at redirecting LoadLibrary/GetModuleHandle calls to the
hook DLL. This simplified approach has less hidden magic going on
behind the scenes and is more readily composable (i.e. a hook DLL
can export redirect symbols for more than one dynamically-loaded
DLL).
This commit is contained in:
Tau
2021-05-22 12:29:39 -04:00
parent b4cd868f85
commit 45e2416702
11 changed files with 84 additions and 126 deletions

View File

@ -1,5 +1,7 @@
#pragma once
#include <windows.h>
#include <stdbool.h>
struct gfx_config {
@ -9,4 +11,4 @@ struct gfx_config {
int monitor;
};
void gfx_hook_init(const struct gfx_config *cfg);
void gfx_hook_init(const struct gfx_config *cfg, HINSTANCE self);