|
[原创]Hook Api lib 0.5 - 2008.04.16更新
[QUOTE=海风月影;441989]/* ////////////////////////////////////////////////////////////////////////// HookApi 0.5 thanks to xIkUg ,sucsor by 海风月影[RCT] , eIcn#live.cn ...[/QUOTE] 光顾欣喜的看代码了,呵呵,看来你这个信箱也是你的MSN咯? |
|
[原创]Hook Api lib 0.5 - 2008.04.16更新
再次感谢你的努力和奉献,我这几天抽时间鼓捣一下,一旦有成果,首先给你发一份,并且在首要位置注明是采用你的APIHOOK代码,呵呵,可否留个EMail??我的caocunt@163.com. |
|
[原创]Hook Api lib 0.5 - 2008.04.16更新
给点思路,我英文不好,我计划用你代码写一个下面的工具~~ |
|
[原创]Hook Api lib 0.5 - 2008.04.16更新
你可以在自己的My_DevideIoControl里面判断返回地址是不是在某个模块中,然后记录下需要记录的参数 原来DWORD RetAddr这个参数是起这个作用的,呵呵,楼主真有心!!!学习了不少,今天收获很大很大,解决了我长久以来的一些疑问. 但是问题又来了,exe的基址一般都是0x400000,,这样是没有办法区别的,对吧? 我觉得应该在HOOKPROC函数里面首先GetModuleFileName获取此刻调用此HOOK的API的名称比较合适,楼主觉得如何? |
|
[原创]Hook Api lib 0.5 - 2008.04.16更新
非常感谢楼主的解答!!! 呵呵,由于本人是初学编程,所以对你说说的"DLL全局注入"的意思不太明白,能否解答一二? 你的这些代码可以归纳为两个接口,-----HOoK和UnHook-------,可是全局注入我真不懂, ★★注意: 1的解释我明白,就是如果不自己主动调用原来的函数执行的话,就相当于拦截原来的API调用了. 2就有点不明白了,看你的例子,我编译以后用OD跟踪跑了一遍,也没有发现什么错误啊?为什么你特别强调这点呢? 我自己看明白了,以为是在HookProc中UnHook以后就不能再次UnHook呢,原来是不能用第二个参数来调用原来的API,那当然了,你UnHook了以后那块地址就无效了吧?呵呵 |
|
[原创]Hook Api lib 0.5 - 2008.04.16更新
4.楼主你的卸载函数是不是有点问题? BOOL __stdcall UnInstallHookApi(PHOOKENVIRONMENT pHookEnv) { DWORD oldpro; DWORD RetSize; //如果内存不存在了,则退出 if(IsBadReadPtr((const void*)pHookEnv,sizeof(HOOKENVIRONMENT))) return FALSE; if(!VirtualProtect(pHookEnv->OrgApiAddr,pHookEnv->SizeOfReplaceCode,PAGE_EXECUTE_READWRITE,&oldpro)) return FALSE; WriteProcessMemory(GetCurrentProcess(),pHookEnv->OrgApiAddr,pHookEnv->savebytes,pHookEnv->SizeOfReplaceCode,&RetSize); if(!VirtualProtect(pHookEnv->OrgApiAddr,pHookEnv->SizeOfReplaceCode,oldpro,&oldpro)) return FALSE; VirtualFree((LPVOID)pHookEnv,0,MEM_RELEASE); return TRUE;//少了这句了吧? } 5.如何用你的这些代码去log一个程序(譬如这个程序包括a.exe和b.dll)中的DeviceIOContorl的调用?能举个例子吗? |
|
[原创]Hook Api lib 0.5 - 2008.04.16更新
感谢楼主的改进,请问以下几个问题. 1.也就是说现在可以针对同一个函数在调用前后HOOK了? 那以前的SetOnBefore和SetOnAfter是不是还同时保留? 譬如下面的代码: int main() { if(!SetOnBefore("Kernel3.dll","DeviceIoControl",DeviceIoControl_Before)) ::MessageBox(0,"Before","error",0);; if(!SetOnAfter("Kernel32.dll","DeviceIoControl",DeviceIoControl_After)) ::MessageBox(0,"After","error",0); DeviceIoControl(0,0,0,0,0,0,0,0); return 0; } 现在是不是只需要pHookEnv = InstallHookApi("Kernel32.dll", "DeviceIoControl", My_LoadLibraryA);就可以了? 2.HOOK的函数只对本exe的进程空间有效??? 3.压缩包里提供的hooklib.lib文件是干什么的?如何使用? |
|
[原创]中国第一代程序员的呕血力作
看到这些东西就反感,仿佛原子弹就是靠易经,道德经之类的才发明出来的. |
|
|
|
[原创]UPXpro4.50发布
来路不明的不敢用,等小白检查病毒 |
|
分享][天草VS黑鹰]动画教程-(迅雷)下载终极贴-更新已完成![申请加精]
版主还是锁了此贴吧,还加精呢~ |
|
[推荐]推一个开源的sniffer---wireshark
1.0出来了?更新搜藏一个~ |
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值