Function at 0x409870
Capabilities:
Create process on windows
Get common file path

Disassembly:
sub esp, 0x69c
mov eax, dword [0x42e070]
xor eax, esp
mov dword [esp + 0x694], eax
push ebx
push ebp
push esi
push edi
xor edi, edi
push 0x44
lea eax, [esp + 0x44]
mov esi, ecx
push edi
push eax
mov dword [esp + 0x38], esi
mov dword [esp + 0x28], edi
call fcn.00410d60
add esp, 0xc
xor eax, eax
xor ecx, ecx
push esi
push str.Launching_under_User___s_
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], 0x44
mov word [esp + 0x7a], cx
mov dword [esp + 0x74], 1
mov dword [esp + 0x50], edi
mov dword [esp + 0x4c], edi
mov dword [esp + 0x7c], edi
mov dword [esp + 0x54], edi
mov dword [esp + 0x58], edi
mov dword [esp + 0x5c], edi
mov dword [esp + 0x70], edi
call fcn.00404e10
add esp, 8
call fcn.00409bf0
mov ebp, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push str.kernel32.dll
mov dword [esp + 0x18], edi
call ebp
mov esi, eax
cmp esi, edi
jne 0x409927
push str.kernel32.dll_Load_Library_Error...
call fcn.00404e10
add esp, 4
xor eax, eax
jmp 0x409b96
push str.WTSGetActiveConsoleSessionId
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
call eax
mov ebx, eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x4a0]
push str.Error__d__d
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push esi
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
call esi
cmp dword [0x430950], edi
je 0x4099c7
push str.64_Bit_OS
call fcn.00404e10
add esp, 4
push 0x104
lea eax, [esp + 0x8c]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea ecx, [esp + 0x88]
push ecx
lea edx, [esp + 0x294]
push 0x104
push edx
call fcn.0040ee2f
add esp, 0xc
push str._syswow64wtsapi32.dll
lea eax, [esp + 0x294]
push 0x104
push eax
call fcn.0040ec9c
add esp, 0xc
lea ecx, [esp + 0x290]
push ecx
jmp 0x4099cc
push str.wtsapi32.dll
call ebp
mov dword [0x430e24], eax
cmp eax, edi
je 0x409b85
push str.WTSQueryUserToken
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x430e28], eax
cmp eax, edi
je 0x409b67
lea edx, [esp + 0x14]
push edx
push ebx
call eax
test eax, eax
jne 0x409ae8
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebp
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x28]
push ecx
push 1
push edi
push edi
call sub.WTSAPI32.dll_WTSEnumerateSessionsW
mov ecx, dword [esp + 0x28]
mov eax, dword [esp + 0x24]
cmp ecx, edi
jbe 0x409a3f
jmp 0x409a30
cmp dword [eax + 8], edi
jne 0x409a37
mov ebx, dword [eax]
add eax, 0xc
sub ecx, 1
jne 0x409a30
lea edx, [esp + 0x14]
push edx
push ebx
call dword [0x430e28]
test eax, eax
jne 0x409a7d
push ebx
call ebp
push eax
lea eax, [esp + 0x90]
push str.WTSQueryUserToken_Error__d__d
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
lea ecx, [esp + 0x98]
push ecx
call fcn.00404e10
add esp, 0x14
xor eax, eax
jmp 0x409b96
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x18]
push edx
push 1
push 1
push edi
push 0x2000000
push eax
mov dword [esp + 0x30], edi
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x409ab3
push str.DuplicateTokenEx_FAILED_2
call fcn.00404e10
add esp, 4
xor eax, eax
jmp 0x409b96
mov ecx, dword [esp + 0x18]
push edi
push ecx
lea edx, [esp + 0x28]
push edx
mov dword [esp + 0x2c], edi
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
jne 0x409ae0
push str.CreateEnvironmentBlock_FAILED_3
call fcn.00404e10
add esp, 4
xor eax, eax
jmp 0x409b96
mov eax, dword [esp + 0x18]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x2c]
lea ecx, [esp + 0x30]
push ecx
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x44]
push edx
push edi
push edi
push 0x30
push edi
push edi
push edi
push eax
push edi
push ecx
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x409b42
mov edx, dword [esp + 0x34]
push edx
call ebx
mov eax, dword [esp + 0x30]
push eax
call ebx
mov ecx, dword [esp + 0x14]
push ecx
mov dword [esp + 0x20], 1
call ebx
mov edx, dword [0x430e24]
push edx
call esi
mov dword [0x430e24], edi
jmp 0x409b92
push str.CreateProcessAsUser_Failed
call fcn.00404e10
mov ecx, dword [esp + 0x18]
add esp, 4
push ecx
call ebx
mov edx, dword [0x430e24]
push edx
call esi
mov dword [0x430e24], edi
jmp 0x409b92
push str.GetProcAddress_Failed_for_WTSQueryUserToken
call fcn.00404e10
mov edx, dword [0x430e24]
add esp, 4
push edx
call esi
mov dword [0x430e24], edi
jmp 0x409b92
push str.Failed_to_LoadLibrary_wtsapi32.dll
call fcn.00404e10
add esp, 4
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x6a4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040e6d9
add esp, 0x69c
ret