Showing
5 changed files
with
5 additions
and
3 deletions
... | @@ -12,11 +12,13 @@ unsigned int (* sys_write_orig)(int fd, char *byf, size_t count); | ... | @@ -12,11 +12,13 @@ unsigned int (* sys_write_orig)(int fd, char *byf, size_t count); |
12 | 12 | ||
13 | //sys_write_orig() 호출 전 pBuF의 내용 수정 | 13 | //sys_write_orig() 호출 전 pBuF의 내용 수정 |
14 | 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){ |
15 | - printk("hooker 호출!\n"); | 15 | + if(nFD == 1){ |
16 | - if(current->comm == "hello_world" && nFD == 1){ | 16 | + printk("current process: %s\n",current->comm); |
17 | + if(current->comm == "hello_world"){ | ||
17 | printk("hello world 호출\n"); | 18 | printk("hello world 호출\n"); |
18 | memset(pBuf, 0, nCnt); | 19 | memset(pBuf, 0, nCnt); |
19 | strcpy(pBuf, "Hacked!!!\n"); | 20 | strcpy(pBuf, "Hacked!!!\n"); |
21 | + } | ||
20 | return sys_write_orig(nFD,pBuf, nCnt); | 22 | return sys_write_orig(nFD,pBuf, nCnt); |
21 | } | 23 | } |
22 | else{ | 24 | else{ | ... | ... |
No preview for this file type
No preview for this file type
No preview for this file type
-
Please register or login to post a comment