Function at 0x40b490
Capabilities:
Create process on windows
Get common file path
Get session information
Get session user name
Impersonate user

Disassembly:
push 0xffffffffffffffff
push 0x4b0a3b
mov eax, dword fs:[0]
push eax
sub esp, 0x2a0
mov eax, dword [0x4ca1d0]
xor eax, esp
mov dword [esp + 0x29c], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4ca1d0]
xor eax, esp
push eax
lea eax, [esp + 0x2b4]
mov dword fs:[0], eax
mov eax, dword [0x4d3dfc]
mov edx, dword [eax + 0xc]
mov esi, dword [esp + 0x2c4]
mov edi, dword [esp + 0x2c8]
mov ebx, dword [esp + 0x2d0]
mov ecx, 0x4d3dfc
call edx
add eax, 0x10
mov dword [esp + 0x18], eax
push edi
push esi
lea eax, [esp + 0x20]
push str.__s___s
xor ebp, ebp
push eax
mov dword [esp + 0x2cc], ebp
call fcn.004088c0
mov esi, dword [esp + 0x2dc]
add esp, 0x10
lea ecx, [esp + 0x20]
push ecx
push esi
mov dword [esp + 0x28], ebp
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x34], ebp
call sub.WTSAPI32.dll_WTSQueryUserToken
test eax, eax
jne 0x40b550
push str.CGUBootServiceModule::RunProcess10
push str._s_WTSQueryUserToken_is_failed_n
push ebx
call fcn.00408af0
add esp, 0xc
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x14]
push edx
mov edi, 1
push edi
push edi
push ebp
push 0x2000000
push eax
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x20]
push edx
push 5
push esi
push ebp
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40b59b
call esi
push eax
push str.WTSQuerySessionInformation_Error:_d
push ebx
call fcn.00408af0
add esp, 0xc
mov edx, dword [esp + 0x14]
xor eax, eax
lea ecx, [esp + 0x34]
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x1c]
push ecx
push edx
mov dword [esp + 0x3c], 0x20
mov dword [esp + 0x44], eax
mov dword [esp + 0x40], edi
call dword [sym.imp.USERENV.dll_LoadUserProfileW]
test eax, eax
jne 0x40b5f6
call esi
push eax
push str.LoadUserProfile_Error:__d
push ebx
call fcn.00408af0
add esp, 0xc
mov eax, dword [esp + 0x1c]
cmp eax, ebp
je 0x40b604
push eax
call sub.WTSAPI32.dll_WTSFreeMemory
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
jne 0x40b626
push str.CGUBootServiceModule::RunProcess10
push str._s_ImpersonateLoggedOnUser_is_failed_n
push ebx
call fcn.00408af0
add esp, 0xc
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0xac]
push edx
push eax
mov dword [esp + 0x3c], 0x104
call dword [sym.imp.USERENV.dll_GetUserProfileDirectoryW]
test eax, eax
jne 0x40b65d
push str.CGUBootServiceModule::RunProcess10
push str._s_GetUserProfileDirectory_is_failed_n
push ebx
call fcn.00408af0
add esp, 0xc
push 0x44
lea ecx, [esp + 0x68]
push ebp
push ecx
call fcn.00494ec0
mov edx, dword [esp + 0x20]
add esp, 0xc
push ebp
push edx
lea eax, [esp + 0x30]
push eax
mov dword [esp + 0x70], 0x44
mov dword [esp + 0x78], str.winsta0default
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
cmp eax, ebp
jne 0x40b6b2
call esi
push eax
push str.could_not_create_environment_block__error:__i_
push ebx
call fcn.00408af0
mov esi, dword [esp + 0x24]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0xc
jmp 0x40b7d7
mov esi, dword [esp + 0x18]
cmp dword [esi - 4], edi
jle 0x40b6cc
mov ecx, dword [esi - 0xc]
push ecx
lea ecx, [esp + 0x1c]
call fcn.004072e0
mov esi, dword [esp + 0x18]
lea edx, [esp + 0x54]
push edx
mov edx, dword [esp + 0x2c]
lea eax, [esp + 0x68]
push eax
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0xb0]
push ecx
push edx
push 0x4000420
push ebp
push ebp
push ebp
push esi
push ebp
push eax
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov edi, eax
mov eax, dword [esi - 8]
push eax
push esi
call fcn.00495a6d
add esp, 8
cmp eax, ebp
jl 0x40b840
cmp eax, dword [esi - 8]
jg 0x40b840
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
cmp edi, ebp
jne 0x40b743
lea edx, [esp + 0xa8]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateProcessAsUser_Error:__d__s__name:__s
push ebx
call fcn.00408af0
add esp, 0x14
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
test eax, eax
jne 0x40b767
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DestroyEnvironmentBlock_Error:_d
push ebx
call fcn.00408af0
add esp, 0xc
mov ecx, dword [esp + 0x50]
mov edx, dword [esp + 0x14]
push ecx
push edx
call dword [sym.imp.USERENV.dll_UnloadUserProfile]
test eax, eax
jne 0x40b790
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.UnloadUserProfile_Error:_d
push ebx
call fcn.00408af0
add esp, 0xc
cmp edi, ebp
je 0x40b7b0
mov eax, dword [esp + 0x54]
cmp eax, 0xffffffff
je 0x40b7b0
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
mov dword [esp + 0x28], 1
call ebx
jmp 0x40b7cb
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateProcessAsUser1___d
push ebx
call fcn.00408af0
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0xc
mov eax, dword [esp + 0x58]
cmp eax, 0xffffffff
je 0x40b7d7
push eax
call ebx
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov eax, dword [esp + 0x14]
push eax
call ebx
mov ecx, dword [esp + 0x20]
push ecx
call ebx
lea eax, [esi - 0x10]
mov dword [esp + 0x2bc], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40b812
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x2b4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x29c]
xor ecx, esp
call fcn.0049473c
add esp, 0x2ac
ret 0x10
push 0x80070057
call fcn.004010b0
int3