diff --git a/mods/src/core.c b/mods/src/core.c index 64fb2e2..ad3a44b 100644 --- a/mods/src/core.c +++ b/mods/src/core.c @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include @@ -70,7 +72,10 @@ void _patch(const char *file, int line, void *start, unsigned char patch[]) { mprotect((void *) page_start, end - page_start, PROT_READ | PROT_EXEC); - __builtin___clear_cache(start, (void *) end); + if (cacheflush(start, 4, ICACHE) != 0) { + fprintf(stderr, "Error Flushing Cache: %s\n", strerror(errno)); + exit(1); + } } void _patch_address(const char *file, int line, void *start, void *target) {