can1357/ByePg

Handle exception cause by a specific module

Closed this issue · 1 comments

hello, is there a way i can detect and only handle exception of a specific module or current module ?, example mydriver.sys, thanks.

void* ImageBase; 
RtlPcToFileHeader(ContextRecord->Rip, &ImageBase);

This will give you the module image base at ImageBase, simply compare it against the module you want to handle exceptions of. "Normal" exceptions from other modules will not reach your exception handler anyways as they are not supposed to bug-check unless there is something wrong.