손지언

d

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