can1357/ByePg

SEH dont work functions called in hooks?

Opened this issue · 0 comments

example

void MyFunction()
{
	__try {
		int a = *(int*)0x123;
	}
	__except (1) {
		DbgPrintEx(0, 0, "exception code: 123\n");
	}
}

NTSTATUS hk_NtTerminateProcess(HANDLE ProcessHandle, NTSTATUS ExitStatus)
{
    //...
    MyFunction();
    //...
}

How can I make it work?