13.07.2013 Views

The art of Unpacking 번역 - SecretOfSh의 블로그

The art of Unpacking 번역 - SecretOfSh의 블로그

The art of Unpacking 번역 - SecretOfSh의 블로그

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

21 | 페이지<br />

push 0x1000<br />

push NULL<br />

call [VirtualAlloc]<br />

test eax,eax<br />

jz .failed<br />

mov [.pAllocatedMem],eax<br />

; store a RETN on the allocated memory<br />

mov byte [eax],0xc3<br />

; then set the PAGE_GUARD attribute <strong>of</strong> the allocated memory<br />

lea eax,[.dwOldProtect]<br />

push eax<br />

push PAGE_EXECUTE_READ | PAGE_GUARD<br />

push 0x1000<br />

push dword [.pAllocatedMem]<br />

call [VirtualProtect]<br />

; set marker (eax) as 0<br />

xor eax,eax<br />

; trigger a STATUS_GUARD_PAGE_VIOLATION exeception<br />

call [.pAllocatedMem]<br />

; check if marker had not been changed (exception handler not called)<br />

test eax,eax<br />

je .debugger_found<br />

:::<br />

.exception_handler

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!