Advertisement
waliedassar

RaiseException(0x4000001f) Anti-Olly Trick

Jan 30th, 2013
897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. //http://waleedassar.blogspot.com
  2. //http://www.twitter.com/waleedassar
  3.  
  4. //Works against OllyDbg v1.10
  5.  
  6. #include "stdafx.h"
  7. #include "windows.h"
  8. #include "stdio.h"
  9.  
  10. int _cdecl Handler(EXCEPTION_RECORD* pRec,void* Est_Frame,unsigned char* pContext,void* Disp)
  11. {
  12.     printf("Exception %x Caught\r\n",pRec->ExceptionCode);
  13.     ExitProcess(0);
  14.     return ExceptionContinueSearch;
  15. }
  16.  
  17. int main()
  18. {
  19.     __asm
  20.     {
  21.         push offset Handler
  22.         push dword ptr fs:[0x0]
  23.         mov dword ptr fs:[0x0],esp
  24.     }
  25.     RaiseException(0x4000001f,0,0,0);
  26.     printf("Debugger detected!\r\n");
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement