Function at 0x40bd50
Capabilities:
Create process on windows
Impersonate user

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa8
mov eax, dword [0x433610]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0x20]
push ebx
mov ebx, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 0x10]
push edi
mov edi, ecx
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x78], eax
mov eax, dword [ebp + 0x24]
mov dword [ebp - 0x80], ecx
mov ecx, dword [ebp + 0x2c]
mov dword [ebp - 0x74], edx
mov dword [ebp - 0x84], eax
mov dword [ebp - 0x7c], ecx
test esi, esi
je 0x40be34
test ebx, ebx
je 0x40be34
lea ecx, [ebp - 0x64]
call fcn.0040a140
mov eax, dword [edi + 4]
lea edx, [ebp - 0xa8]
push edx
push 4
lea ecx, [ebp - 0x6c]
push ecx
push 8
push eax
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x6c], 1
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x40be2c
cmp dword [ebp - 0x6c], 1
je 0x40bdf5
mov eax, dword [edi + 4]
lea edx, [ebp - 0x68]
push edx
push 1
push 2
push 0
push 0xb
push eax
mov dword [ebp - 0x68], 0
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x40be2c
cmp byte [ebp + 0x1c], 0
je 0x40bebd
cmp dword [edi + 8], 0
jne 0x40bebd
push 0
push 1
lea ecx, [ebp - 0x64]
push ecx
mov ecx, edi
call fcn.0040a770
test al, al
jne 0x40be49
cmp dword [ebp - 0x6c], 1
je 0x40be2c
mov edx, dword [ebp - 0x68]
push edx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea ecx, [ebp - 0x64]
call fcn.004073d0
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00418330
mov esp, ebp
pop ebp
ret 0x28
xor eax, eax
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0xa0], eax
mov dword [ebp - 0x9c], eax
mov dword [ebp - 0x98], eax
mov dword [ebp - 0x94], eax
mov dword [ebp - 0x90], eax
mov dword [ebp - 0x8c], eax
mov dword [ebp - 0x88], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0xa4], 0x20
cmp dword [eax - 0xc], 0
jne 0x40be96
lea ecx, [ebp - 0x64]
call fcn.0040b540
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp - 0x14]
lea edx, [ebp - 0xa4]
push edx
push eax
mov dword [ebp - 0x9c], ecx
call dword [sym.imp.USERENV.dll_LoadUserProfileW]
test eax, eax
je 0x40bebd
mov ecx, dword [ebp - 0x88]
mov dword [edi + 8], ecx
movzx edi, byte [ebp + 0x28]
mov edx, dword [ebp - 0x68]
push edi
push edx
lea eax, [ebp - 0x70]
push eax
call sub.USERENV.dll_CreateEnvironmentBlock
test eax, eax
je 0x40be2c
mov ecx, dword [ebp - 0x7c]
mov edx, dword [ebp - 0x70]
mov eax, dword [ebp + 0x18]
push esi
push ebx
push ecx
mov ecx, dword [ebp - 0x84]
push edx
mov edx, dword [ebp - 0x74]
push eax
mov eax, dword [ebp - 0x80]
push edi
push ecx
mov ecx, dword [ebp - 0x78]
push edx
mov edx, dword [ebp - 0x68]
push eax
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov esi, eax
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp dword [ebp - 0x6c], 1
mov edi, eax
je 0x40bf1d
mov eax, dword [ebp - 0x68]
push eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov ecx, dword [ebp - 0x70]
push ecx
call sub.USERENV.dll_DestroyEnvironmentBlock
push edi
call dword [sym.imp.KERNEL32.DLL_SetLastError]
lea ecx, [ebp - 0x64]
call fcn.004073d0
mov ecx, dword [ebp - 4]
test esi, esi
pop edi
setne al
pop esi
xor ecx, ebp
pop ebx
call fcn.00418330
mov esp, ebp
pop ebp
ret 0x28