From 67ed544c015c4a8d6e3c41f026663a523d5563a9 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Tue, 20 Oct 2015 23:17:20 +0100 Subject: (ctr/3ds) better detection of cia builds. --- 3ds/3ds_utils.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to '3ds') diff --git a/3ds/3ds_utils.c b/3ds/3ds_utils.c index a5a5846..aaa9a8a 100644 --- a/3ds/3ds_utils.c +++ b/3ds/3ds_utils.c @@ -64,30 +64,24 @@ void ctr_flush_invalidate_cache(void) int ctr_svchack_init(void) { - Handle tempHandle; - Result res = srvGetServiceHandle(&tempHandle, "am:u"); - if(res == 0) + extern unsigned int __service_ptr; + if(__service_ptr) { - /* CFW */ - svcCloseHandle(tempHandle); - ninjhax_version = 0; - ctr_enable_all_svc(); - return 1; - } - else if(hbInit() == 0) - { - /* ninjhax 1.0 */ - ninjhax_version = 1; - hbExit(); - khaxInit(); - return 1; - } - else - { - /* ninjhax 2.0 */ - + if(hbInit() == 0) + { + /* ninjhax 1.0 */ + ninjhax_version = 1; + hbExit(); + khaxInit(); + return 1; + } + ninjhax_version = 2; return 0; } + /* CFW */ + ninjhax_version = 0; + ctr_enable_all_svc(); + return 1; } -- cgit v1.2.3