Function at 0x402062
Capabilities:
Query environment variable

Disassembly:
push rbp
push rdi
sub rsp, 0xe8
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x80], rcx
mov qword [rbp + 0x88], rdx
mov qword [rbp + 0x90], r8
mov dword [rbp + 0x98], r9d
mov qword [rbp + 0x58], 0
mov qword [rbp + 0x50], 0
mov qword [rbp + 0x48], 0
mov qword [rbp + 0x30], 0
mov qword [rbp + 0x18], 0
cmp qword [rbp + 0x80], 0
je 0x4020d5
cmp qword [rbp + 0x88], 0
je 0x4020d5
cmp qword [rbp + 0x90], 0
jne 0x4020df
mov eax, 0
jmp 0x4026c8
mov rcx, qword [rbp + 0x80]
call fcn.004043b4
cmp qword [rbp + 0x80], rax
jne 0x40236e
lea rcx, [0x0040e2e0]
call sub.msvcrt.dll_getenv
mov qword [rbp - 0x10], rax
cmp qword [rbp - 0x10], 0
je 0x40236e
mov rax, qword [rbp - 0x10]
mov rcx, rax
call sub.msvcrt.dll_strlen
add rax, 1
mov qword [rbp - 8], rax
cmp qword [rbp - 8], 1
ja 0x402136
mov qword [rbp - 8], 2
mov rcx, qword [rbp + 0x80]
call sub.msvcrt.dll_strlen
mov rdx, rax
mov rax, qword [rbp - 8]
add rax, rdx
add rax, 1
mov qword [rbp - 0x18], rax
add qword [rbp - 0x18], 4
cmp qword [rbp - 0x18], 0xfbf
ja 0x402196
mov rax, qword [rbp - 0x18]
add rax, 0xf
add rax, 0xf
shr rax, 4
shl rax, 4
call fcn.00407220
sub rsp, rax
lea rax, [rsp + 0x20]
add rax, 0xf
shr rax, 4
shl rax, 4
mov qword [rbp], rax
jmp 0x4021ae
mov rax, qword [rbp - 0x18]
mov rcx, rax
call sub.msvcrt.dll_malloc
mov qword [rbp], rax
mov rax, qword [rbp]
mov qword [rbp + 0x18], rax
mov rax, qword [rbp - 0x10]
mov qword [rbp + 8], rax
mov rax, qword [rbp + 8]
mov qword [rbp + 0x10], rax
mov rax, qword [rbp + 8]
movzx eax, byte [rax]
cmp al, 0x3b
je 0x4021d8
mov rax, qword [rbp + 8]
movzx eax, byte [rax]
test al, al
jne 0x402363
mov rax, qword [rbp + 8]
cmp rax, qword [rbp + 0x10]
jne 0x402204
mov rax, qword [rbp]
mov byte [rax], 0x2e
mov rax, qword [rbp]
add rax, 1
mov byte [rax], 0x2f
mov rax, qword [rbp]
add rax, 2
mov byte [rax], 0
jmp 0x40229a
mov rdx, qword [rbp + 8]
mov rax, qword [rbp + 0x10]
sub rdx, rax
mov rax, rdx
mov rcx, rax
mov rdx, qword [rbp + 0x10]
mov rax, qword [rbp]
mov r8, rcx
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov rax, qword [rbp + 8]
sub rax, 1
movzx eax, byte [rax]
cmp al, 0x2f
je 0x40227f
mov rax, qword [rbp + 8]
sub rax, 1
movzx eax, byte [rax]
cmp al, 0x5c
je 0x40227f
mov rdx, qword [rbp + 8]
mov rax, qword [rbp + 0x10]
sub rdx, rax
mov rax, rdx
mov rdx, rax
mov rax, qword [rbp]
add rax, rdx
mov byte [rax], 0x2f
mov rdx, qword [rbp + 8]
mov rax, qword [rbp + 0x10]
sub rdx, rax
mov rax, rdx
lea rdx, [rax + 1]
mov rax, qword [rbp]
add rax, rdx
mov byte [rax], 0
jmp 0x40229a
mov rdx, qword [rbp + 8]
mov rax, qword [rbp + 0x10]
sub rdx, rax
mov rax, rdx
mov rdx, rax
mov rax, qword [rbp]
add rax, rdx
mov byte [rax], 0
mov rax, qword [rbp]
mov rdx, qword [rbp + 0x80]
mov rcx, rax
call sub.msvcrt.dll_strcat
mov rax, qword [rbp]
mov edx, 1
mov rcx, rax
call fcn.00401c40
test eax, eax
je 0x40230a
mov rax, qword [rbp]
mov rcx, 0xffffffffffffffff
mov rdx, rax
mov eax, 0
mov rdi, rdx
repne scasb al, byte [rdi]
mov rax, rcx
not rax
lea rdx, [rax - 1]
mov rax, qword [rbp]
add rax, rdx
mov dword [rax], 0x6578652e
mov byte [rax + 4], 0
mov rax, qword [rbp]
mov edx, 1
mov rcx, rax
call fcn.00401c40
test eax, eax
jne 0x402342
lea rdx, [rbp - 0x60]
mov rax, qword [rbp]
mov rcx, rax
mov rax, qword [sym.imp.msvcrt.dll__stat64]
call rax
test eax, eax
js 0x402342
movzx eax, word [rbp - 0x5a]
movzx eax, ax
and eax, 0xf000
cmp eax, 0x8000
jne 0x402342
mov rax, qword [rbp]
mov qword [rbp + 0x80], rax
jmp 0x40236e
mov rax, qword [rbp + 8]
movzx eax, byte [rax]
test al, al
je 0x40236d
mov rax, qword [rbp + 8]
add rax, 1
mov qword [rbp + 0x10], rax
mov rax, qword [rbp + 0x10]
mov qword [rbp + 8], rax
jmp 0x402368
add qword [rbp + 8], 1
jmp 0x4021be
nop
cmp dword [rbp + 0x98], 0
je 0x402389
mov rcx, qword [rbp + 0x80]
call fcn.004043d0
mov qword [rbp + 0x20], rax
jmp 0x402399
mov rcx, qword [rbp + 0x80]
call sub.msvcrt.dll__strdup
mov qword [rbp + 0x20], rax
cmp qword [rbp + 0x20], 0
je 0x402681
lea rdx, [rbp - 0x20]
mov rax, qword [rbp + 0x20]
mov rcx, rax
call fcn.00401cc0
mov qword [rbp + 0x58], rax
mov rax, qword [rbp + 0x20]
mov rcx, rax
call sub.msvcrt.dll_free
cmp qword [rbp + 0x58], 0
je 0x402684
lea rdx, [rbp - 0x24]
mov rax, qword [rbp + 0x88]
mov rcx, rax
call fcn.00401cc0
mov qword [rbp + 0x50], rax
cmp qword [rbp + 0x50], 0
je 0x402687
mov eax, dword [rbp - 0x20]
sub eax, 1
mov dword [rbp - 0x20], eax
mov edx, dword [rbp - 0x20]
mov eax, dword [rbp - 0x24]
cmp edx, eax
jne 0x40246d
mov dword [rbp + 0x44], 0
jmp 0x40244b
mov eax, dword [rbp + 0x44]
cdqe
lea rdx, [rax*8]
mov rax, qword [rbp + 0x50]
add rax, rdx
mov rdx, qword [rax]
mov eax, dword [rbp + 0x44]
cdqe
lea rcx, [rax*8]
mov rax, qword [rbp + 0x58]
add rax, rcx
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402455
add dword [rbp + 0x44], 1
mov eax, dword [rbp - 0x24]
cmp dword [rbp + 0x44], eax
jl 0x40240d
jmp 0x402456
nop
mov eax, dword [rbp - 0x20]
test eax, eax
jle 0x40268a
mov eax, dword [rbp - 0x24]
cmp dword [rbp + 0x44], eax
je 0x40268a
lea rdx, [rbp - 0x28]
mov rax, qword [rbp + 0x90]
mov rcx, rax
call fcn.00401cc0
mov qword [rbp + 0x48], rax
cmp qword [rbp + 0x48], 0
je 0x40268d
mov edx, dword [rbp - 0x24]
mov eax, dword [rbp - 0x28]
cmp edx, eax
cmovle eax, edx
mov dword [rbp - 0x1c], eax
mov dword [rbp + 0x40], 0
jmp 0x4024e4
mov eax, dword [rbp + 0x40]
cdqe
lea rdx, [rax*8]
mov rax, qword [rbp + 0x48]
add rax, rdx
mov rdx, qword [rax]
mov eax, dword [rbp + 0x40]
cdqe
lea rcx, [rax*8]
mov rax, qword [rbp + 0x50]
add rax, rcx
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4024ee
add dword [rbp + 0x40], 1
mov eax, dword [rbp + 0x40]
cmp eax, dword [rbp - 0x1c]
jl 0x4024a6
jmp 0x4024ef
nop
cmp dword [rbp + 0x40], 0
je 0x402690
mov dword [rbp + 0x3c], 0
mov dword [rbp + 0x44], 0
jmp 0x402536
mov eax, dword [rbp + 0x44]
cdqe
lea rdx, [rax*8]
mov rax, qword [rbp + 0x58]
add rax, rdx
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_strlen
mov edx, eax
mov eax, dword [rbp + 0x3c]
add eax, edx
mov dword [rbp + 0x3c], eax
add dword [rbp + 0x44], 1
mov eax, dword [rbp - 0x20]
cmp dword [rbp + 0x44], eax
jl 0x402509
mov eax, dword [rbp - 0x24]
sub eax, dword [rbp + 0x40]
cdqe
mov edx, eax
mov eax, edx
add eax, eax
add edx, eax
mov eax, dword [rbp + 0x3c]
add eax, edx
mov dword [rbp + 0x3c], eax
mov eax, dword [rbp + 0x40]
mov dword [rbp + 0x44], eax
jmp 0x40258b
mov eax, dword [rbp + 0x44]
cdqe
lea rdx, [rax*8]
mov rax, qword [rbp + 0x48]
add rax, rdx
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_strlen
mov edx, eax
mov eax, dword [rbp + 0x3c]
add eax, edx
mov dword [rbp + 0x3c], eax
add dword [rbp + 0x44], 1
mov eax, dword [rbp - 0x28]
cmp dword [rbp + 0x44], eax
jl 0x40255e
add dword [rbp + 0x3c], 1
mov eax, dword [rbp + 0x3c]
cdqe
mov rcx, rax
call sub.msvcrt.dll_malloc
mov qword [rbp + 0x30], rax
cmp qword [rbp + 0x30], 0
je 0x402693
mov rax, qword [rbp + 0x30]
mov byte [rax], 0
mov dword [rbp + 0x44], 0
jmp 0x4025ea
mov eax, dword [rbp + 0x44]
cdqe
lea rdx, [rax*8]
mov rax, qword [rbp + 0x58]
add rax, rdx
mov rdx, qword [rax]
mov rax, qword [rbp + 0x30]
mov rcx, rax
call sub.msvcrt.dll_strcat
add dword [rbp + 0x44], 1
mov eax, dword [rbp - 0x20]
cmp dword [rbp + 0x44], eax
jl 0x4025c3
mov rax, qword [rbp + 0x30]
mov rcx, rax
call sub.msvcrt.dll_strlen
mov rdx, rax
mov rax, qword [rbp + 0x30]
add rax, rdx
mov qword [rbp + 0x28], rax
mov eax, dword [rbp + 0x40]
mov dword [rbp + 0x44], eax
jmp 0x402639
mov rax, qword [rbp + 0x28]
mov word [rax], 0x2e2e
mov byte [rax + 2], 0
add qword [rbp + 0x28], 2
mov rax, qword [rbp + 0x28]
lea rdx, [rax + 1]
mov qword [rbp + 0x28], rdx
mov byte [rax], 0x2f
add dword [rbp + 0x44], 1
mov eax, dword [rbp - 0x24]
cmp dword [rbp + 0x44], eax
jl 0x402614
mov rax, qword [rbp + 0x28]
mov byte [rax], 0
mov eax, dword [rbp + 0x40]
mov dword [rbp + 0x44], eax
jmp 0x402677
mov eax, dword [rbp + 0x44]
cdqe
lea rdx, [rax*8]
mov rax, qword [rbp + 0x48]
add rax, rdx
mov rdx, qword [rax]
mov rax, qword [rbp + 0x30]
mov rcx, rax
call sub.msvcrt.dll_strcat
add dword [rbp + 0x44], 1
mov eax, dword [rbp - 0x28]
cmp dword [rbp + 0x44], eax
jl 0x402650
jmp 0x40268a
nop
jmp 0x402694
nop
jmp 0x402694
nop
jmp 0x402694
nop
jmp 0x402694
nop
jmp 0x402694
nop
jmp 0x402694
nop
mov rax, qword [rbp + 0x58]
mov rcx, rax
call fcn.00401ff5
mov rax, qword [rbp + 0x50]
mov rcx, rax
call fcn.00401ff5
mov rax, qword [rbp + 0x48]
mov rcx, rax
call fcn.00401ff5
mov rax, qword [rbp + 0x18]
mov rcx, rax
call sub.msvcrt.dll_free
mov rax, qword [rbp + 0x30]
lea rsp, [rbp + 0x68]
pop rdi
pop rbp
ret