What's the replacement for REBASE.EXE?

♀尐吖头ヾ 提交于 2019-11-29 04:02:20

editbin.exe comes with VS2010 and has a /REBASE option.

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>editbin
Microsoft (R) COFF/PE Editor Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: EDITBIN [options] [files]

   options:

      /ALLOWBIND[:NO]
      /ALLOWISOLATION[:NO]
      /BIND[:PATH=path]
      /DYNAMICBASE[:NO]
      /ERRORREPORT:{NONE|PROMPT|QUEUE|SEND}
      /HEAP:reserve[,commit]
      /LARGEADDRESSAWARE[:NO]
      /NOLOGO
      /NXCOMPAT[:NO]
      /REBASE[:[BASE=address][,BASEFILE][,DOWN]]
      /RELEASE
      /SECTION:name[=newname][,[[!]{CDEIKOMPRSUW}][A{1248PTSX}]]
      /STACK:reserve[,commit]
      /SUBSYSTEM:{BOOT_APPLICATION|CONSOLE|EFI_APPLICATION|
                  EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|
                  NATIVE|POSIX|WINDOWS|WINDOWSCE}[,#[.##]]
      /SWAPRUN:{[!]CD|[!]NET}
      /TSAWARE[:NO]
      /VERSION:#[.#]

And as Mark points out you'll want to turn off ASLR, which you can do by using /DYNAMICBASE:no

The reason Rebase.exe is deprecated is that it's not as useful as it used to be. Starting with Windows Vista, Microsoft implemented Address Space Layout Randomization which moves the system DLLs around every time you load them, and optionally the user DLLs as well.

If you're counting on rebasing to generate a large contiguous address space, you're going to be disappointed.

Alan

Not to mention the use of "REBASE.EXE -b 0x58000000 -e 0x10000 -c coffbase.txt *.dll" against a set of files, simply to generate the COFFBASE file.
In other words not because you intend to actually rebase your files now, but because you want an accurate COFFBASE.TXT,
so that they will /already/ be built with a specific and non-conflicting base address every time they are built.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!