additional HB stuff
This commit is contained in:
parent
2c04f993d6
commit
8f9a2edd1a
@ -10,7 +10,18 @@
|
||||
Result initHb();
|
||||
void exitHb();
|
||||
|
||||
// flushes/invalidates entire data/instruction cache
|
||||
// can be useful when writing code to executable pages
|
||||
Result HB_FlushInvalidateCache(void);
|
||||
|
||||
// fetches the address for ninjhax bootloader addresses, useful for running 3dsx executables
|
||||
// void (*callBootloader)(Handle hb, Handle file);
|
||||
// void (*setArgs)(u32* src, u32 length);
|
||||
Result HB_GetBootloaderAddresses(void** load3dsx, void** setArgv);
|
||||
|
||||
// changes the permissions of a given number of pages at address addr to mode
|
||||
// should it fail, the appropriate kernel error code will be returned and *reprotectedPages (if not NULL)
|
||||
// will be set to the number of sequential pages which were successfully reprotected + 1
|
||||
Result HB_ReprotectMemory(u32* addr, u32 pages, u32 mode, u32* reprotectedPages);
|
||||
|
||||
#endif
|
||||
|
@ -15,6 +15,21 @@ void exitHb()
|
||||
svcCloseHandle(hbHandle);
|
||||
}
|
||||
|
||||
Result HB_FlushInvalidateCache(void)
|
||||
{
|
||||
Result ret = 0;
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = 0x00010042;
|
||||
cmdbuf[1] = 0x00000000;
|
||||
cmdbuf[2] = 0x00000000;
|
||||
cmdbuf[3] = 0xFFFF8001;
|
||||
|
||||
if((ret = svcSendSyncRequest(hbHandle))!=0) return ret;
|
||||
|
||||
return (Result)cmdbuf[1];
|
||||
}
|
||||
|
||||
Result HB_GetBootloaderAddresses(void** load3dsx, void** setArgv)
|
||||
{
|
||||
Result ret = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user