;************************************************************************
;
; hmmm nice idea by armadillo!
; a so like "copy_mem" protection
;
; ...^DAEMON^...
;
; please turn i1here on! (debug build!)
; + AND DESTROY THE ENDLESS LOOP WHILE DEBUGGING IT (OR HEY RECOMPILE IT :)
;************************************************************************
.586p
.Model Flat
include win32.inc

extrn   ExitProcess : PROC
extrn   VirtualProtect           : PROC

PAGE_NOACCESS			equ	00000001h
PAGE_READONLY			equ	00000002h
PAGE_READWRITE			equ	00000004h
PAGE_GUARD			equ	00000100h


.Data

db      "FUCK ME!"
old_prot db 010000h dup (00h)

.Code
Main:
      call handler
int 1
      mov  ebx,[esp+0ch]
      mov  eax,[esp+04h]
      mov  eax,[eax]
      mov  eax,[ebx+0b8h]

      mov  ebx,01000h
      push ebx
      push eax
      push offset old_prot
      push PAGE_READWRITE
      push ebx
      push eax
      call VirtualProtect
      pop  eax
      pop  ecx

      sar  ecx,02h
me_:  xor  dword ptr [eax],033333333h
      add  eax,04h
      loop me_
      xor  eax,eax
      ret

handler:
int 1
      push dword ptr fs:[0]
      mov  dword ptr fs:[0],esp
      mov  edi,0403000h
      mov  al,0F0h
      stosb
      push offset old_prot
      push PAGE_NOACCESS
      mov  eax,01000h
      push eax
      push 403000h
      call VirtualProtect
      mov  eax,0403000h
jmp $
      call eax
theend:
      call ExitProcess

End Main                        ;End of code, Main is the entrypoint

