Is there a way to hook WinAPI system calls on 64-bit builds of Windows, without disabling PG (patch guard)? SSDT hooking using a kernel mode driver is not an option, because patch guard will crash the system when it detects a hook.
For example, a process wants to call the CreateProcessA, how do I block (or allow) it depending on the arguments that are passed to it? (However, I would like to know specifically how to hook any or most of the API functions)
Windows Defender does this, if you try running sc query it will work, but running sc stop WinDefend will trigger a threat alert.
I can provide you with a pseudo code according to my understanding which is somewhat high level for creating a system wide hook . Obviously the actual implementation will be a tedious and lengthy one.