[x64] inject into different-architecture child: x64 to WOW64, WOW64 to x64
From bruen...@google.com on June 12, 2012 09:52:13
this was PR 254193
xref issue #20 (closed) : handle execve of different-architecture child: 32 to 64, 64 to 32 xref issue #147 (closed) /PR 408318: client interactions with cross-arch execve
xref PR 240257: support 32-bit clients on WOW64? how mix 32 and 64 bit code? xref issue #49 /PR 253431 xref issue #381 /PR 215423 (xref PR 249112: [x64] inject into child process) (xref issue #142 (closed) /PR 251677: [x64] early inject into child process)
old notes which may not all apply:
For deciding which DR to inject, probably should just have 64-bit config take precedence: if 32-bit config is also present, too bad, it gets ignored.
For the child-doesn't-equal parent cases we'll have to have the other architecture's bootstrap code to inject into the child (or for 64-to-32 fool the loader into loading the 32-bit lib if go early and run 64-bit bootstrap code): will require a cross-compiled asm routine, or gencode, for inject-into-thread.
Perhaps worth reconsidering what we really want to bother to support here (PR 240257).
One plan is to never support 32-bit DR following into 64-bit child. Long-term we'll only support 64-bit-DR in WOW64 following children (PR 253431). Only when a client hasn't been ported will we support 32-bit DR in a WOW64 process, So if dr64 is in a process that launches a wow64 child foo.exe where foo.exe has only a wow64 config, our stance is that we won't inject into the child (since we don't bother to support cross-arch child injection) and you'll have to rely on AppInit.
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=803