Exception triggersStructured Exceptions Handling is a complex mechanism that makes many anti-debuggers / anti-emulators possible. After setting a handler (check
Subtle SEH for exotic ways, but never used in the wild), you trigger the exception. And typically, packers rely blindly on the trigger itself, such as the actual error code: in short, trigger the wrong exception, and execution will fail (tampering is deected).
The most common ones are:
Int3 BREAKPOINT 080000003h
mov [0], ... ACCESS_VIOLATION 0c0000005h
But what about the rest?
I put together common exception triggers. There is no point listing all of them and all possible triggers, just common ones found in packers or malware, or the ones with a non-obvious behavior.
Access violationThis is probably the most common one, as it can happen 'naturally'. Access a wrong address, and it will trigger. Note that would also happen on trying to write a readonly address.
Also, most interrupts, including
CD01 Int 1 and
CD20 int 20h, will trigger this exception. This is different from
F1 IceBP, which is sometimes written
Int1, and triggers a Single step exception, and Int 20h used to be for
VxdCalls under Windows 9x, so this is not relevant today anymore.