I have a 32bit application and a few wrapper tools that I use one after another to inject code, hook system dll functions (using the patch-first-bytes-of-the-function-with-jump approach). Also I have a tool that injects code into the application process and starts new thread. My problem is that sometimes I'm getting an exception. The application is 32bit so I'm using 32bit debugger. From what I can see the exception comes from memory region that is supposed to be wow64.dll. Wow64.dll has some 64bit code. Due to this I have problems debugging the reason for this exception. My questions are:
When exception is thrown from wow64.dll 64bit code, can I depend on the exception info reported by 32bit debugger or the fields will contain wrong values (is there a difference between 64bit exception struct and 32bit one)?
Is there any reliable way of debugging pieces of 64bit code inside 32bit processes?