Function at 0x140040040
Capabilities:
Create process on windows
Query environment variable

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x388
movaps xmmword [rsp + 0x370], xmm6
mov rdi, r8
mov rbx, rdx
mov rsi, rcx
mov rax, qword [0x1400db028]
xor rax, rsp
mov qword [rsp + 0x368], rax
lea r14, [rsp + 0x1d0]
mov r8d, 0x190
mov rcx, r14
xor edx, edx
call fcn.1400850d0
cmp byte [rbx + 0x17], 0
mov rdx, rbx
jns 0x14004009a
mov rdx, qword [rbx]
mov r8d, 0xc8
mov rcx, r14
call fcn.14004e990
mov rcx, r14
call fcn.140018900
cmp byte [rdi + 0x21], 0
je 0x1400400de
movzx ebp, byte [rdi]
movzx edi, byte [rdi + 0x20]
movzx eax, byte [rbx + 0x17]
test al, al
js 0x1400402d9
mov qword [rsp + 0x1b0], rbx
mov qword [rsp + 0x1b8], rax
jmp 0x1400402f9
mov qword [rsp + 0x80], 0xa
mov rax, qword [0x1400c8f90]
movzx eax, byte [rax + 0xa]
test al, al
jne 0x140040901
movaps xmm6, xmmword [0x1400bdae0]
movaps xmmword [rsp + 0x1a0], xmm6
lea rdx, str.LaunchProcess
lea r8, str....._baseprocesslaunch_win.cc
lea r14, [rsp + 0x120]
mov rcx, r14
mov r9d, 0x100
call fcn.14004dfa0
lea r8, [0x1400ec12c]
lea rcx, [rsp + 0x1a0]
mov rdx, r14
call fcn.14004ec50
xorps xmm0, xmm0
movaps xmmword [rsp + 0x1c0], xmm0
movabs rbp, 0xaaaaaaaaaaaaaaaa
mov qword [rsp + 0x190], rbp
movaps xmmword [rsp + 0x180], xmm6
movaps xmmword [rsp + 0x170], xmm6
movaps xmmword [rsp + 0x160], xmm6
movaps xmmword [rsp + 0x150], xmm6
movaps xmmword [rsp + 0x140], xmm6
movaps xmmword [rsp + 0x130], xmm6
movaps xmmword [rsp + 0x120], xmm6
lea rcx, [rsp + 0x120]
call fcn.14004fd40
xor r15d, r15d
cmp byte [rdi + 0x72], 0
mov ecx, 0
je 0x1400401c4
call fcn.14004c250
xor ecx, ecx
cmp eax, 0x10
setge cl
mov rax, qword [rdi + 0x28]
xor edx, edx
cmp rax, qword [rdi + 0x30]
setne dl
add edx, ecx
je 0x1400401f0
lea rcx, [rsp + 0x120]
call fcn.14004fdc0
mov r15d, 0x80000
test al, al
je 0x140040478
cmp byte [rdi + 0x72], 0
je 0x140040230
call fcn.14004c250
cmp eax, 0x10
jl 0x140040230
or byte [rsp + 0x1cb], 0x20
lea rcx, [rsp + 0x120]
lea r8, [rsp + 0x1c0]
mov edx, 0x20007
mov r9d, 0x10
call fcn.14004fe90
test al, al
je 0x140040478
cmp dword [rdi + 0x24], 1
sete r14b
mov r12, qword [rdi + 0x28]
mov r13, qword [rdi + 0x30]
cmp r12, r13
je 0x140040372
mov rax, r13
sub rax, r12
mov ecx, 0xfffffff8
cmp rax, rcx
ja 0x140040478
mov r14, qword [sym.imp.KERNEL32.dll_SetHandleInformation]
nop word cs:[rax + rax]
mov rcx, qword [r12]
mov edx, 1
mov r8d, 1
call r14
test eax, eax
je 0x140040294
add r12, 8
cmp r12, r13
jne 0x140040270
jmp 0x14004033d
lea rcx, [rsp + 0x80]
lea rdx, str.LaunchProcess
lea r8, str....._baseprocesslaunch_win.cc
mov r9d, 0x13b
call fcn.14004dfa0
lea rcx, [rsp + 0x118]
lea rdx, [rsp + 0x80]
call fcn.14004ff90
lea rcx, [rsp + 0x118]
call fcn.140050040
jmp 0x140040286
mov rax, qword [rbx + 8]
mov rbx, qword [rbx]
mov qword [rsp + 0x1b0], rbx
mov qword [rsp + 0x1b8], rax
test rax, rax
js 0x1400408db
test rbx, rbx
jne 0x140040307
test rax, rax
jne 0x1400408ee
lea rbx, [rsp + 0x120]
lea rdx, [rsp + 0x1b0]
mov rcx, rbx
call fcn.1400483e0
mov rcx, rsi
mov rdx, rbx
mov r8d, edi
mov r9d, ebp
call fcn.14003fd20
mov rcx, rbx
call fcn.140047980
jmp 0x1400408a5
mov r8, qword [rdi + 0x28]
mov r9, qword [rdi + 0x30]
cmp r9, r8
je 0x140040962
sub r9d, r8d
and r9d, 0xfffffff8
lea rcx, [rsp + 0x120]
mov edx, 0x20002
call fcn.14004fe90
mov r14b, 1
test al, al
je 0x140040478
cmp byte [rdi + 0x22], 0
je 0x140040380
or byte [rsp + 0x164], 0x80
cmp byte [rdi + 0x48], 0
je 0x140040395
lea rax, [0x1400c1978]
mov qword [rsp + 0x138], rax
mov eax, dword [rsp + 0x164]
mov ecx, eax
or ecx, 1
mov dword [rsp + 0x164], ecx
movzx ecx, byte [rdi + 0x20]
xor ecx, 1
mov word [rsp + 0x168], cx
mov rcx, qword [rdi + 0x58]
mov rdx, qword [rdi + 0x60]
mov r8, qword [rdi + 0x68]
test rcx, rcx
jne 0x1400403d2
test rdx, rdx
jne 0x1400403d2
test r8, r8
je 0x14004041b
mov r9, qword [rdi + 0x28]
cmp r9, qword [rdi + 0x30]
jne 0x1400403f7
test rcx, rcx
je 0x140040975
test rdx, rdx
je 0x140040978
test r8, r8
je 0x14004097b
or eax, 0x101
mov dword [rsp + 0x164], eax
mov qword [rsp + 0x178], rcx
mov qword [rsp + 0x180], rdx
mov qword [rsp + 0x188], r8
cmp qword [rdi + 0x50], 0
je 0x140040438
call fcn.14004c250
lea ecx, [r15 + 0x1000000]
cmp eax, 5
cmovge ecx, r15d
mov r15d, ecx
mov r12d, r15d
or r12d, 0x1000000
cmp byte [rdi + 0x70], 0
cmove r12d, r15d
xorps xmm0, xmm0
movaps xmmword [rsp + 0x100], xmm0
mov qword [rsp + 0x110], 0
movzx eax, byte [rdi + 0x1f]
test al, al
js 0x140040487
lea rcx, [rdi + 8]
xor r15d, r15d
test al, al
cmovne r15, rcx
jmp 0x140040494
mov rcx, rsi
xor edx, edx
call fcn.14003e3e0
jmp 0x14004086c
mov r15, qword [rdi + 0x10]
test r15, r15
je 0x140040494
mov r15, qword [rdi + 8]
mov qword [rsp + 0xf0], rbp
movaps xmmword [rsp + 0xe0], xmm6
cmp byte [rbx + 0x17], 0
js 0x1400404c3
mov rax, qword [rbx + 0x10]
mov qword [rsp + 0xf0], rax
movups xmm0, xmmword [rbx]
movaps xmmword [rsp + 0xe0], xmm0
jmp 0x1400404d7
mov rdx, qword [rbx]
mov r8, qword [rbx + 8]
lea rcx, [rsp + 0xe0]
call fcn.14003c7f6
lea r13, [rsp + 0x128]
mov rdx, qword [rdi + 0x40]
test rdx, rdx
je 0x140040533
mov qword [rsp + 0x80], 0
lea rcx, [rsp + 0x80]
xor r8d, r8d
call sub.USERENV.dll_CreateEnvironmentBlock
test eax, eax
je 0x1400405fd
or r12d, 0x400
mov rdx, qword [rsp + 0x80]
movzx eax, r14b
cmp byte [rsp + 0xf7], 0
jns 0x1400405a1
mov r8, qword [rsp + 0xe0]
jmp 0x1400405a9
xorps xmm0, xmm0
movaps xmmword [rsp + 0x80], xmm0
mov qword [rsp + 0x90], 0
cmp byte [rdi + 0x90], 0
je 0x14004060c
lea r8, [rdi + 0x78]
lea rdx, [0x1400c39bc]
lea rcx, [rsp + 0x60]
call fcn.140050400
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x90], rax
movups xmm0, xmmword [rsp + 0x60]
movaps xmmword [rsp + 0x80], xmm0
cmp byte [rsp + 0x97], 0
jns 0x14004066a
mov rax, qword [rsp + 0x80]
jmp 0x140040672
lea r8, [rsp + 0xe0]
mov rcx, qword [rdi + 0x40]
lea r9, [rsp + 0x100]
mov qword [rsp + 0x50], r9
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x40], r15
mov qword [rsp + 0x38], rdx
mov dword [rsp + 0x30], r12d
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], 0
xor edx, edx
xor r9d, r9d
call qword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov ebx, eax
mov rcx, qword [rsp + 0x80]
call sub.USERENV.dll_DestroyEnvironmentBlock
test ebx, ebx
jne 0x1400406eb
mov rcx, rsi
xor edx, edx
call fcn.14003e3e0
jmp 0x140040855
cmp qword [rdi + 0x88], 0
je 0x1400408d4
call qword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
test rax, rax
je 0x1400405fd
mov rbx, rax
lea r8, [rdi + 0x78]
lea rcx, [rsp + 0x60]
mov rdx, rax
call fcn.140050400
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x90], rax
movups xmm0, xmmword [rsp + 0x60]
movaps xmmword [rsp + 0x80], xmm0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
cmp byte [rsp + 0x97], 0
js 0x140040594
lea rax, [rsp + 0x80]
or r12d, 0x400
movzx ecx, r14b
cmp byte [rsp + 0xf7], 0
jns 0x140040691
mov rdx, qword [rsp + 0xe0]
jmp 0x140040699
lea rdx, [rsp + 0xe0]
lea r8, [rsp + 0x100]
mov qword [rsp + 0x48], r8
mov qword [rsp + 0x40], r13
mov qword [rsp + 0x38], r15
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], r12d
mov dword [rsp + 0x20], ecx
xor ecx, ecx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x1400407db
cmp byte [rsp + 0x97], 0
jns 0x1400406eb
mov rcx, qword [rsp + 0x80]
call fcn.140081c24
mov qword [rsp + 0xd0], rbp
movaps xmmword [rsp + 0xc0], xmm6
lea rcx, [rsp + 0xc0]
lea rdx, [rsp + 0x100]
call fcn.1400508d0
mov rcx, qword [rdi + 0x50]
test rcx, rcx
je 0x14004072f
mov rdx, qword [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_AssignProcessToJobObject]
test eax, eax
je 0x1400407fe
cmp byte [rdi + 0x71], 0
je 0x14004074a
mov rcx, qword [rsp + 0xc0]
call fcn.14004b720
mov ecx, eax
call qword [sym.imp.USER32.dll_AllowSetForegroundWindow]
cmp byte [rdi], 0
je 0x1400407c1
movaps xmmword [rsp + 0xb0], xmm6
movaps xmmword [rsp + 0xa0], xmm6
movaps xmmword [rsp + 0x90], xmm6
movaps xmmword [rsp + 0x80], xmm6
lea rdx, str.LaunchProcess
lea r8, str....._baseprocesslaunch_win.cc
lea rdi, [rsp + 0x60]
mov rcx, rdi
mov r9d, 0x1bc
call fcn.14004dfa0
lea rbx, [rsp + 0x80]
mov rcx, rbx
mov rdx, rdi
xor r8d, r8d
call fcn.140050b10
mov rcx, qword [rsp + 0xc0]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call fcn.140050b90
lea rcx, [rsp + 0xc0]
call fcn.140050ae0
mov rcx, rsi
mov rdx, rax
call fcn.14003e3e0
jmp 0x140040848
mov rcx, rsi
xor edx, edx
call fcn.14003e3e0
cmp byte [rsp + 0x97], 0
jns 0x140040855
mov rcx, qword [rsp + 0x80]
call fcn.140081c24
jmp 0x140040855
movaps xmmword [rsp + 0x80], xmm6
lea rcx, [rsp + 0xc0]
call fcn.140050ae0
lea rdi, [rsp + 0x80]
mov rcx, rdi
mov rdx, rax
call fcn.14003e3e0
mov rcx, rdi
mov edx, 1
mov r8b, 1
call fcn.14003e4b0
mov rcx, rsi
xor edx, edx
call fcn.14003e3e0
mov rcx, rdi
call fcn.14003e460
lea rcx, [rsp + 0xc0]
call fcn.140050a40
cmp byte [rsp + 0xf7], 0
jns 0x14004086c
mov rcx, qword [rsp + 0xe0]
call fcn.140081c24
lea rcx, [rsp + 0x120]
call fcn.14004fd80
lea rcx, [rsp + 0x1a0]
call fcn.14004ed80
mov qword [rsp + 0x80], 0xa
mov rax, qword [0x1400c8f90]
movzx eax, byte [rax + 0xa]
test al, al
jne 0x140040933
mov rcx, qword [rsp + 0x368]
xor rcx, rsp
call fcn.140082fb0
mov rax, rsi
movaps xmm6, xmmword [rsp + 0x370]
add rsp, 0x388
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
xor eax, eax
jmp 0x140040679
lea rcx, [0x1400bf97f]
lea rdx, str....._third_partylibc_srcinclude_string_view:311:_assertion___len___static_cast_size_type__numeric_limits_difference_type_::max____failed:_string_view::string_view__CharT___size_t_:_length_does_not_fit_in_difference_type_n
call fcn.14001b460
lea rcx, [0x1400bf97f]
lea rdx, str....._third_partylibc_srcinclude_string_view:313:_assertion___len__0____s___nullptr_failed:_string_view::string_view__CharT___size_t_:_received_nullptr_n
call fcn.14001b460
movzx ecx, al
lea rax, str.LaunchProcess
mov qword [rsp + 0x120], rax
lea rdx, [rsp + 0x80]
lea r8, [rsp + 0x120]
mov r9d, 1
call fcn.14003e590
jmp 0x1400400fd
movzx ecx, al
mov qword [rsp + 0x120], 0
lea rdx, [rsp + 0x80]
lea r8, [rsp + 0x120]
mov r9d, 2
call fcn.14003f420
jmp 0x1400408a5
lea rcx, [0x1400bf97f]
lea rdx, str....._third_partylibc_srcinclude_vector:1400:_assertion___n___size___failed:_vector___index_out_of_bounds_n
call fcn.14001b460
int3
int3
int3