1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-27 12:46:03 +00:00

Merge pull request #147 from TheDgtl/fusee_stage2_patch_fix

Fix a few issues in the secondary kernel_patches.c file
This commit is contained in:
hexkyz 2018-06-18 16:06:01 +01:00 committed by GitHub
commit f1c326aec3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,8 +5,8 @@
#define MAKE_BRANCH(a, o) 0x14000000 | ((((o) - (a)) >> 2) & 0x3FFFFFF)
#define MAKE_KERNEL_PATTERN_NAME(vers, name) g_kernel_patch_##vers_##name
#define MAKE_KERNEL_HOOK_NAME(vers, name) g_kernel_hook_##vers_##name
#define MAKE_KERNEL_PATTERN_NAME(vers, name) g_kernel_patch_##vers##_##name
#define MAKE_KERNEL_HOOK_NAME(vers, name) g_kernel_hook_##vers##_##name
typedef uint32_t instruction_t;
@ -195,7 +195,7 @@ uint8_t *search_pattern(void *_mem, size_t mem_size, const void *_pattern, size_
}
for (unsigned int i = 0; i <= mem_size - pattern_size; i += table[mem[i + pattern_size - 1]]) {
if (pattern[pattern_size - 1] == table[mem[i + pattern_size - 1]] && memcmp(pattern, mem + i, pattern_size - 1) == 0) {
if (pattern[pattern_size - 1] == mem[i + pattern_size - 1] && memcmp(pattern, mem + i, pattern_size - 1) == 0) {
return mem + i;
}
}