This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch/rebase] Make rebase 64 bit capable (was Re: [patch/rebase] Make imagehelper 64-bit capable)


On 7/7/2011 3:43 PM, Corinna Vinschen wrote:
> However, since it only know a single base address, it will use that
> address for 32 and 64 bit images, mixing them.  That doesn't make
> much sense, but for now I was only interested in the basic capability
> to rebase both types of DLLs.

That seems a reasonable approach.

> I revoke my rebase database patch for now.  My local version works with
> 32 and 64 bit DLLs, too, but it suffers from the same problem as the
> base functionality.

:-(

> I'll rework my patch to do the right thing(TM) for 32 and 64 bit DLLs.
> I'm not sure yet about the command line options.  Maybe we use -b for
> the 32 bit base address and -B for the 64 bit base address?

That seems logical.

Alternatively, we could have rebase operate in "modes":
  -w (wide?) operates exclusively on 64bit images, ignoring all others
(and use the 64bit db file with its distinct 4byte magic).

otherwise, operate exclusively on 32bit images (and use the 32bit db
file...)

Meh.  Probably it is less confusing to the user, to work on all
specified dlls regardless of bitness, and not "ignore" any.  Just means
extra book-keeping inside rebase itself.

> Btw., peflags does not build on 64 bit mingw either, yet.

Yeah, well...I'll let you implement all the hard stuff for rebase first,
then I (or anyone else, if I'm AFK...) can copy your working and vetted
implementation over to peflags. <g>

> 	* rebase.c: Convert all base address variables to ULONG64
> 	throughout.
> 	(main): On Cygwin, call GetImageInfos64 to get Cygwin DLLs
> 	data.
> 	(print_image_info): Use conditional printf format string.
> 	(rebase): Call ReBaseImage64.  Use conditional printf format string.
> 	(parse_args): Call string_to_ulonglong.
> 	(string_to_ulonglong): Rename from string_to_ulong, call
> 	strtoull, and return unsigned long long.

Looks fine to me.

--
Chuck


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]