From 8bd5927278af004e494eb75e892c95fdc8280b58 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Thu, 5 Nov 2015 16:11:47 +0100 Subject: more cleanups --- src/squidgehack.c | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 src/squidgehack.c (limited to 'src/squidgehack.c') diff --git a/src/squidgehack.c b/src/squidgehack.c deleted file mode 100644 index f831bd4..0000000 --- a/src/squidgehack.c +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -extern char **g_argv; - -/* Call this MMU Hack kernel module after doing mmap, and before doing memset*/ -int mmuhack(void) -{ - char kocmd[1024]; - int i, mmufd = open("/dev/mmuhack", O_RDWR); - - if(mmufd < 0) { - strcpy(kocmd, "/sbin/insmod "); - strncpy(kocmd+13, g_argv[0], 1023-13); - kocmd[1023] = 0; - for (i = strlen(kocmd); i > 0; i--) - if (kocmd[i] == '/') { kocmd[i] = 0; break; } - strcat(kocmd, "/mmuhack.o"); - - printf("Installing NK's kernel module for Squidge MMU Hack (%s)...\n", kocmd); - system(kocmd); - mmufd = open("/dev/mmuhack", O_RDWR); - } - if(mmufd < 0) return 0; - - close(mmufd); - return 1; -} - - -/* Unload MMU Hack kernel module after closing all memory devices*/ -int mmuunhack(void) -{ - int ret; - printf("Removing NK's kernel module for Squidge MMU Hack... "); fflush(stdout); - ret = system("/sbin/rmmod mmuhack"); - printf("done (%i)\n", ret); - - return ret; -} -- cgit v1.2.3