c# - Which user-mode functions to hook to monitor/intercept file access? -
which user-mode functions in windows 7 can hook monitor/intercept file access?
i've tried ntdll.dll's ntopenfile()
, ntcreatefile()
, of these aren't files - they're pipes , mutexes. same goes kernel32.dll's createfile()
. there function called access files/directories. if helps, i'm trying hook explorer.exe prevent access firefox.exe. i'm using easyhook, if of have familiarity it.
i think i've read somewhere that, using parameters ntopenfile/ntcreatefile, can distinguish between file access/pipe access. that's still bit hazy. there nice comfortable function hook?
edit: please keep in mind need intercept file access prevent access files. easyhook great solution, since allows me perform complicated hooking in few easy steps in c# managed code.
there no "file open function" opens files. furthermore, hooking supported using detours. finally, must ensure computers running have .net 4.0 installed, can run in-proc sxs.
a far superior solution change file permissions on firefox.exe. solution requires no licensing of detours, , supported.
Comments
Post a Comment