손지언

d

......@@ -2,7 +2,6 @@
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/string.h>
#define SYSCALL_TABLE_BASE_ADDR (0x8000fc28)
#define MANAGER_PERMISSION (0xff)
......@@ -13,9 +12,9 @@ unsigned int (* sys_write_orig)(int fd, char *byf, size_t count);
//sys_write_orig() 호출 전 pBuF의 내용 수정
unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){
printk("hooker 호출!\n");
if(current->comm == "hello_world" && nFD == 1){
printk("current process: %s", current->comm);
printk("hello world 호출\n");
memset(pBuf, 0, nCnt);
strcpy(pBuf, "Hacked!!!\n");
return sys_write_orig(nFD,pBuf, nCnt);
......@@ -28,7 +27,7 @@ unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){
int __init Hook_Init(void){
printk("외않되\n");
printk("hook 초기화\n");
sys_write_orig = (void *)g_puSysTableAddr[__NR_write];
__asm__ __volatile__("mrc p15, 0, %0, c3, c0" : "=r"(g_uPrevAP));
......
......@@ -30,4 +30,4 @@ __attribute__((section(".modinfo"))) =
"depends=";
MODULE_INFO(srcversion, "6656FAE980A32BBBB7648FE");
MODULE_INFO(srcversion, "60CA43AA8E3D9473F7FCAB6");
......