已经保存跳转地址 到 PROC * paorigfuncs
paorigfuncs = (PROC *)prealthunk->u1.Function;
应该怎么做呢?
另外如果用这种方法能截获与SOCKET相关的函数调用吗?如果能,思路又是什么呢?
paorigfuncs = (PROC *)prealthunk->u1.Function;
应该怎么做呢?
另外如果用这种方法能截获与SOCKET相关的函数调用吗?如果能,思路又是什么呢?
解决方案 »
- 如何获得对话框程序的菜单的句柄
- Attach与SubclassWindow的区别 大虾们看看
- vc中 如何将float数据类型转成_variant_t?
- 使用adLockBatchOptimistic锁修改access记录的问题
- 怎么才能让CListView列表视图不自动排列
- 如何在对话框的某个位置创建位图?请进
- 给分:在windows下有哪些比较好的opengl的开发工具包可以使用?
- 这种打开保存怎么做,如下图
- 处理哪一个消息?????
- 深圳的朋友请帮忙!!!
- 嵌入式对话框如何加入菜单?
- up有分!★关于《网络编程〉中的问题★:如何设计udp/ip的完成端口模式,udp协议不需要accept....
它是一个函数,然后传入你要查的module、函数名和你要替换的函数名~
---------------------------------
注册表学习器 For Windows9x\me\2000\XP
我是CSDN的Windows9x\me的斑竹。平时在论坛里经常看到有人问一些各式各样的关于注册表方面的问题。我经常建议他(她)们使用各种工具软件,但是很多人想要手动修改,但是不知道怎么改。所以我搜集了一些资料,作了这个软件。希望它能对这些想学习注册表的朋友有帮助!1、本程序包含注册表操作方面的绝大部分。如系统性能优化、网络优化、各类菜单等等。
2、本程序支持注册表定位。请选择键值菜单下一个应用条目,然后双击之,或者单击菜单栏上的定位,便可到达相应位置。
3、本程序支持窗体最前端。可以将窗体置前,以不影响后面对其它程序如注册表等的操作。
4、本程序可以调用一些常用的系统应用程序。见工具菜单。
5、本程序的注册表应用可能不够准确和详细。我会尽量在下一个版本进行添加并检查改进。
---------------------------------
下载地址:http://www.csdn.net/cnshare/soft/12/12531.shtm
参数和返回值都和标准connect相同
然后
你在你的MyConnect函数里return paorigfuncs(..........);
就行了
paorigfuncs是你用GetProcAddress得到的原函数地址
error C2197: 'int (__stdcall *)(void)' : too many actual parameters
你在你的MyConnect函数里return paorigfuncs(..........);
这里的paorigfuncs是你用GetProcAddress得到的原函数地址
可我不是用GetProcAddress得到paorigfuncs的啊!
PROC pfnNew,HMODULE hmodCaller)
{
// Get the address of the module's import section
ULONG ulSize;
PIMAGE_IMPORT_DESCRIPTOR pImportDesc=(PIMAGE_IMPORT_DESCRIPTOR)ImageDirectoryEntryToData(hmodCaller,
TRUE,IMAGE_DIRECTORY_ENTRY_IMPORT,&ulSize);
if (pImportDesc == NULL) //判断是否有输入节
return; // This module has no import section
// Find the import descriptor containing references to callee's functions
for (; pImportDesc->Name; pImportDesc++)
{
PSTR pszModName = (PSTR) ((PBYTE) hmodCaller + pImportDesc->Name);
if(lstrcmpiA(pszModName,pszCalleeModName)==0)//寻找dll,pszModName:hmodCaller导出的dll
break; // Found
}
if (pImportDesc->Name == 0)
return; // This module doesn't import any functions from this callee
// Get caller's import address table (IAT) for the callee's functions
PIMAGE_THUNK_DATA pThunk = (PIMAGE_THUNK_DATA)
((PBYTE) hmodCaller + pImportDesc->FirstThunk);
// Replace current function address with new function address
for (; pThunk->u1.Function; pThunk++) //寻找函数
{
// Get the address of the function address
PROC* ppfn = (PROC*) &pThunk->u1.Function;
// Is this the function we're looking for?
BOOL fFound = (*ppfn == pfnCurrent); //ppfn:得到的函数
if (!fFound && (*ppfn > sm_pvMaxAppAddr))
{
// If this is not the function and the address is in a shared DLL,
// then maybe we're running under a debugger on Windows 98. In this
// case, this address points to an instruction that may have the
// correct address.
PBYTE pbInFunc = (PBYTE) *ppfn;
if (pbInFunc[0] == cPushOpCode)
{
// We see the PUSH instruction, the real function address follows
ppfn = (PROC*) &pbInFunc[1];
// Is this the function we're looking for?
fFound = (*ppfn == pfnCurrent);
}
}
if (fFound)
{
// The addresses match, change the import section address
WriteProcessMemory(GetCurrentProcess(), ppfn, &pfnNew,
sizeof(pfnNew), NULL);
return; // We did it, get out
}
}
// If we get to here, the function is not in the caller's import section
}
我那样做是可以的