Function at 0x404660
Capabilities:
Create process on windows
Get session information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xaa4
mov eax, dword [0x42a040]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov dword [ebp - 0xaa0], eax
mov eax, dword [ebp + 0xc]
push edi
mov dword [ebp - 0xa9c], eax
lea eax, [ebp - 0xa14]
push eax
lea eax, [ebp - 0xa44]
mov dword [ebp - 0xa14], 0
push eax
push 1
push 0
push 0
mov dword [ebp - 0xa44], 0
call dword [sym.imp.WTSAPI32.dll_WTSEnumerateSessionsW]
test eax, eax
je 0x40492b
xor ebx, ebx
cmp dword [ebp - 0xa14], ebx
jle 0x40491f
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
mov dword [ebp - 0xa94], ecx
nop word [eax + eax]
mov eax, dword [ebp - 0xa44]
mov eax, dword [ecx + eax]
lea ecx, [ebp - 0xa18]
push ecx
lea ecx, [ebp - 0xa48]
mov dword [ebp - 0xa98], eax
push ecx
push 8
push eax
push 0
mov dword [ebp - 0xa48], 0
mov dword [ebp - 0xa18], 0
call dword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
je 0x404818
mov eax, dword [ebp - 0xa48]
push eax
mov esi, dword [eax]
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
test esi, esi
jne 0x404818
lea eax, [ebp - 0xa38]
mov dword [ebp - 0xa38], esi
push eax
push dword [ebp - 0xa98]
call dword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
je 0x404818
lea eax, [ebp - 0xa18]
mov dword [ebp - 0xa3c], esi
push eax
push 4
lea eax, [ebp - 0xa3c]
push eax
push 0x13
push dword [ebp - 0xa38]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
push dword [ebp - 0xa38]
test eax, eax
jne 0x404791
call edi
jmp 0x404818
call edi
lea eax, [ebp - 0xa38]
mov dword [ebp - 0xa24], 0xc
push eax
push 1
push 2
lea eax, [ebp - 0xa24]
xorps xmm0, xmm0
push eax
push 0x20f01ff
push dword [ebp - 0xa3c]
movlpd qword [ebp - 0xa20], xmm0
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
push dword [ebp - 0xa3c]
test eax, eax
jne 0x4047d9
call edi
jmp 0x404818
call edi
push dword [ebp - 0xa38]
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
push 0
push dword [ebp - 0xa38]
lea eax, [ebp - 0xa40]
mov dword [ebp - 0xa40], 0
push eax
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
jne 0x404839
push dword [ebp - 0xa38]
call edi
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov ecx, dword [ebp - 0xa94]
inc ebx
add ecx, 0xc
mov dword [ebp - 0xa94], ecx
cmp ebx, dword [ebp - 0xa14]
jl 0x4046e0
jmp 0x40491f
lea eax, [ebp - 0xa90]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
push 0x800
lea eax, [ebp - 0xa10]
mov dword [ebp - 0xa90], 0x44
push 0
mov esi, 5
mov dword [ebp - 0xa88], str.winsta0default
push eax
mov dword [ebp - 0xa64], 1
mov word [ebp - 0xa60], si
call fcn.00412cc0
push 0x208
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.00412cc0
mov edx, esi
lea ecx, [ebp - 0x210]
call fcn.00401a50
push dword [ebp - 0xa9c]
lea eax, [ebp - 0x210]
push dword [ebp - 0xaa0]
push eax
lea eax, [ebp - 0xa10]
push str.__s____s___s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x2c
lea eax, [ebp - 0xa34]
push eax
lea eax, [ebp - 0xa90]
push eax
push 0
push dword [ebp - 0xa40]
lea eax, [ebp - 0xa24]
push 0x430
push 0
push eax
push eax
lea eax, [ebp - 0xa10]
push eax
push 0
push dword [ebp - 0xa38]
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
push dword [ebp - 0xa40]
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
push dword [ebp - 0xa38]
call edi
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
push dword [ebp - 0xa44]
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004113fe
mov esp, ebp
pop ebp
ret 8