Skip to content

Commit

Permalink
Merge pull request #48 from d3m3vilurr/fix-o3ds
Browse files Browse the repository at this point in the history
Fix O3DS systems
  • Loading branch information
nedwill authored Jan 8, 2017
2 parents aff243c + 5ca9490 commit 908c6d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions source/backdoor.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define SEND_SYNC_REQUEST3 0x30
#define SVC_BACKDOOR_NUM 0x7B
#define CURRENT_PROCESS 0xFFFF9004
#define HANDLE_TABLE_OFFSET 0xDC
#define HANDLE_TABLE_OFFSET(is_new3ds) ((is_new3ds) ? 0xDC : 0xD4)

#define EXC_VA_START ((u32*)0xFFFF0000)
#define AXIWRAMDSP_RW_MAPPING_OFFSET (0xDFF00000 - 0x1FF00000)
Expand Down Expand Up @@ -131,7 +131,9 @@ static void kernel_get_object_addr() {
kdisable_interrupts();
Handle handle = get_object_handle;
u32 current_process = *(u32 *)CURRENT_PROCESS;
u32 process_handle_table = current_process + HANDLE_TABLE_OFFSET;
bool is_new3ds;
APT_CheckNew3DS(&is_new3ds);
u32 process_handle_table = current_process + HANDLE_TABLE_OFFSET(is_new3ds);
get_object_ret = handle_lookup_kern((void *)process_handle_table, handle);
}

Expand Down
3 changes: 2 additions & 1 deletion source/exploit.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ static void kernel_restore_pid() {

/* Copy from waithax & svchax */
bool elevate_system_privilege() {
bool is_new = osGetKernelVersion();
bool is_new;
APT_CheckNew3DS(&is_new);
kernel_patch_args = &is_new;

svcGlobalBackdoor((s32(*)(void)) & kernel_patch_acl);
Expand Down

0 comments on commit 908c6d4

Please sign in to comment.