Function at 0x4d530d
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 0x4d5380
cmp qword [rbp + 0x88], 0
je 0x4d5380
cmp qword [rbp + 0x90], 0
jne 0x4d538a
mov eax, 0
jmp 0x4d5973
mov rcx, qword [rbp + 0x80]
call fcn.004d4e44
cmp qword [rbp + 0x80], rax
jne 0x4d5619
lea rcx, [0x00526ce0]
call sub.msvcrt.dll_getenv
mov qword [rbp - 0x10], rax
cmp qword [rbp - 0x10], 0
je 0x4d5619
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 0x4d53e1
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 0x4d5441
mov rax, qword [rbp - 0x18]
add rax, 0xf
add rax, 0xf
shr rax, 4
shl rax, 4
call fcn.004d8d40
sub rsp, rax
lea rax, [rsp + 0x20]
add rax, 0xf
shr rax, 4
shl rax, 4
mov qword [rbp], rax
jmp 0x4d5459
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 0x4d5483
mov rax, qword [rbp + 8]
movzx eax, byte [rax]
test al, al
jne 0x4d560e
mov rax, qword [rbp + 8]
cmp rax, qword [rbp + 0x10]
jne 0x4d54af
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 0x4d5545
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 0x4d552a
mov rax, qword [rbp + 8]
sub rax, 1
movzx eax, byte [rax]
cmp al, 0x5c
je 0x4d552a
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 0x4d5545
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.004d4f00
test eax, eax
je 0x4d55b5
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.004d4f00
test eax, eax
jne 0x4d55ed
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 0x4d55ed
movzx eax, word [rbp - 0x5a]
movzx eax, ax
and eax, 0xf000
cmp eax, 0x8000
jne 0x4d55ed
mov rax, qword [rbp]
mov qword [rbp + 0x80], rax
jmp 0x4d5619
mov rax, qword [rbp + 8]
movzx eax, byte [rax]
test al, al
je 0x4d5618
mov rax, qword [rbp + 8]
add rax, 1
mov qword [rbp + 0x10], rax
mov rax, qword [rbp + 0x10]
mov qword [rbp + 8], rax
jmp 0x4d5613
add qword [rbp + 8], 1
jmp 0x4d5469
nop
cmp dword [rbp + 0x98], 0
je 0x4d5634
mov rcx, qword [rbp + 0x80]
call fcn.004d4e60
mov qword [rbp + 0x20], rax
jmp 0x4d5644
mov rcx, qword [rbp + 0x80]
call sub.msvcrt.dll__strdup
mov qword [rbp + 0x20], rax
cmp qword [rbp + 0x20], 0
je 0x4d592c
lea rdx, [rbp - 0x20]
mov rax, qword [rbp + 0x20]
mov rcx, rax
call fcn.004d4f80
mov qword [rbp + 0x58], rax
mov rax, qword [rbp + 0x20]
mov rcx, rax
call sub.msvcrt.dll_free
cmp qword [rbp + 0x58], 0
je 0x4d592f
lea rdx, [rbp - 0x24]
mov rax, qword [rbp + 0x88]
mov rcx, rax
call fcn.004d4f80
mov qword [rbp + 0x50], rax
cmp qword [rbp + 0x50], 0
je 0x4d5932
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 0x4d5718
mov dword [rbp + 0x44], 0
jmp 0x4d56f6
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 0x4d5700
add dword [rbp + 0x44], 1
mov eax, dword [rbp - 0x24]
cmp dword [rbp + 0x44], eax
jl 0x4d56b8
jmp 0x4d5701
nop
mov eax, dword [rbp - 0x20]
test eax, eax
jle 0x4d5935
mov eax, dword [rbp - 0x24]
cmp dword [rbp + 0x44], eax
je 0x4d5935
lea rdx, [rbp - 0x28]
mov rax, qword [rbp + 0x90]
mov rcx, rax
call fcn.004d4f80
mov qword [rbp + 0x48], rax
cmp qword [rbp + 0x48], 0
je 0x4d5938
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 0x4d578f
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 0x4d5799
add dword [rbp + 0x40], 1
mov eax, dword [rbp + 0x40]
cmp eax, dword [rbp - 0x1c]
jl 0x4d5751
jmp 0x4d579a
nop
cmp dword [rbp + 0x40], 0
je 0x4d593b
mov dword [rbp + 0x3c], 0
mov dword [rbp + 0x44], 0
jmp 0x4d57e1
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 0x4d57b4
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 0x4d5836
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 0x4d5809
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 0x4d593e
mov rax, qword [rbp + 0x30]
mov byte [rax], 0
mov dword [rbp + 0x44], 0
jmp 0x4d5895
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 0x4d586e
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 0x4d58e4
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 0x4d58bf
mov rax, qword [rbp + 0x28]
mov byte [rax], 0
mov eax, dword [rbp + 0x40]
mov dword [rbp + 0x44], eax
jmp 0x4d5922
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 0x4d58fb
jmp 0x4d5935
nop
jmp 0x4d593f
nop
jmp 0x4d593f
nop
jmp 0x4d593f
nop
jmp 0x4d593f
nop
jmp 0x4d593f
nop
jmp 0x4d593f
nop
mov rax, qword [rbp + 0x58]
mov rcx, rax
call fcn.004d52a0
mov rax, qword [rbp + 0x50]
mov rcx, rax
call fcn.004d52a0
mov rax, qword [rbp + 0x48]
mov rcx, rax
call fcn.004d52a0
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