Function at 0x180036a30
Capabilities:
Link many functions at runtime

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x70]
sub rsp, 0x170
mov qword [rbp - 0x68], 0xfffffffffffffffe
mov qword [rsp + 0x1c0], rbx
mov rax, qword [0x1802247b8]
xor rax, rsp
mov qword [rbp + 0x60], rax
mov qword [rbp - 0x70], r9
movzx esi, r8b
mov r13, rdx
mov rdi, rcx
cmp qword [rcx + 0x10], 0
je 0x180036ee4
xor r14d, r14d
mov qword [rsp + 0x78], r14
mov qword [rbp - 0x80], r14
mov qword [rbp - 0x80], 7
mov qword [rsp + 0x78], r14
mov word [rsp + 0x68], r14w
lea r8d, [r14 + 0xc]
lea rdx, str.Advapi32.dll
lea rcx, [rsp + 0x68]
call fcn.180005920
nop
mov eax, dword [0x18034db90]
test al, 1
jne 0x180036ae2
or eax, 1
mov dword [0x18034db90], eax
xor eax, eax
mov qword [0x18034db88], rax
call fcn.180064890
lea rcx, [0x180197b50]
call fcn.180139aec
nop
lea rdx, [rsp + 0x68]
lea rcx, [0x18034db88]
call fcn.180064a80
mov rbx, rax
cmp qword [rbp - 0x80], 8
jb 0x180036b07
mov rcx, qword [rsp + 0x68]
call fcn.180139b7c
mov qword [rbp - 0x80], 7
mov qword [rsp + 0x78], r14
mov word [rsp + 0x68], r14w
test rbx, rbx
je 0x180036ee4
lea rdx, str.ImpersonateLoggedOnUser
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbp - 0x78], rax
lea rdx, str.RevertToSelf
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov r15, rax
lea rdx, str.CreateProcessAsUserW
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov r12, rax
lea rdx, str.SetTokenInformation
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov r14, rax
cmp qword [rbp - 0x78], 0
je 0x180036ee4
test r15, r15
je 0x180036ee4
test r12, r12
je 0x180036ee4
test rax, rax
je 0x180036ee4
xor eax, eax
mov qword [rbp + 0x58], rax
lea rcx, [rbp + 0x58]
call fcn.18005df70
nop
xor ecx, ecx
mov qword [rsp + 0x60], rcx
mov dword [rbp + 0x30], 0xffffffff
lea r8, [rbp + 0x30]
lea rdx, [rsp + 0x60]
call fcn.18005f240
test al, al
je 0x180036ed4
mov rbx, qword [rsp + 0x60]
test rbx, rbx
je 0x180036ed4
cmp dword [rbp + 0x30], 0xffffffff
je 0x180036ecb
xor eax, eax
mov qword [rsp + 0x60], rax
test sil, sil
je 0x180036bff
lea rdx, [rsp + 0x60]
mov rcx, rbx
call fcn.1800370a0
test al, al
jne 0x180036c14
lea rdx, [rsp + 0x60]
mov rcx, rbx
call fcn.180036f60
test al, al
je 0x180036ecb
mov rsi, qword [rsp + 0x60]
test rsi, rsi
je 0x180036ecb
mov r9d, 4
lea r8, [rbp + 0x30]
lea edx, [r9 + 8]
mov rcx, rsi
call r14
xor r14d, r14d
mov qword [rbp - 0x60], r14
lea rdx, [rbp - 0x60]
mov rcx, rsi
call fcn.180037470
xor edx, edx
lea r8d, [r14 + 0x68]
lea rcx, [rbp - 0x40]
call fcn.180140c00
xor eax, eax
mov qword [rbp - 0x58], rax
mov qword [rbp - 0x50], rax
mov qword [rbp - 0x48], rax
mov dword [rbp - 0x40], 0x68
lea rax, str.WinSta0Default
mov qword [rbp - 0x30], rax
mov edx, 1
mov word [rbp], dx
mov dword [rbp - 4], 0x81
mov qword [rbp + 0x48], r14
mov qword [rbp + 0x50], r14
mov qword [rbp + 0x50], 7
mov qword [rbp + 0x48], r14
mov word [rbp + 0x38], r14w
mov r14, qword [rbp + 0x48]
cmp r14, 0x104
ja 0x180036cef
mov rcx, qword [rbp + 0x50]
cmp rcx, 0x104
je 0x180036cef
jae 0x180036cd7
mov r8, r14
mov edx, 0x104
lea rcx, [rbp + 0x38]
call fcn.180005d50
mov rcx, qword [rbp + 0x50]
mov edx, 1
mov qword [rbp + 0x48], r14
lea rax, [rbp + 0x38]
cmp rcx, 8
cmovae rax, qword [rbp + 0x38]
xor ecx, ecx
mov word [rax + r14*2], cx
mov r8, rdx
lea rdx, [0x1801ab180]
lea rcx, [rbp + 0x38]
call fcn.180005920
or r9, 0xffffffffffffffff
xor r8d, r8d
mov rdx, rdi
lea rcx, [rbp + 0x38]
call fcn.180005670
mov r8d, 1
lea rdx, [0x1801ab180]
lea rcx, [rbp + 0x38]
call fcn.1800057b0
cmp qword [r13 + 0x10], 0
je 0x180036d5b
mov r8d, 1
lea rdx, [0x1801ab184]
lea rcx, [rbp + 0x38]
call fcn.1800057b0
or r9, 0xffffffffffffffff
xor r8d, r8d
mov rdx, r13
lea rcx, [rbp + 0x38]
call fcn.180005670
xor r13d, r13d
mov r14d, r13d
mov rcx, rsi
call qword [rbp - 0x78]
test eax, eax
je 0x180036dfe
lea r8, [rbp + 0x38]
cmp qword [rbp + 0x50], 8
cmovae r8, qword [rbp + 0x38]
cmp qword [rdi + 0x18], 8
jb 0x180036d87
mov rdi, qword [rdi]
lea rax, [rbp - 0x58]
mov qword [rsp + 0x50], rax
lea rax, [rbp - 0x40]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], r13
mov rax, qword [rbp - 0x60]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x430
mov dword [rsp + 0x28], r13d
mov qword [rsp + 0x20], r13
xor r9d, r9d
mov rdx, rdi
mov rcx, rsi
call r12
mov r14d, eax
test eax, eax
je 0x180036dd5
mov ecx, dword [rbp - 0x48]
mov rax, qword [rbp - 0x70]
mov dword [rax], ecx
mov rcx, qword [rbp - 0x50]
test rcx, rcx
je 0x180036de8
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp - 0x50], r13
mov rcx, qword [rbp - 0x58]
test rcx, rcx
je 0x180036dfb
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rbp - 0x58], r13
call r15
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp qword [rbp - 0x60], r13
je 0x180036ea2
mov qword [rsp + 0x78], r13
mov qword [rbp - 0x80], r13
mov qword [rbp - 0x80], 7
mov qword [rsp + 0x78], r13
mov word [rsp + 0x68], r13w
mov r8d, 0xb
lea rdx, [0x1801ab188]
lea rcx, [rsp + 0x68]
call fcn.180005920
nop
call fcn.180064a20
mov rcx, rax
lea rdx, [rsp + 0x68]
call fcn.180064a80
mov rbx, rax
cmp qword [rbp - 0x80], 8
jb 0x180036e74
mov rcx, qword [rsp + 0x68]
call fcn.180139b7c
mov qword [rbp - 0x80], 7
mov qword [rsp + 0x78], r13
mov word [rsp + 0x68], r13w
lea rdx, str.DestroyEnvironmentBlock
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
je 0x180036ea2
mov rcx, qword [rbp - 0x60]
call rax
test r14d, r14d
setne bl
cmp qword [rbp + 0x50], 8
jb 0x180036eb8
mov rcx, qword [rbp + 0x38]
call fcn.180139b7c
mov qword [rbp + 0x50], 7
mov qword [rbp + 0x48], r13
mov word [rbp + 0x38], r13w
jmp 0x180036ed6
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor bl, bl
lea rcx, [rbp + 0x58]
call fcn.18005dff0
movzx eax, bl
jmp 0x180036ee6
xor al, al
mov rcx, qword [rbp + 0x60]
xor rcx, rsp
call fcn.180139310
mov rbx, qword [rsp + 0x1c0]
add rsp, 0x170
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret