Here is 2 places I learned how to do API hooking via Runtime Patching:
CodeProject: API hooking for hotpatchable operating systems. Free source code and programming help
And
CodeProject: API Hooking with MS Detours. Free source code and programming help
So maybe start with that and experiment with other API hooks and once you get the hang of it, then prevent WriteProcessMemory by hooking WriteProcessMemory (kernel32.dll), NtWriteVirtualMemory (ntdll.dll), and ZwWriteVirtualMemory (ntdll.dll)
I would also prevent remote threads but that is up to you.
Also, now that I think about it, you will also need to hook SetWindowsHookEx because the system will automatically map Dlls into that process if a certain condition is met for a window hook.
DisableThreadLibraryCalls might have already prevent SetWindowsHookEx from working, but I am not 100% sure.
Here is some info on how remote threads and cause code execution in another process (it mainly shows via CreateRemoteThread)
CodeProject: Three Ways to Inject Your Code into Another Process. Free source code and programming help
FYI - This entire process is really going to take a lot of research and time to understand and get fully working.
For any API hooking, you are basically going to need a Dll which is to be remotely injected into all currently existing processes, and also any new process that is started.
All currently existing processes, isn't too bad (just enumerate them all and then use the VirtualAllocEx, WriteProcessMemory, and CreateRemoteThread method here:
CodeProject: Three Ways to Inject Your Code into Another Process. Free source code and programming help
To ensure you get any newly created process, you will need to hook CreateProcessA, CreateProcessW, CreateProcessExA, CreateProcessExW, and NtCreateProcess (possibly some others relating to threads)
Basically what this will allow you to do is catch the creation of new processes, and then allow you to suspend its 1st thread, and run your code to inject(map) your Dll into that process.
Somewhat described here under "Figuring out when to inject the hook DLL"
CodeProject: API hooking revealed. Free source code and programming help
And here:
http://www.codeprojec*****m/KB/DLL/funapihook.aspx
Search for: CREATE_SUSPENDED
Some other articles you might want to look over or print out and read when you get some time: (These mainly explain the concepts in the articles above, but with various uses)
http://www.codeprojec*****m/KB
sdk/Remote.aspx
http://www.codeprojec*****m/KB/DLL/RemoteLib.aspx
http://www.codeprojec*****m/KB/winsdk...ioWinLock.aspx
http://www.codeprojec*****m/KB/system...nAPICalls.aspx
http://www.codeprojec*****m/KB/system...unleashed.aspx
http://www.codeprojec*****m/KB/DLL/hooks.aspx
The hooking is about the only thing I can give advice on since I do not understand hashing, nor networking to check whether or not software is up-to-date.
And, what exactly do you mean by: *anti injection from dll's ?