From cb25758f966c10ac02fb8b3389a2771a7a26cdc5 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Fri, 1 Jun 2012 12:17:11 +0200 Subject: [PATCH] make return-to-hbf work with ABHFIX --- main/source/Tools/load_channel.h | 1 + main/source/ahbfix.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/main/source/Tools/load_channel.h b/main/source/Tools/load_channel.h index 87b27bf..3dc50bf 100644 --- a/main/source/Tools/load_channel.h +++ b/main/source/Tools/load_channel.h @@ -1 +1,2 @@ void LoadHBF(); +u8 hbcStubAvailable(); diff --git a/main/source/ahbfix.cpp b/main/source/ahbfix.cpp index 3254b75..1b8806e 100644 --- a/main/source/ahbfix.cpp +++ b/main/source/ahbfix.cpp @@ -24,14 +24,13 @@ distribution. -------------------------------------------------------------*/ - - #include #include #include #include #include "gecko.h" - +#include "Tools/load_channel.h" +#include "filelist.h" #define CHECK_AHB 0x0D800064 #define MEM2_PROT 0x0D8B420A @@ -72,6 +71,11 @@ s32 Patch_ahbprot(void) //break; } } + + memcpy((void*)0x80001800, stub_bin, stub_bin_size); + DCFlushRange((void*)0x80001800,stub_bin_size); + + hbcStubAvailable(); } return false; }