siva: impl NanoTS_PTool_win8 hook

This commit is contained in:
Hay1tsme 2024-02-14 13:38:52 -05:00
parent ffcf6dafc2
commit eedd32c8f9
5 changed files with 37 additions and 0 deletions

View File

@ -21,6 +21,16 @@ void siva_dll_config_load(
filename); filename);
} }
void touch_config_load(
struct touch_config *cfg,
const wchar_t *filename)
{
assert(cfg != NULL);
assert(filename != NULL);
cfg->enable = GetPrivateProfileIntW(L"touch", L"enable", 1, filename);
}
void siva_hook_config_load( void siva_hook_config_load(
struct siva_hook_config *cfg, struct siva_hook_config *cfg,
const wchar_t *filename) const wchar_t *filename)
@ -31,4 +41,5 @@ void siva_hook_config_load(
platform_config_load(&cfg->platform, filename); platform_config_load(&cfg->platform, filename);
siva_dll_config_load(&cfg->dll, filename); siva_dll_config_load(&cfg->dll, filename);
gfx_config_load(&cfg->gfx, filename); gfx_config_load(&cfg->gfx, filename);
touch_config_load(&cfg->touch, filename);
} }

View File

@ -3,6 +3,7 @@
#include <stddef.h> #include <stddef.h>
#include "sivahook/siva-dll.h" #include "sivahook/siva-dll.h"
#include "sivahook/touch.h"
#include "platform/config.h" #include "platform/config.h"
#include "gfxhook/config.h" #include "gfxhook/config.h"
@ -12,6 +13,7 @@ struct siva_hook_config {
struct platform_config platform; struct platform_config platform;
struct siva_dll_config dll; struct siva_dll_config dll;
struct gfx_config gfx; struct gfx_config gfx;
struct touch_config touch;
}; };
void siva_hook_config_load( void siva_hook_config_load(

View File

@ -12,6 +12,7 @@
#include "sivahook/config.h" #include "sivahook/config.h"
#include "sivahook/siva-dll.h" #include "sivahook/siva-dll.h"
#include "sivahook/touch.h"
#include "sivahook/unity.h" #include "sivahook/unity.h"
#include "platform/platform.h" #include "platform/platform.h"

14
sivahook/touch.c Normal file
View File

@ -0,0 +1,14 @@
#include <windows.h>
#include <stdbool.h>
#include "sivahook/touch.h"
#include "hooklib/createprocess.h"
HRESULT touch_hook_init(const struct touch_config *cfg)
{
if (!cfg->enable) {
return S_FALSE;
}
return createprocess_push_hook_a("NanoTS_PTool_win8.exe", "inject.exe -d -k sivahook.dll ", NULL, false);
}

9
sivahook/touch.h Normal file
View File

@ -0,0 +1,9 @@
#pragma once
#include <windows.h>
#include <stdbool.h>
struct touch_config {
bool enable;
};
HRESULT touch_hook_init(const struct touch_config *cfg);