diff options
author | aliaspider | 2015-10-20 23:17:20 +0100 |
---|---|---|
committer | aliaspider | 2015-10-20 23:17:20 +0100 |
commit | 67ed544c015c4a8d6e3c41f026663a523d5563a9 (patch) | |
tree | baab0a55514dd0dd95e3224c4aeed9fc272912ce | |
parent | 98d327daa55ca00aa012c36b7fb5073dfce89bac (diff) | |
download | picogpsp-67ed544c015c4a8d6e3c41f026663a523d5563a9.tar.gz picogpsp-67ed544c015c4a8d6e3c41f026663a523d5563a9.tar.bz2 picogpsp-67ed544c015c4a8d6e3c41f026663a523d5563a9.zip |
(ctr/3ds) better detection of cia builds.
-rw-r--r-- | 3ds/3ds_utils.c | 36 |
1 files changed, 15 insertions, 21 deletions
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; } |