fork download
  1.  
  2. #include <cstdlib>
  3. #include <signal.h>
  4. #define NOMINMAX
  5. #include <Windows.h>
  6. #include <iostream>
  7. LONG ExFilter(unsigned long no)
  8. {
  9. return (no == EXCEPTION_ILLEGAL_INSTRUCTION) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
  10. }
  11.  
  12. void sigHandler(int )
  13. {
  14. std::cout << "caught by signal\n";
  15. }
  16. int main()
  17. {
  18. signal(SIGILL, sigHandler);
  19. __try
  20. {
  21. _asm __emit 0Fh
  22. _asm __emit 3fh
  23. _asm __emit 07h
  24. _asm __emit 0Bh
  25. }
  26. __except (ExFilter(GetExceptionCode()))
  27. {
  28. std::cout << "Illegal caught by exception";
  29. }
  30. return 0;
  31. }
  32.  
  33.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:10: fatal error: 'cstdlib' file not found
#include <cstdlib>
         ^~~~~~~~~
1 error generated.
stdout
Standard output is empty