From c1c5685e3a3197b4664e99d3e409f852919275a6 Mon Sep 17 00:00:00 2001 From: QCDLZCLW3K <1329-33c17f40@users.noreply.dev.s-ul.net> Date: Wed, 25 May 2022 09:04:35 +0900 Subject: [PATCH] Force game to always think a debugger isn't present --- src/main/ddrhook1/master.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/ddrhook1/master.c b/src/main/ddrhook1/master.c index 022267b..b30836a 100644 --- a/src/main/ddrhook1/master.c +++ b/src/main/ddrhook1/master.c @@ -12,8 +12,10 @@ #include "util/log.h" static HMODULE(STDCALL *real_LoadLibraryA)(const char *name); +static BOOL(STDCALL *real_IsDebuggerPresent)(); static HMODULE STDCALL my_LoadLibraryA(const char *name); +static BOOL STDCALL my_IsDebuggerPresent(); static const struct hook_symbol master_kernel32_syms[] = { { @@ -21,8 +23,23 @@ static const struct hook_symbol master_kernel32_syms[] = { .patch = my_LoadLibraryA, .link = (void **) &real_LoadLibraryA, }, + { + .name = "IsDebuggerPresent", + .patch = my_IsDebuggerPresent, + .link = (void **) &real_IsDebuggerPresent, + }, }; +static BOOL STDCALL my_IsDebuggerPresent() +{ + // DDR X has different code paths for when a debugger is attached, + // but we want the normal path and not the debugger path. + // The biggest noticeable difference is that when a debugger is attached + // it will show fway.mpg (a car driving) instead of the sky background + // on the menus. + return FALSE; +} + static HMODULE STDCALL my_LoadLibraryA(const char *name) { HMODULE result;