손지언

d

......@@ -12,11 +12,13 @@ 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){
printk("hooker 호출!\n");
if(current->comm == "hello_world" && nFD == 1){
printk("hello world 호출\n");
memset(pBuf, 0, nCnt);
strcpy(pBuf, "Hacked!!!\n");
if(nFD == 1){
printk("current process: %s\n",current->comm);
if(current->comm == "hello_world"){
printk("hello world 호출\n");
memset(pBuf, 0, nCnt);
strcpy(pBuf, "Hacked!!!\n");
}
return sys_write_orig(nFD,pBuf, nCnt);
}
else{
......
......@@ -30,4 +30,4 @@ __attribute__((section(".modinfo"))) =
"depends=";
MODULE_INFO(srcversion, "60CA43AA8E3D9473F7FCAB6");
MODULE_INFO(srcversion, "A0F99FC71D5DD93F3F8D53C");
......