假设我有3个模块,一个user.exe,另外两个是A.dll,B.dll。
在编译链接各个模块时,我利用VS默认的base address,这样user.exe的默认基地址是0x00400000h,A或B的基地址是0x10000000h。这样,当加载器加载User.exe(它同时隐式链接A,B)。这样,A,B就会有一个被迫改变默认的基地址;从而导致映像文件里的机器代码指令(包含的硬编码地址)与加载后的不一样,从而需要调整(效率就会降低)。
我知道在vs中编译链接的时候可以利用 set baseaddress 修改。但是,假设我的可执行模块需要更多的dll时,我就希望利用工具(rebase)来修改。不过不会用!
请各位大虾帮忙!谢谢。
ps:M i c r o s o f t在销售Wi n d o w s操作系统之前,在操作系统提供的所有文件上运行了R e b a s e程序,因此,如果将它们映射到单个地址空间中,所有的操作系统模块都不会重叠。
在编译链接各个模块时,我利用VS默认的base address,这样user.exe的默认基地址是0x00400000h,A或B的基地址是0x10000000h。这样,当加载器加载User.exe(它同时隐式链接A,B)。这样,A,B就会有一个被迫改变默认的基地址;从而导致映像文件里的机器代码指令(包含的硬编码地址)与加载后的不一样,从而需要调整(效率就会降低)。
我知道在vs中编译链接的时候可以利用 set baseaddress 修改。但是,假设我的可执行模块需要更多的dll时,我就希望利用工具(rebase)来修改。不过不会用!
请各位大虾帮忙!谢谢。
ps:M i c r o s o f t在销售Wi n d o w s操作系统之前,在操作系统提供的所有文件上运行了R e b a s e程序,因此,如果将它们映射到单个地址空间中,所有的操作系统模块都不会重叠。
解决方案 »
- 怎样把WebBrowser控件中网页中的验证码图片显示在弹出的对话框中?
- VS2005中的VC头文件里怎么没有#ifndef CXXXXXX_H_938579384798739873495873495
- vc做数据库时如何显示数据集?
- 将十进制数据转换为十六进制?
- DateTimePicker控件输入小于1970-01-01后UpdateData()出错!
- 怪事!ATL(或者说DLL)不支持CDHTMLDialog?
- MSDN Library 的 Visual Studio .NET 2003 版,让人好郁闷!
- 送分题--------------------------------------!!!!!!!!!!!!!
- 多线程的问题(在线等待)
- VS2010下配置opencv,程序运行出现错误
- 'CLCDDlg' : missing storage-class or type specifiers 求救!!!! 谢谢
- VC下ListBox.Addstring如何可以即时更新?
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin>rebase
usage: REBASE [switches]
[-R image-root [-G filename] [-O filename] [-N filename]]
image-names... One of -b and -i switches are mandatory. [-a] Does nothing
[-b InitialBase] specify initial base address
[-c coffbase_filename] generate coffbase.txt
-C includes filename extensions, -c does not
[-d] top down rebase
[-e SizeAdjustment] specify extra size to allow for image growth
[-f] Strip relocs after rebasing the image
[-i coffbase_filename] get base addresses from coffbase_filename
[-l logFilePath] write image bases to log file.
[-p] Does nothing
[-q] minimal output
[-s] just sum image range
[-u symbol_dir] Update debug info in .DBG along this path
[-v] verbose output
[-x symbol_dir] Same as -u
[-z] allow system file rebasing
[-?] display this message [-R image_root] set image root for use by -G, -O, -N
[-G filename] group images together in address space
[-O filename] overlay images in address space
[-N filename] leave images at their origional address
-G, -O, -N, may occur multiple times. File "filename"
contains a list of files (relative to "image-root") 'image-names' can be either a file (foo.dll) or files (*.dll)
or a file that lists other files (@files.txt).
If you want to rebase to a fixed address (ala QFE)
use the @@files.txt format where files.txt contains
address/size combos in addition to the filename
参考
Using the Rebase utility in project makefileOptimizing DLL Loads
Rebasing Win32 DLLs: The Whole Story
您能把我的例子用Rebase命令写出来吗?
比如
C:\***>rebase -d A.dll B.dll大体是这样吗?或者正确的怎么个格式啊?
Thanks