阅读:1573回复:2
9x下 如何知道那个进程建立了文件钩子
我想监控系统中的文件钩子,参考了本站的那个IFS钩子监控的例子,现在的问题是 想知道文件钩子是由哪个进程建立的,如何得到相应钩子的进程名?系统缺省的文件钩子的入口地址是不是固定的?
|
|
沙发#
发布于:2003-01-24 10:11
刚好我这里有一个,可以参考一下
int _cdecl FMS_FileHook(pIFSFunc pfn, int fn, int Drive, int ResType, int CodePage, pioreq pir); BOOL FmsystemDevice::OnSysDynamicDeviceInit() { if(NULL==(ppPrevHook=IFSMgr_InstallFileSystemApiHook(FMS_FileHook))) return FALSE; return TRUE; } int _cdecl FMS_FileHook(pIFSFunc pfn, int fn, int Drive, int ResType, int CodePage, pioreq pir) { int nResult=0; while(1) { switch(fn) { case IFSFN_OPEN: nResult = 1; break; case IFSFN_READ: nResult = 1; break; case IFSFN_WRITE: nResult = 1; break; } break; } nResult = (**ppPrevHook)(pfn, fn, Drive, ResType, CodePage, pir); return nResult; } |
|
板凳#
发布于:2003-01-24 10:13
哦,忘了这些
ppIFSFileHookFunc ppPrevHook; BOOL FmsystemDevice::OnSysDynamicDeviceExit() { if (ppPrevHook) { IFSMgr_RemoveFileSystemApiHook(FMS_FileHook); } return TRUE; } |
|