Function at 0x4d03b0
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 r13d, r9d
or dl, al
jne 0x4d05a4
test rcx, rcx
je 0x4d05a4
call fcn.004d00a0
xor r14d, r14d
cmp rax, rsi
je 0x4d05b0
test r13d, r13d
mov rcx, rsi
jne 0x4d0570
call sub.msvcrt.dll__strdup
mov r13, rax
xor ebx, ebx
test r13, r13
je 0x4d054a
lea rdx, [rbp - 0x38]
mov rcx, r13
call fcn.004d0190
mov rcx, r13
mov rsi, rax
call fcn.004d4f88
test rsi, rsi
je 0x4d054a
lea rdx, [rbp - 0x34]
mov rcx, rdi
call fcn.004d0190
test rax, rax
mov rdi, rax
je 0x4d0580
mov eax, dword [rbp - 0x38]
mov ebx, dword [rbp - 0x34]
lea r13d, [rax - 1]
cmp r13d, ebx
mov dword [rbp - 0x38], r13d
mov dword [rbp - 0x50], ebx
jne 0x4d04c5
test r13d, r13d
jle 0x4d0590
lea ebx, [rax - 2]
lea rax, [rbx + 1]
xor ebx, ebx
mov qword [rbp - 0x48], rax
jmp 0x4d049e
lea r15d, [rbx + 1]
add rbx, 1
cmp rbx, qword [rbp - 0x48]
je 0x4d04b2
mov rdx, qword [rdi + rbx*8]
mov r15d, ebx
mov rcx, qword [rsi + rbx*8]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4d0490
cmp dword [rbp - 0x50], r15d
je 0x4d0590
test r13d, r13d
jle 0x4d0590
lea rdx, [rbp - 0x30]
mov rcx, r12
call fcn.004d0190
test rax, rax
mov r12, rax
je 0x4d0590
mov ebx, dword [rbp - 0x34]
mov eax, dword [rbp - 0x30]
mov dword [rbp - 0x50], ebx
cmp ebx, eax
mov dword [rbp - 0x54], eax
cmovle eax, ebx
test eax, eax
jle 0x4d08d8
lea ebx, [rax - 1]
xor r15d, r15d
add rbx, 1
jmp 0x4d0513
lea r13d, [r15 + 1]
add r15, 1
cmp rbx, r15
je 0x4d0740
mov rdx, qword [r12 + r15*8]
mov r13d, r15d
mov rcx, qword [rdi + r15*8]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4d0502
xor ebx, ebx
test r15d, r15d
jne 0x4d0740
mov rcx, rsi
call fcn.004d0150
mov rcx, rdi
call fcn.004d0150
mov rcx, r12
call fcn.004d0150
mov rcx, r14
call fcn.004d4f88
mov rax, rbx
lea rsp, [rbp + 0x18]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
call fcn.004d00b0
mov r13, rax
jmp 0x4d0419
mov rcx, rsi
call fcn.004d0150
jmp 0x4d054a
mov rcx, rsi
xor ebx, ebx
call fcn.004d0150
mov rcx, rdi
call fcn.004d0150
jmp 0x4d054a
xor ebx, ebx
jmp 0x4d0552
lea rcx, [0x005201c0]
call sub.msvcrt.dll_getenv
test rax, rax
je 0x4d0405
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 0x4d08c0
add rax, 0x23
and rax, 0xfffffffffffffff0
call fcn.004d2fb0
sub rsp, rax
lea rbx, [rsp + 0x20]
lea rax, [rbp - 0x30]
mov r15, rdx
mov qword [rbp - 0x50], rax
jmp 0x4d062f
lea rcx, [r15 + 1]
test al, al
je 0x4d0637
mov r15, rcx
movzx eax, byte [r15]
cmp al, 0x3b
jne 0x4d0624
cmp rdx, r15
je 0x4d0720
mov r10, r15
mov rcx, rbx
sub r10, rdx
mov r8, r10
mov qword [rbp - 0x48], r10
call sub.msvcrt.dll_memcpy
movzx eax, byte [r15 - 1]
mov r10, qword [rbp - 0x48]
cmp al, 0x2f
lea rdx, [rbx + r10]
je 0x4d0733
cmp al, 0x5c
je 0x4d0733
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 qword [sym.imp.msvcrt.dll__access]
test eax, eax
je 0x4d06e5
mov rdx, rbx
mov ecx, dword [rdx]
add rdx, 4
lea eax, [rcx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x4d0698
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 qword [sym.imp.msvcrt.dll__access]
test eax, eax
jne 0x4d0708
mov rdx, qword [rbp - 0x50]
mov rcx, rbx
call qword [sym.imp.msvcrt.dll__stat64]
test eax, eax
js 0x4d0708
movzx eax, word [rbp - 0x2a]
and ax, 0xf000
cmp ax, 0x8000
je 0x4d08b0
cmp byte [r15], 0
je 0x4d0405
lea rcx, [r15 + 1]
mov rdx, rcx
jmp 0x4d062c
mov r8d, 0x2f2e
mov byte [rbx + 2], 0
mov word [rbx], r8w
jmp 0x4d067b
mov byte [rdx], 0
jmp 0x4d067b
mov eax, dword [rbp - 0x38]
test eax, eax
jle 0x4d08df
sub eax, 1
mov r15, rsi
xor ebx, ebx
lea rax, [rsi + rax*8 + 8]
mov qword [rbp - 0x48], rax
nop dword [rax]
mov rcx, qword [r15]
add r15, 8
call sub.msvcrt.dll_strlen
add eax, ebx
cmp r15, qword [rbp - 0x48]
mov ebx, eax
jne 0x4d0760
mov edx, dword [rbp - 0x50]
mov ecx, dword [rbp - 0x54]
sub edx, r13d
lea ebx, [rdx + rdx*2]
add eax, ebx
cmp ecx, r13d
mov dword [rbp - 0x48], eax
jle 0x4d07b8
sub ecx, 1
movsxd rax, r13d
lea rbx, [r12 + rax*8]
mov r15d, ecx
sub r15d, r13d
add rax, r15
lea r15, [r12 + rax*8 + 8]
mov rcx, qword [rbx]
add rbx, 8
call sub.msvcrt.dll_strlen
add dword [rbp - 0x48], eax
cmp r15, rbx
jne 0x4d07a4
mov eax, dword [rbp - 0x48]
add eax, 1
movsxd rcx, eax
call sub.msvcrt.dll_malloc
test rax, rax
mov rbx, rax
je 0x4d0532
mov byte [rax], 0
mov eax, dword [rbp - 0x38]
test eax, eax
jle 0x4d0805
sub eax, 1
mov r15, rsi
lea rax, [rsi + rax*8 + 8]
mov qword [rbp - 0x48], rax
nop dword [rax + rax]
mov rdx, qword [r15]
mov rcx, rbx
add r15, 8
call sub.msvcrt.dll_strcat
cmp qword [rbp - 0x48], r15
jne 0x4d07f0
mov rax, rbx
mov ecx, dword [rax]
add rax, 4
lea edx, [rcx - 0x1010101]
not ecx
and edx, ecx
and edx, 0x80808080
je 0x4d0808
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 edx, r13d
jle 0x4d086e
sub edx, 1
sub edx, r13d
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 0x4d0854
mov byte [rax], 0
mov eax, dword [rbp - 0x30]
cmp eax, r13d
jle 0x4d0532
sub eax, 1
movsxd rdx, r13d
lea r15, [r12 + rdx*8]
sub eax, r13d
add rax, rdx
lea r13, [r12 + rax*8 + 8]
mov rdx, qword [r15]
mov rcx, rbx
add r15, 8
call sub.msvcrt.dll_strcat
cmp r15, r13
jne 0x4d0892
jmp 0x4d0532
mov rsi, rbx
jmp 0x4d0405
mov qword [rbp - 0x48], rdx
call sub.msvcrt.dll_malloc
mov rdx, qword [rbp - 0x48]
mov r14, rax
mov rbx, rax
jmp 0x4d0617
xor ebx, ebx
jmp 0x4d0532
xor eax, eax
jmp 0x4d0776