I have a DLL that I am loading into a process. The purpose of the DLL is to hook some Windows APIs by placing a jmp on top of the function to my handler. I'm just wondering can I just patch the function like this:
*pFunction = 0xE9 //jmp
*(pFunction+1) = &HookHandler
Or should I kind of lock the memory region first, so that the process can't call the function while I am patching it?