손지언

d

......@@ -16,12 +16,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){
if(nFD == 1){
if(!strcmp(current->comm,"hello_world")){
if(nFD == 1 && !strcmp(current->comm,"hello_world")){
memset(pBuf, 0, nCnt);
strcpy(pBuf, "Hacked!!!\n");
}
return sys_write_orig(nFD,pBuf, nCnt);
}
else{
......
......@@ -31,4 +31,4 @@ __attribute__((section(".modinfo"))) =
"depends=";
MODULE_INFO(srcversion, "41DBD0D0A44067D769467DB");
MODULE_INFO(srcversion, "55CB21EDEE8A98ECC603404");
......
No preview for this file type