(ctr/3ds) better detection of cia builds.

This commit is contained in:
aliaspider 2015-10-20 23:17:20 +01:00
parent 98d327daa5
commit 67ed544c01

View file

@ -64,30 +64,24 @@ void ctr_flush_invalidate_cache(void)
int ctr_svchack_init(void) int ctr_svchack_init(void)
{ {
Handle tempHandle; extern unsigned int __service_ptr;
Result res = srvGetServiceHandle(&tempHandle, "am:u"); if(__service_ptr)
if(res == 0)
{ {
/* CFW */ if(hbInit() == 0)
svcCloseHandle(tempHandle); {
ninjhax_version = 0; /* ninjhax 1.0 */
ctr_enable_all_svc(); ninjhax_version = 1;
return 1; hbExit();
} khaxInit();
else if(hbInit() == 0) return 1;
{ }
/* ninjhax 1.0 */ ninjhax_version = 2;
ninjhax_version = 1;
hbExit();
khaxInit();
return 1;
}
else
{
/* ninjhax 2.0 */
return 0; return 0;
} }
/* CFW */
ninjhax_version = 0;
ctr_enable_all_svc();
return 1;
} }