From 35ef0fa98b21fa724b3d810ada5eb8847b639858 Mon Sep 17 00:00:00 2001 From: Bobby Dilley Date: Tue, 28 Nov 2023 23:12:52 +0000 Subject: [PATCH] Remove seg handler and stub dipsw functions --- src/lindbergh/hook.c | 8 ++++---- src/lindbergh/patch.c | 31 ++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/lindbergh/hook.c b/src/lindbergh/hook.c index c9c174f..4384345 100644 --- a/src/lindbergh/hook.c +++ b/src/lindbergh/hook.c @@ -145,10 +145,10 @@ void __attribute__((constructor)) hook_init() fclose(file);*/ // Implement SIGSEGV handler - struct sigaction act; - act.sa_sigaction = handleSegfault; - act.sa_flags = SA_SIGINFO; - sigaction(SIGSEGV, &act, NULL); + // struct sigaction act; + // act.sa_sigaction = handleSegfault; + // act.sa_flags = SA_SIGINFO; + // sigaction(SIGSEGV, &act, NULL); initConfig(); diff --git a/src/lindbergh/patch.c b/src/lindbergh/patch.c index 2a668e7..48a6568 100644 --- a/src/lindbergh/patch.c +++ b/src/lindbergh/patch.c @@ -110,7 +110,7 @@ void _putConsole(const char *format, ...) } else if (*format == '0') { - format ++; + format++; if (*format == '2') { format++; @@ -137,6 +137,30 @@ void _putConsole(const char *format, ...) printf("\n"); } +int amDipswInit() +{ + printf("amDipswInit called\n"); + return 0; +} + +int amDipswGetData() +{ + printf("amDipswGetData called\n"); + return 0; +} + +int amDipswSetLed() +{ + printf("amDipswSetLed called\n"); + return 0; +} + +int amDipswExit() +{ + printf("amDipswExit called\n"); + return 0; +} + int initPatch() { Game game = getConfig()->game; @@ -287,6 +311,11 @@ int initPatch() fwrite((void *)0x08048000,0x630fac,1,file); fclose(file);*/ + + detourFunction(0x084e4efc, amDipswInit); + detourFunction(0x084e500e, amDipswGetData); + detourFunction(0x084e5086, amDipswSetLed); + detourFunction(0x084e4f98, amDipswExit); } break; case LETS_GO_JUNGLE_SPECIAL: