Showing
5 changed files
with
6 additions
and
9 deletions
... | @@ -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 | } | ... | ... |
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