Function at 0x140050340
Capabilities:
Create process on windows
Impersonate user

Disassembly:
mov qword [rsp + 0x10], rbx
mov dword [rsp + 0x20], r9d
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 7]
sub rsp, 0xe0
xor eax, eax
mov rbx, r8
mov rsi, rcx
mov rdi, rdx
lea rcx, [rbp - 0x31]
lea r8d, [rax + 0x38]
xor edx, edx
mov r15d, r9d
mov byte [rbp + 0x47], al
mov qword [rbp - 0x71], rax
mov r12d, eax
mov r13d, eax
mov r14d, eax
mov qword [rbp - 0x51], rax
mov qword [rbp - 0x39], rax
mov qword [rbp - 0x79], rax
mov qword [rbp - 0x41], rax
call fcn.1400152d0
lea ecx, [r14 + 1]
mov eax, r14d
mov r9d, r15d
test cl, r15b
movzx eax, al
mov r8, rbx
cmovne eax, ecx
mov rdx, rdi
mov rcx, rsi
mov dword [rbp - 0x49], eax
lea rax, [rbp - 0x71]
mov dword [rbp - 0x31], gethostname
mov qword [rsp + 0x20], rax
mov qword [rbp - 0x29], rsi
call fcn.14003f060
xor esi, esi
test al, al
je 0x140050610
test r15b, 2
je 0x140050424
mov rcx, qword [rbp - 0x71]
lea rax, [rbp - 0x69]
lea r9d, [r14 + 2]
mov qword [rsp + 0x28], rax
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x20], 1
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x140050610
mov rcx, qword [rbp - 0x71]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r11, qword [rbp - 0x69]
mov qword [rbp - 0x71], r11
lea rcx, str.winsta0
xor edx, edx
mov r8d, 0x60000
call qword [sym.imp.USER32.dll_OpenWindowStationW]
mov r12, rax
test rax, rax
je 0x140050610
or rbx, 0xffffffffffffffff
cmp rax, rbx
je 0x140050610
call qword [sym.imp.USER32.dll_GetProcessWindowStation]
mov rcx, r12
mov qword [rbp - 0x39], rax
call qword [sym.imp.USER32.dll_SetProcessWindowStation]
test eax, eax
je 0x140050610
lea rcx, str.default
mov r9d, 0x60081
xor r8d, r8d
xor edx, edx
call qword [sym.imp.USER32.dll_OpenDesktopW]
mov r13, rax
test rax, rax
je 0x140050610
cmp rax, rbx
je 0x140050610
mov rcx, qword [rbp - 0x71]
lea rdx, [rbp - 0x51]
call fcn.14003f0a0
mov r14, qword [rbp - 0x51]
test al, al
je 0x140050610
lea r8, [rbp - 0x69]
mov rdx, r14
mov rcx, r12
mov word [rbp - 0x69], 0xb00
mov dword [rbp - 0x65], 0xf0000000
mov word [rbp - 0x5d], 0x400
mov dword [rbp - 0x59], 0xf037f
call fcn.1400500e0
test al, al
je 0x140050610
lea r8, [rbp - 0x69]
mov rdx, r14
mov rcx, r13
mov word [rbp - 0x69], si
mov dword [rbp - 0x65], 0xf01ff
call fcn.14004fe80
test al, al
je 0x140050610
mov rdi, qword [rbp + 0x7f]
mov r15, qword [rbp + 0x67]
lea rcx, str.winsta0default
mov esi, dword [rdi + 0x3c]
xor ebx, ebx
mov qword [rdi + 0x10], rcx
and esi, 0x100
test r15, r15
je 0x140050564
mov rcx, r15
call fcn.140014844
mov rcx, 0xffffffffffffffff
lea rbx, [rax + 1]
mov eax, 2
mul rbx
cmovo rax, rcx
mov rcx, rax
call fcn.140014cb8
mov r8, rbx
mov rdx, r15
mov rcx, rax
mov qword [rbp - 0x79], rax
call fcn.1400153bc
xor ebx, ebx
mov r15d, dword [rbp - 0x49]
test r15b, r15b
je 0x140050583
mov rcx, qword [rbp - 0x71]
lea rdx, [rbp - 0x31]
call qword [sym.imp.USERENV.dll_LoadUserProfileW]
test eax, eax
je 0x14005060a
test byte [rbp + 0x5f], 4
jne 0x14005059e
mov rdx, qword [rbp - 0x71]
lea rcx, [rbp - 0x41]
xor r8d, r8d
call qword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
je 0x14005060a
mov rax, qword [rbp + 0x77]
mov ecx, dword [rbp + 0x6f]
mov rbx, qword [rbp + 0x87]
mov qword [rsp + 0x50], rbx
mov qword [rsp + 0x48], rdi
mov rdi, qword [rbp - 0x79]
mov qword [rsp + 0x40], rax
mov rax, qword [rbp - 0x41]
bts ecx, 0xa
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], ecx
mov rcx, qword [rbp - 0x71]
mov dword [rsp + 0x28], esi
xor esi, esi
xor r9d, r9d
mov r8, rdi
xor edx, edx
mov qword [rsp + 0x20], rsi
call qword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
test eax, eax
je 0x140050613
test r15b, r15b
je 0x140050606
lea r8, [rbp - 0x71]
lea rdx, [rbp - 1]
mov rcx, rbx
call fcn.14003ef80
mov bl, 1
jmp 0x140050629
mov rdi, qword [rbp - 0x79]
jmp 0x140050613
mov rdi, rsi
mov rdx, qword [rbp - 1]
test rdx, rdx
je 0x140050626
mov rcx, qword [rbp - 0x71]
call qword [sym.imp.USERENV.dll_UnloadUserProfile]
mov bl, byte [rbp + 0x47]
mov rcx, r14
call fcn.14003ede0
test r12, r12
je 0x14005063f
mov rcx, r12
call qword [sym.imp.USER32.dll_CloseWindowStation]
test r13, r13
je 0x14005064d
mov rcx, r13
call qword [sym.imp.USER32.dll_CloseDesktop]
mov rax, qword [rbp - 0x39]
test rax, rax
je 0x14005065f
mov rcx, rax
call qword [sym.imp.USER32.dll_SetProcessWindowStation]
mov rcx, qword [rbp - 0x71]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
call fcn.140014860
mov rcx, qword [rbp - 0x41]
test rcx, rcx
je 0x140050680
call qword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
mov al, bl
mov rbx, qword [rsp + 0x128]
add rsp, 0xe0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret