[wd_asp elements='search' id=9]

Anti-Reversing Code [1/4]

1. EDIT PLUS 를 이용한 MASM32 컴파일 환경 구축
MASM32 어셈블러를 이용한 Anit-Reversing Code 구현에 앞서 간단히 MASM32 이란 무엇이며 어떻게 환경을 구축하여 테스트를 하는지 에 대한 설명을 할 것이다. MASM32이란 마이크로소프트사의 어셈블러 툴이다 그외 여러가지 어셈블러들이 존재하지만 일반적으로 API를 쓰기 위한 어셈블러로 MASM을 이용하게 된다.

MASM은 어디서 구할수 있으며 환경설정은 어떻게 할것인가? 다음 사이트에서 MASM을 구할수 있다.
http://www.masm32.com/masmdl.htm

현재 최신 버전은 9버전으로 파일명은 m32v9r.zip 으로 존재한다. 참고로 필자의 Visual Studio 의 버전은 6을 쓰며 또한 필요한 툴은 EDIT PLUS 가 있어야 한다 각자의 툴은 알아서 구하길 바란다. 먼저 MSAM을 설치해 본다.

간단히 Enter 키를 누름으로 써 설치를 할 수 있다.
다음은 EDIT-PLUS에서 설정이다. 도구->기본설정->사용자도구 에서 그룹 과 도구 항목을 설정 할 수 있다.

아래는 이와 같은 설정을 나열 해 보여주고 있다.

Edit-Plus Assembly 설정 (MASM32)

  1. Assemble
명령 : C:\masm32\bin\ml.exe /c /coff /Zi,인수 : $(FileName),디렉토리 : $(FileDir),출력 내용 캡쳐 : 체크
2. Link (Console)
명령 : C:\masm32\bin\link.exe /SUBSYSTEM:CONSOLE /DEBUG,인수 : $(FileNameNoExt).obj,디렉토리 : $(FileDir)
출력 내용 캡쳐 : 체크
3. Link (Windows)
명령 : C:\masm32\bin\link.exe /SUBSYSTEM:WINDOWS /DEBUG,인수 : $(FileNameNoExt).obj,디렉토리 :$(FileDir)
출력 내용 캡쳐 : 체크 /> 4. Debug
명령: C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\MSDEV.EXE,인수 : $(FileNameNoExt).exe
디렉토리 : $(FileDir)
5. Execute
명령 : $(FileNameNoExt).exe,디렉토리 : $(FileDir)

또한 EDIT-PLUS 에서는 MASM 문법에 대한 구문강조 파일이 존재한다. 해당 파일은 아래 사이트에서 받을수 있다.

http://www.editplus.com/dn.cgi?asm2.rar 여기서 다운 받은뒤 EDIT-PLUS 가 설치된 폴더에 복사 하면 된다 다음은 해당 구문강조에 대한 설정을 하는 장면이다.

해당 설정을 끝 마쳤다면 이제 실질적인 ASM 코드를 작성 하는 시간이다. 처음에는 간단한 문법 설명을 위하여 IsDebuggerPresent 라는 안티 디버깅 코드를 대상 으로 설명 하고 그외 안티 코드들을 설명할 때 덧붙이는 형식으로 진행한다. 이제 아래 그림처럼 새 파일을 하나 생성 하여 본다.

[계속…]

참고사이트 및 문서
EDIT PLUS 를 이용한 MASM 환경 구축
http://mysilpir.net/entry/EditPlus-Assembly-%EC%84%A4%EC%A0%95-MASM
ANTI REVERSE
http://zesrever.xstone.org/
http://slaxcore.tistory.com
http://beist.org/research/public/artofunpacking/artofunpacking.pdf
http://openrce.org
정덕영님의 윈도우 구조와 원리
THX to zersrever,slaxcore,ashine,ap0x,정덕영FROM Hong10

Copyright(c) 1998-2008 A3 Security ,LTD

Disclaimer
※ 현재 ㈜에이쓰리시큐리티에서 테스트 및 분석 중에 있으며, 이 문서는 계속 업데이트될 것입니다. 본 문서는 보안취약점으로 인한 피해를 최소화하는 데 도움이 되고자 작성되었으나, 본 문서에 포함된 대응방안의 유효성이나 기타 예상치 못한 시스템의 오작동 발생에 대하여서는 ㈜에이쓰리시큐리티에서는 일체의 책임을 지지 아니합니다 [출처] Anti-Reversing Code [1/4]|작성자 카이

“Anti-Reversing Code [1/4]”의 8개의 댓글

  1. Excellent goods from you, man. I’ve understand your stuff previous to and you are just
    too excellent. I really like what you’ve acquired
    here, really like what you are stating and the way in which you say it.
    You make it entertaining and you still care for to keep
    it wise. I can’t wait to read much more from you. This is actually a wonderful web site.

  2. Do you mind if I quote a couple of your articles as
    long as I provide credit and sources back to your blog?
    My blog is in the very same niche as yours and my users would really
    benefit from a lot of the information you provide here. Please let me know if this okay with
    you. Thanks a lot!

  3. Very good site you have here but I was curious about if
    you knew of any discussion boards that cover the same topics discussed
    here? I’d really love to be a part of online community where I
    can get opinions from other experienced individuals that
    share the same interest. If you have any recommendations, please let me know.
    Cheers!

  4. Hi there, just became alert to your blog through Google, and found that it’s really informative.
    I am gonna watch out for brussels. I’ll be grateful if you continue this in future.

    Lots of people will be benefited from your writing. Cheers!

  5. I simply could not leave your web site before suggesting that I extremely loved the standard info an individual provide in your guests?
    Is gonna be back steadily to check out new posts

댓글 달기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

Scroll to Top