Function at 0x409b50
Capabilities:
Acquire debug privileges
Create process on windows
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2a8
mov eax, dword [0x48e050]
xor eax, esp
mov dword [esp + 0x2a4], eax
push esi
push edi
push 0x44
xor edi, edi
lea eax, [esp + 0x54]
push edi
push eax
call fcn.004416b0
add esp, 0xc
xor eax, eax
push 0x208
lea edx, [esp + 0x9e]
xor ecx, ecx
push edi
push edx
mov dword [esp + 0x5c], 0x44
mov dword [esp + 0x64], str.winsta0default
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x1c], 0xffffffff
mov dword [esp + 0x18], edi
mov dword [esp + 0x40], 0x30
mov word [esp + 0xa4], cx
call fcn.004416b0
add esp, 0xc
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x1c]
push ecx
push 1
push edi
push edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
call sub.WTSAPI32.dll_WTSEnumerateSessionsW
test eax, eax
je 0x409c22
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x18]
xor eax, eax
cmp edx, edi
jbe 0x409c1c
lea ecx, [esi + 8]
cmp dword [ecx], edi
je 0x409c12
inc eax
add ecx, 0xc
cmp eax, edx
jb 0x409c04
jmp 0x409c1c
lea edx, [eax + eax*2]
mov eax, dword [esi + edx*4]
mov dword [esp + 0x10], eax
push esi
call sub.WTSAPI32.dll_WTSFreeMemory
mov ecx, dword [esp + 0x10]
push ecx
push str.StartInteractiveProcess_section:__d
call fcn.00404c20
add esp, 8
push 0x104
lea edx, [esp + 0x9c]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
mov eax, dword [esp + 0x10]
cmp eax, 0xffffffff
je 0x409ca7
lea ecx, [esp + 0x30]
push ecx
push eax
call sub.WTSAPI32.dll_WTSQueryUserToken
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x409e24
mov edx, dword [esp + 0x30]
push edx
call esi
lea eax, [esp + 0xc]
push eax
push 0x201eb
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x409ca7
lea ecx, [esp + 0x38]
push ecx
push str.SeDebugPrivilege
push edi
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x409cbd
mov edx, dword [esp + 0xc]
push edx
call esi
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x2a4]
xor ecx, esp
call fcn.0043e4c7
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
lea edx, [esp + 8]
push edx
push 1
push 1
push edi
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x1c]
push 0x2000000
push eax
mov dword [esp + 0x58], 1
mov dword [esp + 0x60], ecx
mov dword [esp + 0x64], 2
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x409d18
mov ecx, dword [esp + 0xc]
push ecx
call esi
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x2a4]
xor ecx, esp
call fcn.0043e4c7
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0xc]
push edx
call esi
mov ecx, dword [esp + 8]
push 4
lea eax, [esp + 0x14]
push eax
push 0xc
push ecx
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
test eax, eax
jne 0x409d54
mov edx, dword [esp + 8]
push edx
call esi
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x2a4]
xor ecx, esp
call fcn.0043e4c7
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 8]
push edi
push edi
push 0x10
lea eax, [esp + 0x4c]
push eax
push edi
push ecx
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
je 0x409d37
mov eax, dword [esp + 8]
push 1
push eax
lea ecx, [esp + 0x1c]
push ecx
mov dword [esp + 0x20], edi
call sub.USERENV.dll_CreateEnvironmentBlock
test eax, eax
je 0x409d8d
mov eax, 0x430
jmp 0x409d95
mov eax, dword [esp + 0x34]
mov dword [esp + 0x14], edi
lea edx, [esp + 0x20]
push edx
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x54]
push ecx
push edi
push edx
push eax
mov eax, dword [esp + 0x1c]
push edi
push edi
push edi
push ebx
push edi
push eax
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
test eax, eax
jne 0x409dec
mov ecx, dword [esp + 8]
push ecx
call esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push str.StartInteractiveProcess0:__s____d
call fcn.00404c20
add esp, 0xc
xor al, al
pop edi
pop esi
mov ecx, dword [esp + 0x2a4]
xor ecx, esp
call fcn.0043e4c7
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 8]
push edx
call esi
mov eax, dword [esp + 0x20]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esp + 0x20]
push ecx
call esi
mov edx, dword [esp + 0x24]
push edx
call esi
mov al, 1
pop edi
pop esi
mov ecx, dword [esp + 0x2a4]
xor ecx, esp
call fcn.0043e4c7
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x54]
push ecx
lea edx, [esp + 0xa0]
push edx
push edi
push 0x10
push edi
push edi
push edi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x409df3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push str.StartInteractiveProcess1:__s____d
call fcn.00404c20
mov ecx, dword [esp + 0x2b8]
add esp, 0xc
pop edi
pop esi
xor ecx, esp
xor al, al
call fcn.0043e4c7
mov esp, ebp
pop ebp
ret