Implement kernelAbove600()

This commit is contained in:
Michael Scire 2018-09-09 06:52:50 -07:00 committed by fincs
parent 81d56a9e23
commit 6ef26bff1a
2 changed files with 10 additions and 0 deletions

View File

@ -15,5 +15,7 @@ bool kernelAbove300(void);
bool kernelAbove400(void);
/// Returns true if the kernel version is equal to or above 5.0.0.
bool kernelAbove500(void);
/// Returns true if the kernel version is equal to or above 6.0.0.
bool kernelAbove600(void);
/// Returns true if the process has a debugger attached.
bool detectDebugger(void);

View File

@ -8,6 +8,7 @@ static bool g_IsAbove200;
static bool g_IsAbove300;
static bool g_IsAbove400;
static bool g_IsAbove500;
static bool g_IsAbove600;
static bool g_HasCached = 0;
static Mutex g_Mutex;
@ -28,7 +29,9 @@ static void _CacheValues(void)
g_IsAbove300 = (svcGetInfo(&tmp, 18, INVALID_HANDLE, 0) != 0xF001);
g_IsAbove400 = (svcGetInfo(&tmp, 19, INVALID_HANDLE, 0) != 0xF001);
g_IsAbove500 = (svcGetInfo(&tmp, 20, INVALID_HANDLE, 0) != 0xF001);
g_IsAbove600 = (svcGetInfo(&tmp, 21, INVALID_HANDLE, 0) != 0xF001);
g_IsAbove500 |= g_IsAbove600;
g_IsAbove400 |= g_IsAbove500;
g_IsAbove300 |= g_IsAbove400;
g_IsAbove200 |= g_IsAbove300;
@ -58,6 +61,11 @@ bool kernelAbove500(void) {
return g_IsAbove500;
}
bool kernelAbove600(void) {
_CacheValues();
return g_IsAbove600;
}
bool detectDebugger(void) {
u64 tmp;
svcGetInfo(&tmp, 8, 0, 0);