如何截取或替换系统函数(例如TextOut).(300分)

  • 主题发起人 主题发起人 Another_eYes
  • 开始时间 开始时间
A

Another_eYes

Unregistered / Unconfirmed
GUEST, unregistred user!
截取或替换诸如TextOut之类的系统函数的方法. 要32位解决方案.
好象有位本论坛富翁在EX-EX问过. 老外给了他答案. 可惜我找不到那问题在哪了.
哪位知道? 或者有什么好的思路?
 
<a href="http://202.120.85.61/DELPHIBBS/DispQ.asp?LID=99339">这里</a>
 
eYes呀,我也问过类似问题,会长说工作量很大,应该也是个什么HOOK,
可他最近不知道哪里去了,写信问问他吧,不过我给他的MAIL老退
 
再等等看, 也许别人知道.
我在ex-ex狠查呢.
 
刚发现了点好东西,可能明天早上可以拿到。
会让你惊喜的。
 
?
干吗神神秘秘的?
 
什么东西呀?一起共享共享?
eYes:来SEE呀,我没人吹牛了,呵呵,在下载东西,闷呀
 
CJ,没事吗?
有空看一下
<a href="http://202.120.85.61/DELPHIBBS/DispQ.asp?LID=135445">这个</a>
很纳闷的说。
 
这样的事现在多的是,不信你问EYES,无所谓啦
不过他们都还好,不懂也不乱来,有更过分的说,不信你问EYES。
 
EYes:
还有什么高招,说说看!
这里不对人,只对事!
我想开开眼界!
 
"?????" to amo
 
这个2S在行,呵呵
而且,他们也未必就是那么回事。
也许,是巧合,
也许,是有趣
也许,是测试
也许...
 
要解决这问题其实不难
 
嘿嘿,好东西到手。
正在看!
先丢一段说明上来。
Cool!!!

Detours: Binary Interception of Win32 Functions

Abstract

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 of commercial software, researchers seldom have access to all relevant source code.

We present Detours, a library for instrumenting arbitrary Win32 functions on x86 machines. Detours intercepts Win32 functions by re-writing target function images. The Detours package also contains utilities to attach arbitrary DLLs and data segments (called payloads) to any Win32 binary.

While prior researchers have used binary rewriting to insert debugging and profiling instrumentation, to our knowledge, Detours is the first package on any platform to logically preserve the un-instrumented target function (callable through a trampoline) as a subroutine for use by the instrumentation. Our unique trampoline design is crucial for extending existing binary software.

We describe our experiences using 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. Micro-benchmarks demonstrate the efficiency of the Detours library.

1. Introduction
Innovative systems research hinges on the ability to easily instrument and extend existing operating system and application functionality whether in an application, a library, or the operating system DLLs. Typical reasons to intercept functions are to add functionality, modify returned results, or insert instrumentation for debugging or profiling. 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 of commercial development and binary-only releases, researchers seldom have access to all relevant source code.

Detours is a library for intercepting arbitrary Win32 binary functions on x86 machines. Interception code is applied dynamically at runtime. Detours replaces the first few instructions of the target function with an unconditional jump to the user-provided detour function. Instructions from the target function are preserved in a trampoline function. The trampoline function consists of the instructions removed from the target function and an unconditional branch to the remainder of the target function. The detour function can either replace the target function or extend its semantics by invoking the target function as a subroutine through the trampoline.

The original publication of this paper was granted to USENIX. Copyright to this work is retained by the authors. Permission is granted for the noncommercial reproduction of the complete work for educational or research purposes. Published in Proceedings of the 3rd USENIX Windows NT Symposium. Seattle, WA, July 1999.

Detours are inserted at execution time. The code of the target function is modified in memory, not on disk, thus facilitating interception of binary functions at a very fine granularity. For example, the procedures in a DLL can be detoured in one execution of an application, while the original procedures are not detoured in another execution running at the same time. Unlike DLL re-linking or static redirection, the interception techniques used in the Detours library are guaranteed to work regardless of the method used by application or system code to locate the target function.

While others have used binary rewriting for debugging and to inline instrumentation, Detours is a general-purpose package. To our knowledge, Detours is the first package on any platform to logically preserve the un-instrumented target function as a subroutine callable through the trampoline. Prior systems logically prepended the instrumentation to the target, but did not make the original target’s functionality available as a general subroutine. Our unique trampoline design is crucial for extending existing binary software.

In addition to basic detour functionality, Detours also includes functions to edit the DLL import table of any binary, to attach arbitrary data segments to existing binaries, and to inject a DLL into either a new or an existing process. Once injected into a process, the instrumentation DLL can detour any Win32 function, whether in the application or the system libraries.

The following section describes how Detours works. Section 0 outlines the usage of the Detours library. Section 4 describes alternative function-interception techniques and presents a micro-benchmark evaluation of Detours. Section 5 details the usage of Detours to produce distributed applications from local applications, to quantify DCOM overheads, to create a thunking layer for a new COM-based Win32 API, and to implement first chance exception handling. We compare Detours with related work in Section 6 and summarize our contributions in Section 7.


Eyes别打问号呀,说一下,
发散发散我的思维;)
 
等我试完那个remote exploit nt(include SP5?!)的bug再说.
 
sp4:-)))
eYes告诉你个好消息,今天我的机器被IE搞的一直兰屏;
一个坏消息:被我搞好了:-)
 
cj, 那家伙试过sp5, 只是没试过w2k. sp5肯定有这bug.
 
后退
顶部