2022-06-13 03:22:52 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Windows.h>
|
|
|
|
|
|
|
|
typedef struct function_hook {
|
|
|
|
LPCSTR dll;
|
|
|
|
LPCSTR name;
|
|
|
|
PVOID patch;
|
|
|
|
PVOID* store;
|
|
|
|
UINT length;
|
|
|
|
struct function_hook* next;
|
|
|
|
} function_hook_t;
|
|
|
|
|
2022-07-02 15:07:54 +00:00
|
|
|
static BOOL Detour(PVOID src, PVOID dst, const intptr_t len);
|
|
|
|
|
2022-06-13 03:22:52 +00:00
|
|
|
void patch_at(PVOID addr, const char* patch, DWORD length);
|
|
|
|
void clear_at(PVOID addr, BYTE clearVal, DWORD length);
|
|
|
|
void* CreateHook(PVOID src, PVOID dst, const intptr_t len);
|
|
|
|
|
2022-07-02 15:07:54 +00:00
|
|
|
static void append_hook(function_hook_t* hook);
|
2022-06-13 03:22:52 +00:00
|
|
|
void hook(LPCSTR dll, LPCSTR name, void* patch, void** store, UINT length);
|
|
|
|
|
|
|
|
void setup_hooks();
|