libctru  v1.6.0
hb.h
Go to the documentation of this file.
1 /**
2  * @file hb.h
3  * @brief HB (Homebrew) service.
4  */
5 #pragma once
6 
7 // WARNING ! THIS FILE PROVIDES AN INTERFACE TO A NON-OFFICIAL SERVICE PROVIDED BY NINJHAX
8 // BY USING COMMANDS FROM THIS SERVICE YOU WILL LIKELY MAKE YOUR APPLICATION INCOMPATIBLE WITH OTHER HOMEBREW LAUNCHING METHODS
9 // A GOOD WAY TO COPE WITH THIS IS TO CHECK THE OUTPUT OF hbInit FOR ERRORS
10 
11 #include <3ds/types.h>
12 
13 /// Initializes HB.
14 Result hbInit(void);
15 
16 /// Exits HB.
17 void hbExit(void);
18 
19 /// Flushes/invalidates the entire data/instruction cache.
21 
22 /**
23  * @brief Fetches the address for Ninjhax 1.x bootloader addresses.
24  * @param load3dsx void (*callBootloader)(Handle hb, Handle file);
25  * @param setArgv void (*setArgs)(u32* src, u32 length);
26  */
27 Result HB_GetBootloaderAddresses(void** load3dsx, void** setArgv);
28 
29 /**
30  * @brief Changes the permissions of a given number of pages at address addr to mode.
31  * Should it fail, the appropriate kernel error code will be returned and *reprotectedPages (if not NULL)
32  * will be set to the number of sequential pages which were successfully reprotected + 1
33  * @param addr Address to reprotect.
34  * @param pages Number of pages to reprotect.
35  * @param mode Mode to reprotect to.
36  * @param reprotectedPages Number of successfully reprotected pages, on failure.
37  */
38 Result HB_ReprotectMemory(u32* addr, u32 pages, u32 mode, u32* reprotectedPages);
Various system types.
s32 Result
Function result.
Definition: types.h:42
Result HB_FlushInvalidateCache(void)
Flushes/invalidates the entire data/instruction cache.
uint32_t u32
32-bit unsigned integer
Definition: types.h:23
Result hbInit(void)
Initializes HB.
Result HB_GetBootloaderAddresses(void **load3dsx, void **setArgv)
Fetches the address for Ninjhax 1.x bootloader addresses.
Result HB_ReprotectMemory(u32 *addr, u32 pages, u32 mode, u32 *reprotectedPages)
Changes the permissions of a given number of pages at address addr to mode.
void hbExit(void)
Exits HB.