SkillAgentSearch skills...

EarlyExceptionHandling

Implementing an early exception handler for hooking and threadless process injection without relying on VEH or SEH

Install / Use

/learn @kr0tt/EarlyExceptionHandling
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Early Exception Handling

This repo contains the examples of two tools that use KiUserExceptionDispatcher & Wow64PrepareForException for hooking and threadless process injection. You can read more about this here.

KiUserExceptionDispatcherStepOver

This example uses KiUserExceptionDispatcher & Wow64PrepareForException and hardware breakpoints to step over inline hooks in ntdll.dll. Please note that the EDR's hook offset from the NT function stub entry is hardcoded and so are the SSNs of the NT functions.

KiUserExceptionDispatcherInjection

This example uses KiUserExceptionDispatcher & Wow64PrepareForException for threadless process injection. It creates a suspended process, injects a payload and shellcode stub and finally resumes the suspended process. To raise an exception in the remote process, it can either set a hardware breakpoint on the remote thread or set a PAGE_GUARD on the remote process entry point.

To use it, simply:

.\KiUserExceptionDispatcherInjection.exe < YOUR SHELLCODE > < hwbp | page_guard >

Resources

The following are various resources that I used while writing the blog post and examples. This is by no means extensive, I definitely missed someone or some project :(

View on GitHub
GitHub Stars136
CategoryDevelopment
Updated6d ago
Forks17

Languages

C++

Security Score

95/100

Audited on Mar 31, 2026

No findings