관리 메뉴

kisoo

MS API 후킹 라이브러리 (배포 버전) 본문

01.About Programming /9..VC++

MS API 후킹 라이브러리 (배포 버전)

JamesK78 2008. 10. 28. 15:11

루트킷 책을 보다가 우연히 검색을 통해서 알게된 API 후킹 라이브러리 입니다.
아직 분석을 다 안해봐서 저도 잘 모릅니다만  루트킷 책을 보면 이해가 되실 것이라 생각 합니다.
그렉 과 제임스가 저자인 '루트킷' 한글판 을 보면 API 후킹 기술과 커널 오브젝트 조작에 대한 
기술이 설명 되어 있습니다. 시스템 프로그램을 하시는 분들 이라면 추천 해주고 싶은 책 입니다.


MS 자료 는 아래의 주소에 링크 되어 있습니다.
http://research.microsoft.com/sn/detours/

현재 버전은 2.1 이고 Express 버전과 Professional 버전이 있습니다.
Express 버전은 비상업용, 연구용으로 공개되어 있으니 다운로드 받으시면 되고 Professional 버전은
돈 주고 구입해야합니다.
두 버전의 차이점이라면 Express 버전은 32비트만 지원하지만 Professional 버전은
64비트도 지원한다는 것뿐입니다. 

----------------------------------------------------------------------------------------

Detours 라이브러리는 현존하는 API 후킹 라이브러리중에 가장 뛰어나고 가장 심플한
후킹 라이브러리이다. 또한, 고급후킹방법과 최고레벨의 후킹기술을 보여주는 샘플도
함께제공한다. 무엇보다 VC++ 을 하는 사람한테는 델파이의 매드훅라이브러리가 부럽지
않게 해줄 정도의 완벽한 후킹라이브러리이다. 이것을 해커들도 알고있으므로 1.5 버전
부터 해커들의 책에 자주등장하였다. 이 Detours 라이브러리의 처음 배포시점의 이미지와
설명법이 rootkit 책에서 조차 인용되고있을 정도로 유명한 라이브러리이다. 이 라이브러리의
응용법은 무궁무진하다. 다만, 고급으로 사용하려면 그만큼의 많은 연습과 노력이 필요하다.

------------------------------------------------------------------------------------------

What's New?

Detours 2.1 is now available. Detours 2.1 includes the following new features:

  • Complete documentation of the Detours API.
  • Transactional model for attaching and detaching detours.
  • Support for updating peer threads when attaching or detaching detours.
  • Unification of dynamic and static detours into a single API.
  • Support for detection of detoured processes.
  • Significant robustness improvements in APIs that start a process with a DLL containing detour functions.
  • New APIs to copy payloads into target processes.
  • Support for 64-bit code on x64 and IA64 processors (available in Professional edition only).
  • Supports building detours with Visual Studio 2005, Visual Studio .NET 2003, Visual Studio .NET (VC8), and Visual Studio (VC7).

Detours 2.1 comes in two editions:

  • Detours Express 2.1 is available for immediate download under a no-fee, click-through license for research, non-commercial, and non-production use on 32-bit code.
  • Detours Professional 2.1 includes a license for use in production environments and the right to distribute detour functions in products. In addition to support for 32-bit x86 code, Detours Professional 2.1 includes support for 64-bit code on x64 and IA64 processors. For information on licensing Detours Professional 2.1 contact Microsoft's IP Licensing Group at iplg@microsoft.com.

Overview

Innovative systems research hinges on the ability to easily instrument and extend existing operating system and application functionality. With access to appropriate source code, it is often trivial to insert new instrumentation or extensions by rebuilding the OS or application. However, in today's world systems researchers seldom have access to all relevant source code.

Detours is a library for instrumenting arbitrary Win32 functions on x86, x64, and IA64 machines. Detours intercepts Win32 functions by re-writing the in-memory code for target functions. The Detours package also contains utilities to attach arbitrary DLLs and data segments (called payloads) to any Win32 binary.

Detours preserves the un-instrumented target function (callable through a trampoline) as a subroutine for use by the instrumentation. Our trampoline design enables a large class of innovative extensions to existing binary software.

We have used Detours to create an automatic distributed partitioning system, to instrument and analyze the DCOM protocol stack, and to create a thunking layer for a COM-based OS API. Detours is used widely within Microsoft and within the industry.

Download Detours Express 2.1!


Comments