The processes are all 32-bit (on a 64-bit computer though). The DLL architecture change has changed in Windows 7 and then changed more in Windows 8. Here is some information on it:
On an older version of TUP (before hot-patching) I tried hooking CreateProcess on KernelBase, and I think that sometimes worked, but then would get double hooked when a program went through a different channel (like advapi32 or kenel32). I don't totally understand it right now, and I've only gotten the DLL to be debuggable in Windows, not the rest of TUP.
The stack from Process Monitor for a process (LCC.exe) that is being created and the DLL is injected correctly looks like this (Note, the injection isn't because of a hook but because TUP is directly creating the process):
0 fltmgr.sys fltmgr.sys + 0x1844 0xfffff8800174c844 C:\Windows\system32\drivers\fltmgr.sys
1 fltmgr.sys FltIsCallbackDataDirty + 0x9ec 0xfffff8800174da6c C:\Windows\system32\drivers\fltmgr.sys
2 fltmgr.sys fltmgr.sys + 0x12e9 0xfffff8800174c2e9 C:\Windows\system32\drivers\fltmgr.sys
3 fltmgr.sys fltmgr.sys + 0x109e 0xfffff8800174c09e C:\Windows\system32\drivers\fltmgr.sys
4 ntoskrnl.exe IopGetSetSecurityObject + 0x185 0xfffff8031d3fe225 C:\Windows\system32\ntoskrnl.exe
5 ntoskrnl.exe ObpGetObjectSecurity + 0x161 0xfffff8031d47b391 C:\Windows\system32\ntoskrnl.exe
6 ntoskrnl.exe ObCheckObjectAccess + 0x49 0xfffff8031d47bb69 C:\Windows\system32\ntoskrnl.exe
7 ntoskrnl.exe ObpCreateHandle + 0x58d 0xfffff8031d45c27d C:\Windows\system32\ntoskrnl.exe
8 ntoskrnl.exe ObOpenObjectByPointer + 0x1e5 0xfffff8031d43f0c5 C:\Windows\system32\ntoskrnl.exe
9 ntoskrnl.exe AhcValidateAndGetParameters + 0x12e 0xfffff8031d42a016 C:\Windows\system32\ntoskrnl.exe
10 ntoskrnl.exe NtApphelpCacheControl + 0x166 0xfffff8031d4895dd C:\Windows\system32\ntoskrnl.exe
11 ntoskrnl.exe KiSystemServiceCopyEnd + 0x13 0xfffff8031d08d053 C:\Windows\system32\ntoskrnl.exe
12 ntdll.dll NtApphelpCacheControl + 0xa 0x7fdd931306a C:\Windows\System32\ntdll.dll
13 wow64.dll whNtApphelpCacheControl + 0x2d8 0x7713b000 C:\Windows\System32\wow64.dll
14 wow64.dll Wow64SystemServiceEx + 0xd7 0x7712c363 C:\Windows\System32\wow64.dll
15 wow64cpu.dll ServiceNoTurbo + 0xb 0x771125a7 C:\Windows\System32\wow64cpu.dll
16 wow64.dll RunCpuSimulation + 0xa 0x7712c4f6 C:\Windows\System32\wow64.dll
17 wow64.dll Wow64LdrpInitialize + 0x435 0x7712b8f5 C:\Windows\System32\wow64.dll
18 ntdll.dll _LdrpInitialize + 0xde 0x7fdd938d6af C:\Windows\System32\ntdll.dll
19 ntdll.dll LdrInitializeThunk + 0xe 0x7fdd932c1ae C:\Windows\System32\ntdll.dll
20 ntdll.dll NtApphelpCacheControl + 0xc 0x771b1228 C:\Windows\SysWOW64\ntdll.dll
21 kernel32.dll BaseCheckDetectionMethods + 0x143 0x748fa99d C:\Windows\SysWOW64\kernel32.dll
22 kernel32.dll BaseCheckElevation + 0x8b 0x748fa712 C:\Windows\SysWOW64\kernel32.dll
23 KernelBase.dll CreateProcessInternalW + 0x1e50 0x770411ef C:\Windows\SysWOW64\KernelBase.dll
24 KernelBase.dll CreateProcessInternalA + 0x2bf 0x7708db89 C:\Windows\SysWOW64\KernelBase.dll
25 KernelBase.dll CreateProcessA + 0x2c 0x7708dc95 C:\Windows\SysWOW64\KernelBase.dll
26 tup.exe tup.exe + 0x217e9 0x4217e9 C:\dev\Learning\lcc\build\tup\tup.exe
27 tup.exe tup.exe + 0x1da5b 0x41da5b C:\dev\Learning\lcc\build\tup\tup.exe
28 tup.exe tup.exe + 0x754c6 0x4754c6 C:\dev\Learning\lcc\build\tup\tup.exe
29 kernel32.dll BaseThreadInitThunk + 0xe 0x74908543 C:\Windows\SysWOW64\kernel32.dll
30 ntdll.dll __RtlUserThreadStart + 0x72 0x771cac69 C:\Windows\SysWOW64\ntdll.dll
31 ntdll.dll _RtlUserThreadStart + 0x1b 0x771cac3c C:\Windows\SysWOW64\ntdll.dll
The stack from a process (RCC.exe, when created from the above created process, LCC.exe) that is being created but not hooking correctly looks like this (tup-dllinject.dll is a listed module in LCC.exe, so it was injected):
0 fltmgr.sys FltpPerformPreCallbacks + 0x324 0xfffff8800174c844 C:\Windows\system32\drivers\fltmgr.sys
1 fltmgr.sys FltpPassThroughInternal + 0x8c 0xfffff8800174da6c C:\Windows\system32\drivers\fltmgr.sys
2 fltmgr.sys FltpCreate + 0x339 0xfffff88001778349 C:\Windows\system32\drivers\fltmgr.sys
3 ntoskrnl.exe IopParseDevice + 0x77b 0xfffff8031d45e05b C:\Windows\system32\ntoskrnl.exe
4 ntoskrnl.exe ObpLookupObjectName + 0x7a1 0xfffff8031d45ac5d C:\Windows\system32\ntoskrnl.exe
5 ntoskrnl.exe ObOpenObjectByName + 0x258 0xfffff8031d4602b8 C:\Windows\system32\ntoskrnl.exe
6 ntoskrnl.exe IopCreateFile + 0x37c 0xfffff8031d471ebe C:\Windows\system32\ntoskrnl.exe
7 ntoskrnl.exe NtOpenFile + 0x58 0xfffff8031d44821c C:\Windows\system32\ntoskrnl.exe
8 ntoskrnl.exe KiSystemServiceCopyEnd + 0x13 0xfffff8031d08d053 C:\Windows\system32\ntoskrnl.exe
9 ntoskrnl.exe KiServiceLinkage 0xfffff8031d092230 C:\Windows\system32\ntoskrnl.exe
10 ntoskrnl.exe NtCreateUserProcess + 0x364 0xfffff8031d42fcc4 C:\Windows\system32\ntoskrnl.exe
11 ntoskrnl.exe KiSystemServiceCopyEnd + 0x13 0xfffff8031d08d053 C:\Windows\system32\ntoskrnl.exe
12 ntdll.dll NtCreateUserProcess + 0xa 0x7fdd931371b C:\Windows\System32\ntdll.dll
13 wow64.dll Wow64NtCreateUserProcess + 0x13a 0x7712ae0a C:\Windows\System32\wow64.dll
14 wow64.dll whNtCreateUserProcess + 0x799 0x77141a91 C:\Windows\System32\wow64.dll
15 wow64.dll Wow64SystemServiceEx + 0xd7 0x7712c363 C:\Windows\System32\wow64.dll
16 wow64cpu.dll ServiceNoTurbo + 0xb 0x771125a7 C:\Windows\System32\wow64cpu.dll
17 wow64.dll RunCpuSimulation + 0xa 0x7712c4f6 C:\Windows\System32\wow64.dll
18 wow64.dll Wow64LdrpInitialize + 0x435 0x7712b8f5 C:\Windows\System32\wow64.dll
19 ntdll.dll LdrpInitializeProcess + 0x1521 0x7fdd93651a7 C:\Windows\System32\ntdll.dll
20 ntdll.dll _LdrpInitialize + 0x1565e 0x7fdd9341826 C:\Windows\System32\ntdll.dll
21 ntdll.dll LdrInitializeThunk + 0xe 0x7fdd932c1ae C:\Windows\System32\ntdll.dll
22 ntdll.dll NtCreateUserProcess + 0xc 0x771b18d8 C:\Windows\SysWOW64\ntdll.dll
23 KernelBase.dll CreateProcessInternalW + 0x116d 0x77040d17 C:\Windows\SysWOW64\KernelBase.dll
24 KernelBase.dll CreateProcessInternalA + 0x2bf 0x7708db89 C:\Windows\SysWOW64\KernelBase.dll
25 KernelBase.dll CreateProcessA + 0x2c 0x7708dc95 C:\Windows\SysWOW64\KernelBase.dll
26 msvcrt.dll _dospawn + 0x1a1 0x76224d99 C:\Windows\SysWOW64\msvcrt.dll
27 msvcrt.dll _spawnve + 0x28d 0x76223c84 C:\Windows\SysWOW64\msvcrt.dll
28 msvcrt.dll _spawnve + 0x126 0x76223b1d C:\Windows\SysWOW64\msvcrt.dll
29 msvcrt.dll _spawnvpe + 0x82 0x76223d44 C:\Windows\SysWOW64\msvcrt.dll
30 msvcrt.dll _spawnvp + 0x15 0x76223cb8 C:\Windows\SysWOW64\msvcrt.dll
31 lcc.exe lcc.exe + 0x1ea1 0x401ea1 C:\dev\Learning\lcc\build\mingw\lcc.exe
32 lcc.exe lcc.exe + 0x1fd8 0x401fd8 C:\dev\Learning\lcc\build\mingw\lcc.exe
33 lcc.exe lcc.exe + 0x2633 0x402633 C:\dev\Learning\lcc\build\mingw\lcc.exe
34 lcc.exe lcc.exe + 0x25dd 0x4025dd C:\dev\Learning\lcc\build\mingw\lcc.exe
35 lcc.exe lcc.exe + 0x19df 0x4019df C:\dev\Learning\lcc\build\mingw\lcc.exe
36 lcc.exe lcc.exe + 0x10b9 0x4010b9 C:\dev\Learning\lcc\build\mingw\lcc.exe
37 lcc.exe lcc.exe + 0x1284 0x401284 C:\dev\Learning\lcc\build\mingw\lcc.exe
38 kernel32.dll BaseThreadInitThunk + 0xe 0x74908543 C:\Windows\SysWOW64\kernel32.dll
39 ntdll.dll __RtlUserThreadStart + 0x72 0x771cac69 C:\Windows\SysWOW64\ntdll.dll
40 ntdll.dll _RtlUserThreadStart + 0x1b 0x771cac3c C:\Windows\SysWOW64\ntdll.dll
Nathan Brown