default.txt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. section .text
  2. extern _MessageBoxA@16
  3. %if __NASM_VERSION_ID__ >= 0x02030000
  4. safeseh handler ; register handler as "safe handler"
  5. %endif
  6. handler:
  7. push dword 1 ; MB_OKCANCEL
  8. push dword caption
  9. push dword text
  10. push dword 0
  11. call _MessageBoxA@16
  12. sub eax,1 ; incidentally suits as return value
  13. ; for exception handler
  14. ret
  15. global _main
  16. _main: push dword handler
  17. push dword [fs:0]
  18. mov dword [fs:0], esp
  19. xor eax,eax
  20. mov eax, dword[eax] ; cause exception
  21. pop dword [fs:0] ; disengage exception handler
  22. add esp, 4
  23. ret
  24. avx2: vzeroupper
  25. push rbx
  26. mov rbx, rsp
  27. sub rsp, 0h20
  28. vmovdqa ymm0, [rcx]
  29. vpaddb ymm0, [rdx]
  30. leave
  31. ret
  32. text: db 'OK to rethrow, CANCEL to generate core dump',0
  33. caption:db 'SEGV',0
  34. section .drectve info
  35. db '/defaultlib:user32.lib /defaultlib:msvcrt.lib '