-
-
[下载]Ultimate Hooking Engine
-
发表于: 2007-5-31 18:32 7031
-
FROM:18bK9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8X3y4J5j5h3y4C8L8r3q4T1i4K6u0W2M7Y4g2Q4x3V1k6X3i4K6u0r3K9h3&6V1k6i4S2Q4x3X3g2H3K9s2m8Q4x3@1k6S2j5%4c8A6L8$3&6Q4x3@1c8$3N6r3S2J5k6h3q4V1i4K6t1$3k6X3!0J5N6h3#2Q4x3@1b7K6i4K6t1$3N6r3!0H3K9h3y4Q4x3@1b7^5z5e0l9^5
Ultimate Hooking Engine
(c) 2007 deroko of ARTeam
Ultimate Hooking Engine is project started for my own needs, to be
honest, I got tired of rewriting inline hooks everytime I need to
hook something.
This engine is very simple to use and is designed to be used by
everyone that need to hook something, all that is required to hook
certain target is carfully crafted hooking dll with certain exports,
actually exports are used to locate API that you want to hook, there
are 3 export types that your dll may have:
1. prefixed HOOK
2. prefixed Detoured
3. hookmain (optional)
1. Whenever you want to hook some API you will put this kind of export:
HOOK_kernel32_GetModuleHandleA
HOOK_user32_MessageBoxA
Also note that inline hook will point to this procedure so this procedure
will have all of your code responsible for certain API.
2. To be able to call original API from your hook you should export also
this variable (in C/C++ it will be function pointer):
Note how variables are prefixed with "Detoured_"
Detoured_GetModuleHandleA
Detoured_MessageBoxA
Here is one example from C/C++ code:
extern "C" __declspec(dllexport) HMODULE (__stdcall *Detoured_GetModuleHandleA)(LPCTSTR modulename) = NULL;
extern "C" HMODULE __declspec(dllexport) __stdcall HOOK_kernel32_GetModuleHandleA(LPCTSTR modulename){
return Detoured_GetModuleHandleA(modulename);
}
Note also that this is optional, if you don't need to call orignal proc,
then you don't need this export.
Note that when working with MSVC2005 it will always screw export name for
procedurs while function pointers are properly exported, so add this line
to your .def file:
HOOK_kernel32_GetModuleHandleA = _HOOK_kernel32_GetModuleHandleA@4
Detoured_GetModuleHandleA
3. hookmain
hookmain is export which has this prototype:
void __stdcall hookmain();
This procedure will be called before program jumps to entrypoint of
target, here you may add some extra code, it isn't very useful and
all initialization you may perfrom in DllEntry, but I leave this here
just in case that you want to start your own tracer before code jmps
to entrypoint. At least that's why I'm using it.
Examples for MSVC, Borland C and tasm you may find in examples folder,
Enjoy...
(c) 2007 deroko of ARTeam
8d2K9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8X3c8W2M7X3!0C8L8#2)9J5k6i4m8Z5k6h3q4J5L8r3g2K6M7#2)9J5k6h3!0J5k6#2)9J5c8Y4g2D9N6r3W2E0j5i4c8W2i4K6u0W2P5X3W2H3
赞赏
他的文章
谁下载
kanxue
forgot
cyclotron
zerotime
EndlessCrash
niuniu_4
datm
小八
Phoenix
pianzhi
ylp1332
LOCKLOSE
Pan88168
zxc
xyzjhe
paragui
cd37ycs
SnowFox
laomms
aalloverred
ysoni
okdodo
abxy
dwing
dyk158
ngaut
执着我一生
gz818
cyberman
marcoak
mmqiang
xiong779
progray
yijun8354
冰角
Aker
cxhcxh
rick
天外来客
hellow
Intelfan
sunsjw
EricAzhe
sixL
bootdisk
heretic
swqswq
RuShi
testttt
archy
girl
colboy
niuhacker
ngoksun
KSA
davidfoxhu
btflying
峰回路转
crackodin
ppanger
gatt
Bughoho
chuxue
jzhr
ZhengXin
icezy
十指紧扣
rocketming
enolaZ
xihuanxue
muyi
aleon
阳小子
JIN
PASCUALE
zzage
FlowerCode
luorq
SongLei
ruffy
santuri
克隆人
coolwxd
方向感
newsark
temptemp
robar
asuralove
mapleABCDD
IronWill
loien
Fuzzier
学习好难
xiejienet
kirby
ghostyp
avbcad
神经网络
marshalx
赞赏
雪币:
留言: