13.07.2013 Views

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

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

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

25 | 페이지<br />

;check if debug Registers Context. Dr0-Dr3 is not zero<br />

cmp dword [eax+0x04],0<br />

jne .hardware_bp_found<br />

cmp dword [eax+0x08],0<br />

jne .hardware_bp_found<br />

cmp dword [eax+0x0c],0<br />

jne .hardware_bp_found<br />

cmp dword [eax+0x10],0<br />

jne .hardware_bp_found<br />

jmp .exception_ret<br />

.hardware_bp_found<br />

; set Context.EAX to signal breakpoint found<br />

mov dword [eax+0xb0],0xffffffff<br />

.exception_ret<br />

; set Context.EIP upon return<br />

add dword [eax+0xb8],6<br />

xor eax,eax<br />

retn<br />

어떤 패커는 디버그 레지스터들의 읷부를 복호화 키로 사용합니다. 이런 레지스터들은 특정 값으로 초기화 하거나 0 으로 값<br />

을 줍니다. 그래서 디버그 레지스터가 수정되면 복호화가 실패하게 됩니다. 이 복호화 코드가 패킹된 프로그램의 언패킹하는<br />

코드의 읷부분 읷때 코드가 수정되게 되면 복호화가 실패하게 되면 유효하지 않은 명령이 발생되어 예상치 못한 종료가<br />

읷어납니다.<br />

해결방법

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

Saved successfully!

Ooh no, something went wrong!