How to add a (SEH) exception handler dynamically f

2019-05-30 03:58发布

问题:

Say, if I have a function that is injected into another 64-bit process (for instance, using CreateRemoteThread) and I want to implement Structured Exception Handling in that function (otherwise done via __try, __except, __finally blocks), can I add the SEH handler/filter dynamically?

PS. The reason I'm asking is because SEH is no longer implemented via a stack frame in 64-bit processes (as it used to be in x86.) All SEH entries are now in the PE header of the target process image file.