forked from Hay1tsme/segatools
Add option to enable/disable hook
This commit is contained in:
parent
c895c275cf
commit
3c2609798b
|
@ -1,6 +1,8 @@
|
|||
#include "config.h"
|
||||
|
||||
void unity_config_load(struct unity_config *cfg, const wchar_t *filename) {
|
||||
cfg->enable = GetPrivateProfileIntW(L"unity",L"enable",1,filename);
|
||||
|
||||
GetPrivateProfileStringW(
|
||||
L"unity",
|
||||
L"targetAssembly",
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
struct unity_config {
|
||||
bool enable;
|
||||
wchar_t target_assembly[MAX_PATH];
|
||||
};
|
||||
|
||||
|
|
|
@ -34,6 +34,10 @@ static const struct hook_symbol unity_kernel32_syms[] = {
|
|||
void unity_hook_init(const struct unity_config *cfg, HINSTANCE self) {
|
||||
assert(cfg != NULL);
|
||||
|
||||
if (!cfg->enable) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (unity_hook_initted) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue