Function at 0x140047220
Capabilities:
Query environment variable

Disassembly:
mov qword [rsp + 8], rcx
push rbx
push rdi
sub rsp, 0x108
mov r8b, 1
xor edx, edx
mov rdi, rcx
call fcn.1400266d0
mov rbx, rax
test rax, rax
jne 0x14004724d
add rsp, 0x108
pop rdi
pop rbx
ret
cmp byte [rax + 0x23], 0
jne 0x140047257
mov rbx, qword [rax + 0x10]
movzx r10d, byte [rdi + 1]
mov qword [rsp + 0xf0], r12
cmp r10b, 1
jbe 0x14004729c
mov rax, qword [rdi + 8]
mov rdx, qword [rax + 0x38]
test rdx, rdx
je 0x14004729c
mov rdx, qword [rdx]
mov r8b, reloc.OLEAUT32.dll_SafeArrayGetElement
mov rcx, rbx
call fcn.1400012a0
mov r12, qword [rsp + 0xf0]
mov eax, 1
add rsp, 0x108
pop rdi
pop rbx
ret
mov qword [rsp + 0x100], rbp
mov qword [rsp + 0xe0], r14
xor r14d, r14d
mov qword [rsp + 0xd8], r15
cmp r10b, 2
jb 0x1400473af
mov rcx, qword [rdi + 8]
mov rax, qword [rcx + 0x30]
test rax, rax
je 0x1400473af
cmp qword [rax], r14
je 0x1400473af
mov r8, qword [rcx + 0x30]
lea rbp, [rcx + 0x20]
mov r15, qword [r8 + 8]
movzx ecx, byte [r15 + 0x23]
test cl, cl
jne 0x1400472fa
mov rax, qword [r15 + 0x10]
movzx edx, byte [rax + 0x23]
jmp 0x1400472fd
movzx edx, cl
cmp dl, 3
jne 0x140047335
movzx eax, byte [rbx + 0x23]
cmp al, 2
jne 0x140047318
mov r12d, 1
mov eax, r12d
jmp 0x14004788b
test al, al
jne 0x140047320
mov rbx, qword [rbx + 0x10]
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call fcn.14008bc10
mov r12d, eax
jmp 0x14004788b
test cl, cl
jne 0x140047344
mov rax, qword [r15 + 0x10]
movzx r9d, byte [rax + 0x21]
jmp 0x140047349
movzx r9d, byte [r15 + 0x21]
test r9b, 1
je 0x14004735f
mov rdx, r15
mov rcx, rbx
call fcn.14008bfb0
jmp 0x14004788b
cmp qword [r8 + 0x18], r14
jne 0x1400473b2
movzx eax, word [rbp + 2]
cmp word [r8 + 0x12], ax
jne 0x1400473b2
cmp dl, 1
jne 0x1400473a8
mov rax, qword [0x1400fda58]
cmp byte [rax + 0x134], r14b
je 0x140047398
test cl, cl
jne 0x14004738f
mov rax, qword [r15 + 0x10]
jmp 0x140047392
mov rax, r15
test byte [rax + 0x21], 8
je 0x1400473a8
mov rdx, r15
mov rcx, rbx
call fcn.14008b990
jmp 0x14004788b
mov qword [rsp + 0x38], r15
jmp 0x1400473ba
mov rbp, r14
mov qword [rsp + 0x38], r14
mov r15, r14
xor r9b, r9b
mov qword [rsp + 0xf8], rsi
xor r8b, r8b
mov byte [rsp + 0x130], r9b
mov byte [rsp + 0x128], r8b
mov r12d, 1
test rbp, rbp
je 0x1400474ab
movzx eax, byte [rbx + 0x23]
test al, al
jne 0x1400473f7
mov rax, qword [rbx + 0x10]
movzx eax, byte [rax + 0x23]
cmp al, 2
je 0x1400474ab
mov rcx, qword [rbp + 0x10]
mov rdx, qword [rcx]
test rdx, rdx
je 0x1400474ab
nop
mov rax, qword [rcx + 8]
test r8b, r8b
je 0x14004746b
cmp byte [rax + 0x23], r14b
jne 0x140047423
mov rax, qword [rax + 0x10]
cmp rax, rbx
jne 0x140047498
xor r8b, r8b
mov byte [rsp + 0x128], r8b
test r9b, r9b
je 0x1400474ab
test r8b, r8b
jne 0x1400474ab
xor r9d, r9d
or r8, 0xffffffffffffffff
xor edx, edx
mov rcx, rdi
call fcn.1400694b0
cmp eax, r12d
jne 0x1400476f7
mov edx, r12d
mov rcx, rdi
call fcn.1400263f0
lea rsi, [rax + 1]
jmp 0x140047694
cmp byte [rax + 0x23], r14b
jne 0x140047475
mov rax, qword [rax + 0x10]
cmp rax, rbx
jne 0x140047498
movzx r9d, r12b
mov byte [rsp + 0x130], r12b
cmp rdx, qword [rbp + 8]
jne 0x14004743d
movzx r8d, r12b
mov byte [rsp + 0x128], r12b
mov rdx, qword [rcx + 0x18]
add rcx, 0x18
test rdx, rdx
jne 0x140047410
jmp 0x140047433
cmp r10b, 2
jb 0x140047868
mov qword [rsp + 0xe8], r13
test r15, r15
je 0x1400475a7
movzx ecx, byte [r15 + 0x23]
test ecx, ecx
je 0x140047590
sub ecx, r12d
je 0x140047523
sub ecx, r12d
je 0x1400474fc
cmp ecx, r12d
je 0x14004759e
mov rdx, qword [r15 + 0x28]
xor ecx, ecx
call qword [r15 + reloc.OLEAUT32.dll_SafeArrayGetElement]
mov r14, rax
lea rsi, [rax + 1]
jmp 0x14004768c
xor edx, edx
lea rcx, [0x140107068]
call fcn.140004bb0
mov r13d, 0xffffffff
cmp rax, r13
cmove rax, r14
mov r14, rax
lea rsi, [rax + 1]
jmp 0x14004768c
mov rcx, r15
call fcn.140001340
cmp dword [0x140102d04], r14d
jne 0x140047577
cmp qword [r15 + 0x10], r14
jne 0x140047577
mov rcx, qword [r15 + 0x28]
lea rdx, [rsp + 0x138]
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x140047567
mov qword [0x140108a10], r14
lea r14d, [rax - 1]
lea rsi, [r14 + 1]
jmp 0x14004768c
mov qword [0x140108a10], r15
lea rsi, [r14 + 1]
jmp 0x14004768c
mov r14, qword [r15 + 0x10]
shr r14, 1
lea rsi, [r14 + 1]
jmp 0x14004768c
mov rcx, qword [r15 + 0x10]
xor edx, edx
call fcn.14008c6d0
mov r14, rax
lea rsi, [r14 + 1]
jmp 0x14004768c
mov rax, qword [rdi + 8]
movzx esi, word [rax + 0x22]
inc esi
test rbp, rbp
je 0x14004768c
mov rbp, qword [rbp + 0x10]
cmp qword [rbp], r14
je 0x14004768c
mov r13d, 0xffffffff
nop
mov rdi, qword [rbp + 8]
movzx eax, word [rbp + 0x12]
sub rsi, rax
movzx ecx, byte [rdi + 0x23]
test ecx, ecx
je 0x140047670
sub ecx, r12d
je 0x140047618
sub ecx, r12d
je 0x140047601
cmp ecx, r12d
je 0x14004765a
mov rdx, qword [rdi + 0x28]
xor ecx, ecx
call qword [rdi + reloc.OLEAUT32.dll_SafeArrayGetElement]
jmp 0x14004767b
xor edx, edx
lea rcx, [0x140107068]
call fcn.140004bb0
cmp rax, r13
cmove rax, r14
jmp 0x14004767b
mov rcx, rdi
call fcn.140001340
cmp dword [0x140102d04], r14d
jne 0x14004765f
cmp qword [rdi + 0x10], r14
jne 0x14004765f
mov rcx, qword [rdi + 0x28]
lea rdx, [rsp + 0x138]
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x140047653
mov qword [0x140108a10], r14
dec eax
jmp 0x14004767b
mov qword [0x140108a10], rdi
mov rax, r14
jmp 0x14004767b
mov rax, qword [rdi + 0x10]
shr rax, 1
jmp 0x14004767b
mov rcx, qword [rdi + 0x10]
xor edx, edx
call fcn.14008c6d0
add rbp, 0x18
add rsi, rax
cmp qword [rbp], r14
jne 0x1400475d0
mov r13, qword [rsp + 0xe8]
cmp rsi, 2
jb 0x140047868
movzx edi, byte [rsp + 0x128]
test dil, dil
je 0x1400476fe
cmp byte [rbx + 0x23], 0
jne 0x1400476b7
mov rax, qword [rbx + 0x10]
jmp 0x1400476ba
mov rax, rbx
cmp byte [rax + 0x23], 2
jne 0x1400476c8
mov eax, dword [0x140107090]
jmp 0x1400476cc
mov rax, qword [rax + 0x18]
mov rbp, qword [rsp + 0x120]
shr rax, 1
cmp rsi, rax
jbe 0x1400477b6
lea r9, [rsp + 0x30]
mov r8, rsi
xor edx, edx
mov rcx, rbp
call fcn.1400694b0
cmp eax, r12d
je 0x140047706
xor eax, eax
jmp 0x140047883
mov rbp, qword [rsp + 0x120]
cmp byte [rsp + 0x130], 0
je 0x1400477b6
mov rdx, qword [0x140106258]
xor r9d, r9d
or r8, 0xffffffffffffffff
mov byte [rsp + 0x20], r12b
mov rcx, rbx
call fcn.14008c280
test eax, eax
je 0x1400476f7
mov rax, qword [0x1400fda58]
cmp byte [rax + 0x134], 0
je 0x140047863
xor r8d, r8d
mov edx, r12d
mov rcx, rbx
call fcn.140001470
mov rdi, rax
cmp word [rax], 0
je 0x140047863
mov rcx, rbx
call fcn.140016970
mov rdx, rax
mov rcx, rdi
call fcn.140016440
mov rdx, rax
mov rcx, rbx
call fcn.140016920
cmp byte [rbx + 0x23], 0
jne 0x14004778a
mov rbx, qword [rbx + 0x10]
cmp byte [rbx + 0x23], 2
jne 0x14004785f
cmp qword [0x140107080], 0
je 0x14004785f
lea rcx, [0x140107068]
call fcn.140004f50
mov eax, r12d
jmp 0x140047883
test dil, dil
jne 0x1400477da
lea r8, [rsi - 1]
mov byte [rsp + 0x20], r12b
xor r9d, r9d
xor edx, edx
mov rcx, rbx
call fcn.14008c280
cmp eax, r12d
jne 0x1400476f7
xor r8d, r8d
mov edx, r12d
mov rcx, rbx
call fcn.140001470
mov r9, r15
mov r8d, r12d
mov rdx, rax
mov rcx, rbp
mov rdi, rax
call fcn.140069e50
mov rdx, rax
test rax, rax
je 0x1400476f7
mov rax, qword [0x1400fda58]
sub rdx, rdi
sar rdx, 1
dec rdx
cmp byte [rax + 0x134], 0
je 0x14004782c
mov rcx, rdi
call fcn.140016440
mov rdx, rax
mov rcx, rbx
call fcn.140016920
cmp byte [rbx + 0x23], 0
jne 0x14004783e
mov rbx, qword [rbx + 0x10]
cmp byte [rbx + 0x23], 2
jne 0x14004785f
cmp qword [0x140107080], 0
je 0x14004785f
lea rcx, [0x140107068]
call fcn.140004f50
mov r12d, eax
jmp 0x140047883
and byte [rbx + 0x21], 0x86
mov eax, r12d
jmp 0x140047883
xor r9d, r9d
mov byte [rsp + 0x20], r12b
or r8, 0xffffffffffffffff
lea rdx, [0x1400ccf5c]
mov rcx, rbx
call fcn.14008c280
mov rsi, qword [rsp + 0xf8]
mov rbp, qword [rsp + 0x100]
mov r14, qword [rsp + 0xe0]
mov r15, qword [rsp + 0xd8]
mov r12, qword [rsp + 0xf0]
add rsp, 0x108
pop rdi
pop rbx
ret