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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xaa4
mov eax, dword [0x42a458]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov dword [ebp - 0xa9c], eax
mov eax, dword [ebp + 0xc]
push edi
mov dword [ebp - 0xaa0], eax
lea eax, [ebp - 0xa14]
push eax
lea eax, [ebp - 0xa40]
mov dword [ebp - 0xa14], 0
push eax
push 1
push 0
push 0
mov dword [ebp - 0xa40], 0
call dword [sym.imp.WTSAPI32.dll_WTSEnumerateSessionsW]
test eax, eax
je 0x4054cb
xor ebx, ebx
cmp dword [ebp - 0xa14], ebx
jle 0x4054bf
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
mov dword [ebp - 0xa94], ecx
lea ebx, [ebx]
mov eax, dword [ebp - 0xa40]
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 0x4053a8
mov eax, dword [ebp - 0xa48]
push eax
mov esi, dword [eax]
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
test esi, esi
jne 0x4053a8
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 0x4053a8
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 0x405321
call edi
jmp 0x4053a8
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]
movq qword [ebp - 0xa20], xmm0
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
push dword [ebp - 0xa3c]
test eax, eax
jne 0x405369
call edi
jmp 0x4053a8
call edi
push dword [ebp - 0xa38]
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
push 0
push dword [ebp - 0xa38]
lea eax, [ebp - 0xa44]
mov dword [ebp - 0xa44], 0
push eax
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
jne 0x4053c9
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 0x405270
jmp 0x4054bf
lea eax, [ebp - 0xa90]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
xor eax, eax
mov dword [ebp - 0xa90], 0x44
push 0x7fe
push eax
mov word [ebp - 0xa10], ax
mov esi, 5
lea eax, [ebp - 0xa0e]
mov dword [ebp - 0xa88], str.winsta0default
push eax
mov dword [ebp - 0xa64], 1
mov word [ebp - 0xa60], si
call fcn.00412f00
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x210], ax
lea eax, [ebp - 0x20e]
push eax
call fcn.00412f00
mov edx, esi
lea ecx, [ebp - 0x210]
call fcn.004017e0
push dword [ebp - 0xaa0]
lea eax, [ebp - 0x210]
push dword [ebp - 0xa9c]
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 - 0xa44]
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 - 0xa44]
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
push dword [ebp - 0xa38]
call edi
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
push dword [ebp - 0xa40]
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00411ee6
mov esp, ebp
pop ebp
ret 8