Guest User

Untitled

a guest
Mar 7th, 2016
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. format PE GUI
  2. entry start
  3.  
  4. include 'win32a.inc'
  5.  
  6. section '.text' code readable executable
  7.  
  8.   start:
  9.     ; get PEB
  10.     mov eax, [fs:0x30]
  11.     ; compare BeingDebugged flag of PEB
  12.     cmp byte [eax + 2], 0
  13.     je  goodboy
  14.  
  15.     ; show bad boy
  16.     push    0       ; type MB_OK
  17.     push    _badcaption ; dialog title
  18.     push    _badmessage ; message
  19.     push    0       ; no owner window
  20.     call    [MessageBoxA]
  21.     jmp exit
  22.  
  23.   goodboy:
  24.     ; show good boy
  25.     push    0       ; type MB_OK
  26.     push    _goodcaption    ; dialog title
  27.     push    _goodmessage    ; message
  28.     push    0       ; no owner window
  29.     call    [MessageBoxA]
  30.  
  31.    exit:
  32.     push    0       ; success
  33.     call    [ExitProcess]
  34.  
  35. section '.data' data readable writeable
  36.  
  37.   _badcaption db 'I got you!',0
  38.   _badmessage db 'Stop debugging me!',0
  39.   _goodcaption db 'Everything is fine!',0
  40.   _goodmessage db 'Have a good day!',0
  41.  
  42. section '.idata' import data readable writeable
  43.  
  44.   library kernel,'KERNEL32.DLL',\
  45.       user,'USER32.DLL'
  46.  
  47.   import kernel,\
  48.      ExitProcess,'ExitProcess'
  49.  
  50.   import user,\
  51.      MessageBoxA, 'MessageBoxA'
  52.  
  53. section '.reloc' fixups data readable discardable
Add Comment
Please, Sign In to add comment