손지언

d

...@@ -16,14 +16,11 @@ unsigned int (* sys_write_orig)(int fd, char *byf, size_t count); ...@@ -16,14 +16,11 @@ unsigned int (* sys_write_orig)(int fd, char *byf, size_t count);
16 //sys_write_orig() 호출 전 pBuF의 내용 수정 16 //sys_write_orig() 호출 전 pBuF의 내용 수정
17 unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){ 17 unsigned int sys_write_hooked(int nFD, char *pBuf, size_t nCnt){
18 18
19 - if(nFD == 1){ 19 + if(nFD == 1 && !strcmp(current->comm,"hello_world")){
20 - 20 + memset(pBuf, 0, nCnt);
21 - if(!strcmp(current->comm,"hello_world")){ 21 + strcpy(pBuf, "Hacked!!!\n");
22 - memset(pBuf, 0, nCnt); 22 + return sys_write_orig(nFD,pBuf, nCnt);
23 - strcpy(pBuf, "Hacked!!!\n"); 23 + }
24 - }
25 - return sys_write_orig(nFD,pBuf, nCnt);
26 - }
27 else{ 24 else{
28 return sys_write_orig(nFD,pBuf, nCnt); 25 return sys_write_orig(nFD,pBuf, nCnt);
29 } 26 }
......
...@@ -31,4 +31,4 @@ __attribute__((section(".modinfo"))) = ...@@ -31,4 +31,4 @@ __attribute__((section(".modinfo"))) =
31 "depends="; 31 "depends=";
32 32
33 33
34 -MODULE_INFO(srcversion, "41DBD0D0A44067D769467DB"); 34 +MODULE_INFO(srcversion, "55CB21EDEE8A98ECC603404");
......
No preview for this file type