[BITS 32] global _start _start: LStart: jmp short LCallGetIP LSetup: ; put the exception handler into fs:[0] add eax, 5 push eax push dword [fs:0] mov [fs:0], esp ; trigger it xor eax, eax mov eax, [eax] ; restore jmp short LFinished LCallGetIP: call LGetIP jmp short LSetup LGetIP: pop eax push eax ret LSEH_Handler: int 0x03 ret LFinished: nop nop nop ; done