首页
社区
课程
招聘
[求助]如何修改DLL里的代码?
发表于: 2007-10-9 19:09 7792

[求助]如何修改DLL里的代码?

2007-10-9 19:09
7792
DLL每次加载后地址都会变。如何才能找到某个DLL模块的地址

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 257
活跃值: (56)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
2
同样期待:
希望有找某模块首地址的代码
2007-10-10 12:57
0
雪    币: 256
活跃值: (673)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
3
The GetModuleHandle function retrieves a module handle for the specified module if the file has been mapped into the address space of the calling process.

HMODULE GetModuleHandle(
  LPCTSTR lpModuleName   // module name
);

Parameters
lpModuleName
[in] Pointer to a null-terminated string that contains the name of the module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended. The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address space of the calling process.
If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process.

Return Values
If the function succeeds, the return value is a handle to the specified module.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

一段VC++示例:

        HMODULE hint=::GetModuleHandle("Dll.dll");  //需要查找的.dll或.exe
        if (hint==NULL)
        {
                AfxMessageBox("没找到");
        }
        else
        {
                CString str;
                str.Format("%x",hint);
                str="Dll.dll的基址是: "+str;
                AfxMessageBox(str);
        }

说明一点,dll里的代码你愿意怎么改就怎么改,不过你的内容是找首地址,跟修改无关.
2007-10-10 13:07
0
雪    币: 148
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
我来学习一下楼上的谢谢
2007-10-10 13:39
0
游客
登录 | 注册 方可回帖
返回
//