Function at 0x405c80
Capabilities:
Create process on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4169f0
mov eax, dword fs:[0]
push eax
sub esp, 0x4bc
mov eax, dword [0x4241a4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
lea eax, [ebp - 0x424]
mov dword [ebp - 4], 1
push eax
lea eax, [ebp - 0x4bc]
xor esi, esi
push eax
push 1
push esi
push esi
mov dword [ebp - 0x4bc], esi
mov dword [ebp - 0x424], esi
call sub.WTSAPI32.dll_WTSEnumerateSessionsW
mov edx, dword [ebp - 0x424]
xor edi, edi
mov ebx, dword [ebp - 0x4bc]
xor ecx, ecx
test edx, edx
je 0x405d11
mov eax, ebx
movq xmm0, qword [eax]
movq qword [ebp - 0x434], xmm0
cmp dword [eax + 8], esi
je 0x405d0b
inc ecx
add eax, 0xc
cmp ecx, edx
jb 0x405cf0
jmp 0x405d11
mov edi, dword [ebp - 0x434]
push ebx
call sub.WTSAPI32.dll_WTSFreeMemory
lea eax, [ebp - 0x4b4]
mov dword [ebp - 0x4b4], esi
push eax
push edi
call sub.WTSAPI32.dll_WTSQueryUserToken
test eax, eax
je 0x405f73
lea eax, [ebp - 0x4c0]
mov dword [ebp - 0x4c0], esi
push eax
push 1
push 2
push 0
push 0xf01ff
push dword [ebp - 0x4b4]
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x405f73
push dword [ebp - 0x4b4]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
mov edi, dword [ebp - 0x4c0]
mov dword [ebp - 0x4c4], edi
test edi, edi
je 0x405f73
lea eax, [ebp - 0x428]
mov dword [ebp - 0x4b0], esi
push eax
push 4
lea eax, [ebp - 0x4b0]
mov dword [ebp - 0x428], esi
push eax
push 0x13
push edi
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x405f6e
push dword [ebp - 0x4b0]
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
cmp eax, 1
jne 0x405f66
push 0x40
lea eax, [ebp - 0x4a8]
mov dword [ebp - 0x4ac], 0x44
push 0
push eax
mov esi, 0x90
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x434], 0xc
xorps xmm0, xmm0
mov dword [ebp - 0x440], 0xc
lea eax, [ebp - 0x4b8]
movq qword [ebp - 0x430], xmm0
movq qword [ebp - 0x43c], xmm0
push 1
push dword [ebp - 0x4b0]
mov dword [ebp - 0x4b8], 0
push eax
call sub.USERENV.dll_CreateEnvironmentBlock
test eax, eax
mov ecx, 0x490
lea eax, [ebp + 8]
cmovne esi, ecx
cmp dword [ebp + 0x1c], 8
mov dword [ebp - 0x4c8], esi
cmovae eax, dword [ebp + 8]
mov esi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscpy_s]
push eax
lea eax, [ebp - 0x420]
push 0x104
push eax
call esi
push 0x418df8
lea eax, [ebp - 0x218]
push 0x104
push eax
call esi
mov esi, dword [ebp + 0x20]
add esp, 0x18
mov edi, dword [ebp + 0x24]
cmp esi, edi
je 0x405f02
mov ebx, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscat_s]
push esi
lea ecx, [ebp - 0x458]
call fcn.00404380
cmp dword [ebp - 0x444], 8
lea eax, [ebp - 0x458]
cmovae eax, dword [ebp - 0x458]
push eax
lea eax, [ebp - 0x218]
push 0x104
push eax
call ebx
mov edx, dword [ebp - 0x444]
add esp, 0xc
cmp edx, 8
jb 0x405ef5
mov ecx, dword [ebp - 0x458]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405eeb
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x405fa1
push edx
push ecx
call fcn.0040fd80
add esp, 8
add esi, 0x18
cmp esi, edi
jne 0x405e83
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x468]
push eax
lea eax, [ebp - 0x4ac]
push eax
push 0
push dword [ebp - 0x4b8]
lea eax, [ebp - 0x440]
push dword [ebp - 0x4c8]
push 0
push eax
lea eax, [ebp - 0x434]
push eax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x420]
push eax
push dword [ebp - 0x4b0]
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov eax, dword [ebp - 0x4b8]
test eax, eax
je 0x405f60
push eax
call sub.USERENV.dll_DestroyEnvironmentBlock
mov edi, dword [ebp - 0x4c4]
push dword [ebp - 0x4b0]
call ebx
push edi
call ebx
jmp 0x405f75
xor esi, esi
mov edx, dword [ebp + 0x1c]
cmp edx, 8
jb 0x405fb1
mov ecx, dword [ebp + 8]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x405fa7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x405fa7
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.0040fd80
add esp, 8
xor eax, eax
mov dword [ebp + 0x18], 0
lea ecx, [ebp + 0x20]
mov dword [ebp + 0x1c], 7
mov word [ebp + 8], ax
call fcn.00405920
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040fd3f
mov esp, ebp
pop ebp
ret