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

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r14
lea rbp, [rsp - 0x30]
sub rsp, 0x130
mov rax, qword [0x1400f8010]
xor rax, rsp
mov qword [rbp + 0x20], rax
mov edi, edx
mov r14, r8
xor edx, edx
mov rsi, rcx
lea rcx, [rbp - 0x50]
mov ebx, 0x80004005
lea r8d, [rdx + 0x68]
call fcn.140080170
mov dword [rbp - 0x50], 0x68
call qword [sym.imp.api_ms_win_core_kernel32_legacy_l1_1_0.dll_WTSGetActiveConsoleSessionId]
mov dword [rsp + 0x60], eax
cmp eax, 0xffffffff
jne 0x14003993a
mov eax, ebx
jmp 0x140039ccf
mov qword [rsp + 0x168], r15
lea rdx, [rsp + 0x68]
xor r15d, r15d
lea rcx, [rsp + 0x60]
mov qword [rsp + 0x68], r15
mov qword [rsp + 0x78], r15
mov qword [rsp + 0x70], r15
mov dword [rbp - 0x68], r15d
call fcn.1400397b0
test eax, eax
je 0x140039acf
test edi, edi
je 0x1400399de
mov rcx, qword [rsp + 0x68]
lea rax, [rbp - 0x68]
lea r9d, [r15 + 8]
mov qword [rsp + 0x20], rax
lea r8, [rsp + 0x78]
lea edx, [r15 + 0x13]
call qword [sym.imp.api_ms_win_security_base_l1_1_0.dll_GetTokenInformation]
test eax, eax
jne 0x1400399c0
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x520
je 0x1400399c0
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
test eax, eax
jle 0x140039cc7
movzx eax, ax
or eax, 0x80070000
jmp 0x140039cc7
cmp qword [rsp + 0x78], r15
je 0x1400399de
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
mov rcx, qword [rsp + 0x78]
mov qword [rsp + 0x68], rcx
jmp 0x1400399e3
mov rcx, qword [rsp + 0x68]
lea rax, [rsp + 0x70]
mov edi, 1
mov qword [rsp + 0x28], rax
mov r9d, edi
xor r8d, r8d
mov dword [rsp + 0x20], edi
mov edx, 0x2000000
call qword [sym.imp.api_ms_win_security_base_l1_1_0.dll_DuplicateTokenEx]
test eax, eax
je 0x140039cc5
mov rdx, qword [rsp + 0x70]
lea rcx, [rsp + 0x60]
xor r8d, r8d
mov qword [rsp + 0x60], r15
call qword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
jne 0x140039a54
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
test eax, eax
jle 0x140039abf
mov rcx, qword [rsp + 0x70]
movzx ebx, ax
or ebx, 0x80070000
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
jmp 0x140039cc5
mov rcx, qword [rsp + 0x70]
lea rax, [rbp - 0x50]
mov qword [rsp + 0x50], r14
xor r9d, r9d
mov qword [rsp + 0x48], rax
mov r8, rsi
mov rax, qword [rsp + 0x60]
xor edx, edx
mov qword [rsp + 0x40], r15
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x8000420
mov dword [rsp + 0x28], r15d
mov qword [rsp + 0x20], r15
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_CreateProcessAsUserW]
test eax, eax
je 0x140039a9f
mov ebx, r15d
jmp 0x140039ab4
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
test eax, eax
jle 0x140039ab4
movzx ebx, ax
or ebx, 0x80070000
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
jmp 0x140039cc5
test edi, edi
je 0x140039b10
mov qword [rsp + 0x48], r14
lea rax, [rbp - 0x50]
mov qword [rsp + 0x40], rax
xor r9d, r9d
mov qword [rsp + 0x38], r15
xor r8d, r8d
mov qword [rsp + 0x30], r15
mov rdx, rsi
mov dword [rsp + 0x28], 0x8000420
xor ecx, ecx
mov dword [rsp + 0x20], r15d
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_CreateProcessW]
mov edi, eax
jmp 0x140039ca7
mov qword [rbp - 0x78], r15
mov qword [rbp - 0x70], r15
mov dword [rsp + 0x60], r15d
mov qword [rbp - 0x80], r15
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_GetCurrentProcess]
lea r8, [rbp - 0x80]
mov edx, 0x20
mov rcx, rax
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_OpenProcessToken]
test eax, eax
jne 0x140039b4b
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edi, r15d
jmp 0x140039ca7
mov edi, 1
lea r8, [rbp - 0x5c]
lea rdx, [0x1400cecd0]
mov dword [rbp - 0x60], edi
xor ecx, ecx
call qword [sym.imp.api_ms_win_security_lsalookup_l2_1_0.dll_LookupPrivilegeValueW]
mov rcx, qword [rbp - 0x80]
lea r8, [rbp - 0x60]
xor r9d, r9d
mov qword [rsp + 0x28], r15
xor edx, edx
mov dword [rbp - 0x54], 2
mov qword [rsp + 0x20], r15
call qword [sym.imp.api_ms_win_security_base_l1_1_0.dll_AdjustTokenPrivileges]
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov rcx, qword [rbp - 0x80]
mov ebx, eax
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
test ebx, ebx
je 0x140039ba8
mov edi, r15d
jmp 0x140039ca7
call qword [sym.imp.USER32.dll_GetShellWindow]
test rax, rax
jne 0x140039bbb
mov edi, r15d
jmp 0x140039ca7
lea rdx, [rsp + 0x60]
mov rcx, rax
call qword [sym.imp.USER32.dll_GetWindowThreadProcessId]
mov r8d, dword [rsp + 0x60]
test r8d, r8d
jne 0x140039bdb
mov edi, r15d
jmp 0x140039ca7
xor edx, edx
mov ecx, 0x400
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_1.dll_OpenProcess]
mov rbx, rax
test rax, rax
jne 0x140039bfe
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edi, r15d
jmp 0x140039ca7
lea r8, [rbp - 0x78]
mov edx, 2
mov rcx, rbx
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_OpenProcessToken]
test eax, eax
jne 0x140039c22
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edi, r15d
jmp 0x140039ca7
mov rcx, qword [rbp - 0x78]
lea rax, [rbp - 0x70]
mov qword [rsp + 0x28], rax
mov r9d, 2
xor r8d, r8d
mov dword [rsp + 0x20], edi
mov edx, 0x18b
call qword [sym.imp.api_ms_win_security_base_l1_1_0.dll_DuplicateTokenEx]
test eax, eax
je 0x140039c81
mov rcx, qword [rbp - 0x70]
lea rax, [rbp - 0x50]
mov qword [rsp + 0x40], r14
mov r9, rsi
mov qword [rsp + 0x38], rax
xor r8d, r8d
mov qword [rsp + 0x30], r15
xor edx, edx
mov qword [rsp + 0x28], r15
mov dword [rsp + 0x20], 0x8000420
call qword [sym.imp.ADVAPI32.dll_CreateProcessWithTokenW]
test eax, eax
jne 0x140039c8a
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edi, r15d
mov rcx, qword [rbp - 0x78]
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
mov rcx, qword [rbp - 0x70]
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
mov rcx, rbx
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
test edi, edi
je 0x140039cb0
mov ebx, r15d
jmp 0x140039cc5
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov ebx, eax
test eax, eax
jle 0x140039cc5
movzx ebx, ax
or ebx, 0x80070000
mov eax, ebx
mov r15, qword [rsp + 0x168]
mov rcx, qword [rbp + 0x20]
xor rcx, rsp
call fcn.14003d6b0
add rsp, 0x130
pop r14
pop rdi
pop rsi
pop rbx
pop rbp
ret