mirror of
https://gitea.tendokyu.moe/TeamTofuShop/taitools.git
synced 2026-09-30 02:37:57 +03:00
theatrhythm: touchscreen OK
This commit is contained in:
+41
-5
@@ -162,15 +162,18 @@ void createprocess_hook_init() {
|
||||
}
|
||||
did_init = true;
|
||||
|
||||
hook_table_apply(
|
||||
NULL,
|
||||
"kernel32.dll",
|
||||
win32_hooks,
|
||||
_countof(win32_hooks));
|
||||
createprocess_hook_insert_hook(NULL);
|
||||
InitializeCriticalSection(&createproc_lock);
|
||||
dprintf("CreateProcess: Init\n");
|
||||
}
|
||||
|
||||
void createprocess_hook_insert_hook(HMODULE target) {
|
||||
hook_table_apply(
|
||||
target,
|
||||
"kernel32.dll",
|
||||
win32_hooks,
|
||||
_countof(win32_hooks));
|
||||
}
|
||||
|
||||
static BOOL WINAPI my_CreateProcessA(
|
||||
LPCSTR lpApplicationName,
|
||||
@@ -185,6 +188,7 @@ static BOOL WINAPI my_CreateProcessA(
|
||||
LPPROCESS_INFORMATION lpProcessInformation
|
||||
)
|
||||
{
|
||||
//dprintf("my_CreateProcessA: %s %s\n", lpApplicationName, lpCommandLine);
|
||||
for (int i = 0; i < process_nsyms_a; i++) {
|
||||
if (strncmp(process_syms_a[i].name, lpCommandLine, strlen(process_syms_a[i].name))) {
|
||||
continue;
|
||||
@@ -242,6 +246,38 @@ BOOL my_CreateProcessW(
|
||||
LPSTARTUPINFOW lpStartupInfo,
|
||||
LPPROCESS_INFORMATION lpProcessInformation)
|
||||
{
|
||||
//dprintf("my_CreateProcessW: %S %S\n", lpApplicationName, lpCommandLine);
|
||||
for (int i = 0; i < process_nsyms_w; i++) {
|
||||
if (wcsncmp(process_syms_w[i].name, lpCommandLine, wcslen(process_syms_w[i].name))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
dprintf("CreateProcess: Hooking child process %S %S\n", lpApplicationName, lpCommandLine);
|
||||
wchar_t new_cmd[MAX_PATH] = {0};
|
||||
wcscat_s(new_cmd, MAX_PATH, process_syms_w[i].head);
|
||||
|
||||
if (!process_syms_w[i].replace_all) {
|
||||
wcscat_s(new_cmd, MAX_PATH, lpCommandLine);
|
||||
}
|
||||
|
||||
if (process_syms_w[i].tail != NULL) {
|
||||
wcscat_s(new_cmd, MAX_PATH, process_syms_w[i].tail);
|
||||
}
|
||||
|
||||
dprintf("CreateProcess: Replaced CreateProcessW %S\n", new_cmd);
|
||||
return next_CreateProcessW(
|
||||
lpApplicationName,
|
||||
new_cmd,
|
||||
lpProcessAttributes,
|
||||
lpThreadAttributes,
|
||||
bInheritHandles,
|
||||
dwCreationFlags,
|
||||
lpEnvironment,
|
||||
lpCurrentDirectory,
|
||||
lpStartupInfo,
|
||||
lpProcessInformation
|
||||
);
|
||||
}
|
||||
return next_CreateProcessW(
|
||||
lpApplicationName,
|
||||
lpCommandLine,
|
||||
|
||||
Reference in New Issue
Block a user