I am working on an anticheat and I would like to hook APIs like Read/WriteProcessMemory, OpenProcess and maybe some more to check if it reads or writes some data to/from the game.
But I am not that experienced programmer to do it on my own so I tried to do it via easyhook. Firstly I got the example (http://www.codeproject.com/Articles/27637/EasyHook-The-reinvention-of-Windows-API-hooking) to work. Then I tried to replace CreateFile
by ReadProcessMemory
but there was a line This.Queue.Push(hProcess);
, how am I supposed to replace hProcess
in case I am hooking ReadProcessMemory
?
I couldn't find any other example of hooking API in C# than the one hooking CreateFile
posted above.
Also it doesn't need to be done by easyhook if there is a simpler way.
Thanks.