1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2024-11-14 10:17:38 +01:00

Force game to always think a debugger isn't present

This commit is contained in:
QCDLZCLW3K 2022-05-25 09:04:35 +09:00
parent 050e52b21e
commit c1c5685e3a

View File

@ -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;