Function at 0x140004790
Capabilities:
Create process on windows
Get session user name
Get token membership

Disassembly:
mov qword [rsp + 0x10], rdi
push rbp
lea rbp, [rsp - 0x230]
sub rsp, 0x330
mov rax, qword [0x14000d010]
xor rax, rsp
mov qword [rbp + 0x220], rax
xor edi, edi
lea rcx, [rbp + 0x10]
xor edx, edx
mov qword [rsp + 0x68], rdi
mov r8d, 0x200
call sub.VCRUNTIME140.dll_memset
lea rdx, [rbp - 0x6c]
mov dword [rbp - 0x6c], 0x100
lea rcx, [rbp + 0x10]
call qword [sym.imp.ADVAPI32.dll_GetUserNameW]
lea rax, [rsp + 0x60]
mov dword [rbp - 0x78], edi
mov qword [rsp + 0x50], rax
lea r8d, [rdi + 0x12]
mov dword [rsp + 0x48], edi
lea rcx, [rbp - 0x78]
mov dword [rsp + 0x40], edi
xor r9d, r9d
mov dword [rsp + 0x38], edi
mov dl, 1
mov dword [rsp + 0x30], edi
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x20], edi
mov word [rbp - 0x74], 0x500
call qword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
mov dword [rbp - 0x70], eax
test eax, eax
je 0x140004849
mov rdx, qword [rsp + 0x60]
lea r8, [rbp - 0x70]
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_CheckTokenMembership]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_FreeSid]
cmp dword [rbp - 0x70], edi
jne 0x140004862
lea rdx, [rbp + 0x10]
lea rcx, str.system
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
test eax, eax
jne 0x140004a34
call qword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
mov ecx, eax
lea rdx, [rsp + 0x68]
call qword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
je 0x140004a34
mov rcx, qword [rsp + 0x68]
test rcx, rcx
je 0x140004a34
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x140004a34
mov ecx, 0x3e8
mov qword [rsp + 0x340], rbx
call qword [sym.imp.KERNEL32.dll_Sleep]
mov rbx, qword [rsp + 0x68]
test rbx, rbx
je 0x1400049ee
xor edx, edx
lea rcx, [rbp + 0x10]
mov r8d, 0x20a
call sub.VCRUNTIME140.dll_memset
mov r8d, 0x104
lea rdx, [rbp + 0x10]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor edx, edx
lea rcx, [rbp + 0x10]
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__waccess_s]
test eax, eax
jne 0x1400049ee
cmp word [rbp + 0x10], di
je 0x140004911
call fcn.140005f50
mov rcx, qword [rax]
mov rax, qword [rcx]
test rax, rax
je 0x140004911
lea rcx, [rbp + 0x10]
call rax
test eax, eax
je 0x140004922
lea rcx, [rbp + 0x10]
call fcn.1400022d0
test al, al
je 0x1400049ee
xor r8d, r8d
lea rcx, [rsp + 0x60]
mov rdx, rbx
call qword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
je 0x1400049ee
xorps xmm1, xmm1
mov dword [rbp - 0x60], 0x68
xor eax, eax
lea r8, [rbp + 0x10]
mov qword [rbp - 0x80], rax
xorps xmm0, xmm0
mov dword [rbp + 4], eax
xor r9d, r9d
lea rax, [rsp + 0x70]
xor edx, edx
mov qword [rsp + 0x50], rax
mov rcx, rbx
lea rax, [rbp - 0x60]
mov qword [rsp + 0x48], rax
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x40], rdi
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0x8000420
mov dword [rsp + 0x28], edi
mov qword [rsp + 0x20], rdi
movups xmmword [rsp + 0x70], xmm0
movups xmmword [rbp - 0x5c], xmm1
movups xmmword [rbp - 0x4c], xmm1
movups xmmword [rbp - 0x3c], xmm1
movups xmmword [rbp - 0x2c], xmm1
movups xmmword [rbp - 0x1c], xmm1
movups xmmword [rbp - 0xc], xmm1
call qword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov rcx, qword [rsp + 0x60]
mov ebx, eax
call qword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
test ebx, ebx
je 0x1400049ee
mov rcx, qword [rsp + 0x70]
mov edx, 0xbb8
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov bl, 1
jmp 0x1400049f0
xor bl, bl
mov rdi, qword [rsp + 0x68]
test rdi, rdi
je 0x140004a09
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
movzx eax, bl
mov rbx, qword [rsp + 0x340]
mov rcx, qword [rbp + 0x220]
xor rcx, rsp
call fcn.140006280
mov rdi, qword [rsp + 0x348]
add rsp, 0x330
pop rbp
ret
xor al, al
jmp 0x140004a14