Skip to content

Commit

Permalink
Fix to arm9hook issue mid-kid#1
Browse files Browse the repository at this point in the history
Fixes issue of arm9hook mid-kid#1
-Removes return address patching
Cleaned code
  • Loading branch information
urbanshadow committed Apr 2, 2016
1 parent 6f20337 commit 1b20ece
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
24 changes: 1 addition & 23 deletions source/a9hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@
#include "draw.h"
#include "fs.h"

struct firm_hook firm_hooks[] = {
{
.version = 0x50,
.p9return = 0x0808604C
},
{
.version = 0x1B,
.p9return = 0x080860A0
},
{
.version = 0xFF,
.p9return = 0
}
};

int load_arm9_hook(unsigned int version){
print("Copying hook to itcm...");
Expand All @@ -25,15 +11,7 @@ int load_arm9_hook(unsigned int version){
//draw_message("Failed to load arm9hook", "Please make sure arm9hook file\n actually exists on the SD card.");
return 1;
}

unsigned int i;

for(i=0;firm_hooks[i].version != 0xFF;i++){
if(version == firm_hooks[i].version) {
*((unsigned int*)A9H_JUMPBACK) = firm_hooks[i].p9return;
break;
}
}

print("Hook copied succesfully!");

return 0;
Expand Down
6 changes: 0 additions & 6 deletions source/a9hook.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#define A9H_JUMPBACK 0x01FFB63C
#define A9H_ITCM_POS 0x01FFB638

struct firm_hook {
unsigned int version;
unsigned int p9return;
};

int load_arm9_hook(unsigned int);

0 comments on commit 1b20ece

Please sign in to comment.