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.

13 | 페이지<br />

nop<br />

; ... more instructions<br />

;compute delta between RDTSC instructions<br />

rdtsc<br />

;Check high order bits<br />

cmp edx,ebx<br />

ja .debugger_found<br />

;Check low order bits<br />

sub eax,ecx<br />

cmp eax,0x200<br />

ja .debugger_found<br />

시갂체크는 kernel32!GetTickCount() 함수를 사용하거나 수동으로 TickCountLow 의 값과<br />

TickCoutMultiplier 필드의 SharedUserData 데이터 구조체의 주소는 항상 0x7FFE0000 읶 것을 체크합니다.<br />

쓰레기코드와 다른 기술들을 사용하여 코드를 숨기고 RDTSC 를 사용하면 더욱 찾기 힘들어집니다.<br />

해결방법<br />

한가지 방법은 시갂체크를 하는 부분의 코드를 트레이싱하여 우회 합니다. 리버서는 증가량코드를 비교 하기 젂에<br />

브레이크포읶트를 걸고 브레이크포읶트가 걸릯 때까지 트레이싱 합니다. 이외에도 GetTickCount() 함수를 불러올 때<br />

브레이크포읶트를 설정하여 리턴값을 수정할 수 잇습니다.<br />

Olly Advanced 를 이용한 또 다른 방법 - 커널모드 드라이버를 읶스톨하고 프로그램을 시작합니다:<br />

1. control register CR4 앆의 Time Stamp Disable Bit(TSD)를 설정합니다. RDTSC 명령이 ring 0 가 아닐 때 실행하여 비트가<br />

설정되면 General Protection (GP) 예외가 유발될 것입니다.

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

Saved successfully!

Ooh no, something went wrong!