Function at 0x401f10
Capabilities:
Query environment variable

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x98
lea rbp, [rsp + 0x80]
test rdx, rdx
mov rdi, rdx
mov rsi, rcx
sete dl
test r8, r8
mov r12, r8
sete al
mov r14d, r9d
or dl, al
jne 0x4020d1
test rcx, rcx
je 0x4020d1
call fcn.00403850
cmp rax, rsi
je 0x402240
mov qword [rbp - 0x48], 0
test r14d, r14d
mov rcx, rsi
jne 0x4020a0
call sub.msvcrt.dll__strdup
mov rbx, rax
test rbx, rbx
je 0x4020b1
lea rdx, [rbp - 0x38]
mov rcx, rbx
call fcn.00401d00
mov rcx, rbx
mov r13, rax
call sub.msvcrt.dll_free
test r13, r13
je 0x4020b1
lea rdx, [rbp - 0x34]
mov rcx, rdi
call fcn.00401d00
test rax, rax
mov rsi, rax
je 0x4023e0
mov eax, dword [rbp - 0x38]
mov r15d, dword [rbp - 0x34]
lea edi, [rax - 1]
cmp edi, r15d
mov dword [rbp - 0x38], edi
jne 0x40201b
test edi, edi
jle 0x402427
sub eax, 2
xor ebx, ebx
mov qword [rbp - 0x50], rax
jmp 0x401ff5
cmp rbx, qword [rbp - 0x50]
lea r14d, [rbx + 1]
lea rax, [rbx + 1]
je 0x40200a
mov rbx, rax
mov rdx, qword [rsi + rbx*8]
mov r14d, ebx
mov rcx, qword [r13 + rbx*8]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x401fe4
cmp r15d, r14d
je 0x4020e0
test edi, edi
jle 0x4020e0
lea rdx, [rbp - 0x30]
mov rcx, r12
call fcn.00401d00
test rax, rax
mov rdi, rax
je 0x4020e0
mov ebx, dword [rbp - 0x34]
mov eax, dword [rbp - 0x30]
mov dword [rbp - 0x50], ebx
cmp ebx, eax
mov dword [rbp - 0x58], eax
cmovle eax, ebx
test eax, eax
jle 0x40241f
lea r12d, [rax - 1]
xor r14d, r14d
jmp 0x402069
lea ebx, [r14 + 1]
cmp r12, r14
lea rax, [r14 + 1]
je 0x4020f2
mov r14, rax
mov rdx, qword [rdi + r14*8]
mov ebx, r14d
mov rcx, qword [rsi + r14*8]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x402055
xor r12d, r12d
test r14d, r14d
jne 0x4020f2
mov rcx, r13
call fcn.00401cc0
mov rcx, rsi
call fcn.00401cc0
mov rcx, rdi
call fcn.00401cc0
jmp 0x4020b4
call fcn.00403860
mov rbx, rax
test rbx, rbx
jne 0x401f87
xor r12d, r12d
mov rcx, qword [rbp - 0x48]
call sub.msvcrt.dll_free
mov rax, r12
lea rsp, [rbp + 0x18]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
xor r12d, r12d
jmp 0x4020bd
mov rcx, r13
call fcn.00401cc0
mov rcx, rsi
call fcn.00401cc0
jmp 0x4020b1
mov eax, dword [rbp - 0x38]
test eax, eax
jle 0x402418
sub eax, 1
mov r14, r13
xor r12d, r12d
lea r15, [r13 + rax*8 + 8]
nop dword [rax + rax]
mov rcx, qword [r14]
add r14, 8
call sub.msvcrt.dll_strlen
add eax, r12d
cmp r15, r14
mov r12d, eax
jne 0x402110
mov edx, dword [rbp - 0x50]
sub edx, ebx
lea r12d, [rdx + rdx*2]
add r12d, eax
mov eax, dword [rbp - 0x58]
cmp ebx, eax
jge 0x402164
sub eax, 1
movsxd rcx, ebx
lea r14, [rdi + rcx*8]
sub eax, ebx
add rax, rcx
lea r15, [rdi + rax*8 + 8]
nop
mov rcx, qword [r14]
add r14, 8
call sub.msvcrt.dll_strlen
add r12d, eax
cmp r15, r14
jne 0x402150
lea eax, [r12 + 1]
movsxd rcx, eax
call sub.msvcrt.dll_malloc
test rax, rax
mov r12, rax
je 0x402085
mov byte [rax], 0
mov eax, dword [rbp - 0x38]
test eax, eax
jle 0x4021a6
sub eax, 1
mov r14, r13
lea r15, [r13 + rax*8 + 8]
mov rdx, qword [r14]
mov rcx, r12
add r14, 8
call sub.msvcrt.dll_strcat
cmp r15, r14
jne 0x402192
mov rax, r12
mov ecx, dword [rax]
add rax, 4
lea edx, [rcx - 0x1010101]
not ecx
and edx, ecx
and edx, 0x80808080
je 0x4021a9
mov ecx, edx
shr ecx, 0x10
test edx, 0x8080
cmove edx, ecx
lea rcx, [rax + 2]
cmove rax, rcx
mov ecx, edx
add cl, dl
mov edx, dword [rbp - 0x34]
sbb rax, 3
cmp ebx, edx
jge 0x40220d
sub edx, 1
sub edx, ebx
lea rdx, [rdx + rdx*2 + 3]
add rdx, rax
mov ecx, 0x2e2e
mov byte [rax + 2], 0
add rax, 3
mov word [rax - 3], cx
cmp rax, rdx
mov byte [rax - 1], 0x2f
jne 0x4021f3
mov r14d, dword [rbp - 0x30]
mov byte [rax], 0
cmp ebx, r14d
jge 0x402085
movsxd rbx, ebx
mov rdx, qword [rdi + rbx*8]
mov rcx, r12
add rbx, 1
call sub.msvcrt.dll_strcat
cmp r14d, ebx
jg 0x402220
jmp 0x402085
lea rcx, [0x0040d280]
call sub.msvcrt.dll_getenv
test rax, rax
je 0x401f62
mov rcx, rax
mov qword [rbp - 0x48], rax
call sub.msvcrt.dll_strlen
mov rcx, rsi
lea rbx, [rax + 1]
mov eax, 2
cmp rbx, 1
cmove rbx, rax
call sub.msvcrt.dll_strlen
mov rdx, qword [rbp - 0x48]
add rax, rbx
lea rcx, [rax + 5]
cmp rcx, 0xfbf
ja 0x4023f0
add rax, 0x14
and rax, 0xfffffffffffffff0
call fcn.00405f50
sub rsp, rax
mov qword [rbp - 0x48], 0
lea rbx, [rsp + 0x20]
lea rax, [rbp - 0x30]
mov r15, rdx
mov r13, qword [sym.imp.msvcrt.dll__access]
mov qword [rbp - 0x58], rax
jmp 0x4022c6
mov r15, rcx
movzx eax, byte [r15]
cmp al, 0x3b
je 0x4022d6
lea rcx, [r15 + 1]
test al, al
jne 0x4022c3
cmp rdx, r15
je 0x4023b3
mov r10, r15
mov rcx, rbx
sub r10, rdx
mov r8, r10
mov qword [rbp - 0x50], r10
call sub.msvcrt.dll_memcpy
movzx eax, byte [r15 - 1]
mov r10, qword [rbp - 0x50]
cmp al, 0x2f
lea rdx, [rbx + r10]
je 0x4023d0
cmp al, 0x5c
je 0x4023d0
mov byte [rdx], 0x2f
mov byte [rbx + r10 + 1], 0
mov rdx, rsi
mov rcx, rbx
call sub.msvcrt.dll_strcat
xor edx, edx
mov rcx, rbx
call r13
test eax, eax
je 0x40237e
mov rdx, rbx
mov ecx, dword [rdx]
add rdx, 4
lea eax, [rcx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x402334
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea rcx, [rdx + 2]
cmove rdx, rcx
mov ecx, eax
add cl, al
mov rcx, rbx
sbb rdx, 3
mov dword [rdx], 0x6578652e
mov byte [rdx + 4], 0
xor edx, edx
call r13
test eax, eax
jne 0x40239d
mov rdx, qword [rbp - 0x58]
mov rcx, rbx
call qword [sym.imp.msvcrt.dll__stat64]
test eax, eax
js 0x40239d
movzx eax, word [rbp - 0x2a]
and ax, 0xf000
cmp ax, 0x8000
je 0x402410
cmp byte [r15], 0
je 0x401f6a
lea rcx, [r15 + 1]
mov rdx, rcx
jmp 0x4022c3
mov r8d, 0x2f2e
mov byte [rbx + 2], 0
mov word [rbx], r8w
jmp 0x40231a
mov byte [rdx], 0
jmp 0x40231a
mov rcx, r13
xor r12d, r12d
call fcn.00401cc0
jmp 0x4020b4
mov qword [rbp - 0x50], rdx
call sub.msvcrt.dll_malloc
mov rdx, qword [rbp - 0x50]
mov qword [rbp - 0x48], rax
mov rbx, rax
jmp 0x4022af
mov rsi, rbx
jmp 0x401f6a
xor eax, eax
jmp 0x402127
xor r12d, r12d
jmp 0x402085
xor r14d, r14d
jmp 0x40200a