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

Disassembly:
mov rax, rsp
push rbp
push r14
push r15
lea rbp, [rax - 0x488]
sub rsp, 0x570
mov qword [rbp - 0x60], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x140022008]
xor rax, rsp
mov qword [rbp + 0x460], rax
mov r15, rcx
mov qword [rbp + 0x48], 7
xor ebx, ebx
mov qword [rbp + 0x40], rbx
mov word [rbp + 0x30], bx
mov r8b, 1
mov edx, 0x3e8
lea rcx, [rbp + 0x30]
call fcn.1400017a0
test al, al
je 0x14000288e
mov qword [rbp + 0x40], rbx
lea rax, [rbp + 0x30]
cmp qword [rbp + 0x48], 8
cmovae rax, qword [rbp + 0x30]
mov word [rax], bx
mov dword [rsp + 0x60], ebx
mov qword [rbp - 0x78], rbx
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x78]
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 1]
call qword [sym.imp.WTSAPI32.dll_WTSEnumerateSessionsW]
test eax, eax
jne 0x1400028be
lea ebx, [rax + 1]
jmp 0x140002aeb
mov esi, ebx
cmp dword [rsp + 0x60], ebx
jbe 0x140002ae0
mov eax, esi
lea rcx, [rax + rax*2]
mov rax, qword [rbp - 0x78]
mov r14d, dword [rax + rcx*8]
mov qword [rbp - 0x70], rbx
mov dword [rsp + 0x70], ebx
lea rax, [rsp + 0x70]
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x70]
mov r8d, 8
mov edx, r14d
xor ecx, ecx
call qword [sym.imp.WTSAPI32.dll_WTSQuerySessionInformationW]
test eax, eax
je 0x1400029c4
mov rcx, qword [rbp - 0x70]
mov edi, dword [rcx]
call qword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
test edi, edi
jne 0x1400029c4
mov qword [rsp + 0x68], rbx
lea rdx, [rsp + 0x68]
mov ecx, r14d
call qword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
je 0x1400029c4
mov dword [rsp + 0x74], ebx
lea rax, [rsp + 0x74]
mov qword [rsp + 0x20], rax
lea r9d, [rdi + 8]
lea r8, [rbp - 0x68]
lea edx, [rdi + 0x13]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x1400029c4
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x68]
mov qword [rsp + 0x68], rcx
lea rax, [rbp - 0x80]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 1
lea r9d, [rdi + 2]
xor r8d, r8d
mov edx, 0x20f01ff
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x1400029c4
lea rcx, [rbp - 0x40]
call qword [sym.imp.KERNEL32.dll_GetStartupInfoW]
mov dword [rbp - 0x40], 0x68
mov qword [rsp + 0x78], rbx
xor r8d, r8d
mov rdx, qword [rbp - 0x80]
lea rcx, [rsp + 0x78]
call fcn.140002784
test eax, eax
jne 0x1400029d5
inc esi
cmp esi, dword [rsp + 0x60]
jae 0x140002ae0
jmp 0x1400028ca
lea rdx, [rbp + 0x30]
lea rcx, [0x14001e448]
call fcn.140001220
lea r8, [rbp + 0x30]
cmp qword [rbp + 0x48], 8
cmovae r8, qword [rbp + 0x30]
mov r9, r15
mov esi, 0x208
mov edx, esi
lea rcx, [rbp + 0x50]
call fcn.140002054
lea rcx, [rbp + 0x30]
cmp qword [rbp + 0x48], 8
cmovae rcx, qword [rbp + 0x30]
lea rdx, [rbp + 0x30]
cmovae rdx, qword [rbp + 0x30]
mov rax, qword [rbp + 0x40]
lea rax, [rdx + rax*2]
mov rdx, rbx
mov rdi, rax
sub rdi, rcx
inc rdi
shr rdi, 1
cmp rcx, rax
cmova rdi, rbx
test rdi, rdi
je 0x140002a4f
mov word [rcx], bx
lea rcx, [rcx + 2]
inc rdx
cmp rdx, rdi
jne 0x140002a40
lea rax, [rbp - 0x58]
mov qword [rsp + 0x50], rax
lea rax, [rbp - 0x40]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], rbx
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x8000428
mov dword [rsp + 0x28], ebx
mov qword [rsp + 0x20], rbx
xor r9d, r9d
lea r8, [rbp + 0x50]
xor edx, edx
mov rcx, qword [rbp - 0x80]
call qword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov edx, eax
lea rdi, [rbp + 0x50]
xor eax, eax
mov rcx, rsi
rep stosb byte [rdi], al
test edx, edx
jne 0x140002aad
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov rcx, qword [rbp - 0x50]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x58]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x78]
call fcn.1400027c0
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x80]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x78]
call qword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
nop
xor r8d, r8d
mov dl, 1
lea rcx, [rbp + 0x30]
call fcn.1400014b4
mov eax, ebx
mov rcx, qword [rbp + 0x460]
xor rcx, rsp
call fcn.140003b50
lea r11, [rsp + 0x570]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop rbp
ret