Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any tools available for packing 32bit/64bit executables together? [closed]

I really like the way the SysInternals utilities (e.g. Process Explorer) handle 64bit compatibility. It looks like the 32bit executable has the 64bit version embedded in it, and extracts it if necessary.

I'd like a tool which automates this - i.e. takes 32bit and 64bit executables, packs them together somehow, and inserts stub code to launch the right executable according to which platform its gets run on.

Before I start to roll my own, does anyone know of something like this which already exists?

like image 838
snowcrash09 Avatar asked Jul 23 '09 09:07

snowcrash09


3 Answers

This appears to have been covered already (although it's quite shallow on detail) within...

Roll 64-bit and 32-bit versions of an app into the same binary?

like image 158
John Parker Avatar answered Sep 29 '22 08:09

John Parker


Mark Russinovich of SysInternals fame describes their method here. They do embed an x64 image in an x86 image. Unfortunately above blog post doesn't actually go into too much detail but mentions that their technique is based on a much older article found here.

like image 24
ilmcuts Avatar answered Sep 29 '22 09:09

ilmcuts


Not a tool, but it seems fairly easy to embed your executables in a VC++ project as resources, and run the correct one after checking the OS environment.

Use the IsWow64Process function to detect 32 or 64 bit, and here is a nice writeup including source code on how to embed the executables: http://www.codeproject.com/KB/winsdk/binaryresources.aspx .

like image 42
Zed Avatar answered Sep 29 '22 08:09

Zed