Function at 0x4c98a0
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 r14, rdx
mov rbx, rcx
sete dl
test r8, r8
mov r13, r8
sete al
mov r12d, r9d
or dl, al
jne 0x4c9d60
test rcx, rcx
je 0x4c9d60
call fcn.004c9570
cmp rbx, rax
je 0x4c9bb0
mov qword [rbp - 0x48], 0
test r12d, r12d
mov rcx, rbx
jne 0x4c9b10
call fcn.004d1e60
mov rbx, rax
test rbx, rbx
je 0x4c9b21
lea rdx, [rbp - 0x38]
mov rcx, rbx
call fcn.004c9670
mov rcx, rbx
mov r12, rax
call sub.msvcrt.dll_free
test r12, r12
je 0x4c9b21
lea rdx, [rbp - 0x34]
mov rcx, r14
call fcn.004c9670
test rax, rax
mov rdi, rax
je 0x4c9ba5
mov eax, dword [rbp - 0x38]
mov r14d, dword [rbp - 0x34]
lea esi, [rax - 1]
cmp esi, r14d
mov dword [rbp - 0x38], esi
je 0x4c9b60
lea rdx, [rbp - 0x30]
mov rcx, r13
call fcn.004c9670
test rax, rax
mov rsi, rax
je 0x4c9d30
mov eax, dword [rbp - 0x34]
mov r14d, dword [rbp - 0x30]
mov r13d, eax
cmp eax, r14d
mov dword [rbp - 0x58], eax
cmovg r13d, r14d
test r13d, r13d
jle 0x4c9d30
xor r15d, r15d
xor ebx, ebx
jmp 0x4c99ad
add ebx, 1
add r15, 8
cmp r13d, ebx
je 0x4c99d0
mov rdx, qword [rsi + r15]
mov rcx, qword [rdi + r15]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4c99a1
xor r13d, r13d
test ebx, ebx
je 0x4c9b2b
nop dword [rax]
mov eax, dword [rbp - 0x38]
test eax, eax
jle 0x4c9d89
sub eax, 1
mov r15, r12
xor r13d, r13d
lea rax, [r12 + rax*8 + 8]
mov qword [rbp - 0x50], rax
nop dword [rax]
mov rcx, qword [r15]
add r15, 8
call sub.msvcrt.dll_strlen
add eax, r13d
cmp qword [rbp - 0x50], r15
mov r13d, eax
jne 0x4c99f0
mov edx, dword [rbp - 0x58]
sub edx, ebx
lea r13d, [rdx + rdx*2]
add r13d, eax
cmp r14d, ebx
jle 0x4c9a35
movsxd r15, ebx
nop dword [rax]
mov rcx, qword [rsi + r15*8]
add r15, 1
call sub.msvcrt.dll_strlen
add r13d, eax
cmp r14d, r15d
jg 0x4c9a20
lea eax, [r13 + 1]
movsxd rcx, eax
call sub.msvcrt.dll_malloc
test rax, rax
mov r13, rax
je 0x4c9b2b
mov byte [rax], 0
mov eax, dword [rbp - 0x38]
test eax, eax
jle 0x4c9a76
sub eax, 1
mov r14, r12
lea r15, [r12 + rax*8 + 8]
mov rdx, qword [r14]
mov rcx, r13
add r14, 8
call sub.msvcrt.dll_strcat
cmp r15, r14
jne 0x4c9a62
mov rax, r13
mov ecx, dword [rax]
add rax, 4
lea edx, [rcx - 0x1010101]
not ecx
and edx, ecx
and edx, 0x80808080
je 0x4c9a79
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, ebx
jle 0x4c9add
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 0x4c9ac3
mov r14d, dword [rbp - 0x30]
mov byte [rax], 0
cmp r14d, ebx
jle 0x4c9b2b
movsxd rbx, ebx
nop dword [rax]
mov rdx, qword [rsi + rbx*8]
mov rcx, r13
add rbx, 1
call sub.msvcrt.dll_strcat
cmp r14d, ebx
jg 0x4c9af0
jmp 0x4c9b2b
call fcn.004c9580
mov rbx, rax
test rbx, rbx
jne 0x4c9917
xor r13d, r13d
xor esi, esi
xor edi, edi
xor r12d, r12d
mov rcx, r12
call fcn.004c9620
mov rcx, rdi
call fcn.004c9620
mov rcx, rsi
call fcn.004c9620
mov rcx, qword [rbp - 0x48]
call sub.msvcrt.dll_free
mov rax, r13
lea rsp, [rbp + 0x18]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
test esi, esi
jle 0x4c9b9e
lea ebx, [rax - 2]
mov r15d, 1
add rbx, 2
jmp 0x4c9b83
mov eax, r15d
add r15, 1
cmp rbx, r15
je 0x4c9d21
mov rdx, qword [rdi + r15*8 - 8]
mov rcx, qword [r12 + r15*8 - 8]
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4c9b73
test esi, esi
jg 0x4c9965
xor r13d, r13d
xor esi, esi
jmp 0x4c9b2b
xor esi, esi
xor r13d, r13d
jmp 0x4c9b2b
lea rcx, [0x0051de60]
call sub.msvcrt.dll_getenv
test rax, rax
je 0x4c98f2
mov rcx, rax
mov qword [rbp - 0x48], rax
call sub.msvcrt.dll_strlen
lea rsi, [rax + 1]
mov rcx, rbx
call sub.msvcrt.dll_strlen
cmp rsi, 2
mov ecx, 2
mov rdx, qword [rbp - 0x48]
cmovb rsi, rcx
lea rcx, [rax + rsi + 5]
cmp rcx, 0xfbf
ja 0x4c9d68
lea rax, [rcx + 0x1e]
and rax, 0xfffffffffffffff0
call fcn.004cd0a0
sub rsp, rax
mov qword [rbp - 0x48], 0
lea rsi, [rsp + 0x20]
lea rax, [rbp - 0x30]
mov r15, rdx
lea rdi, [rdx + 1]
mov qword [rbp - 0x58], rax
jmp 0x4c9c3c
test al, al
je 0x4c9c44
add r15, 1
add rdi, 1
movzx eax, byte [r15]
cmp al, 0x3b
jne 0x4c9c30
cmp rdx, r15
je 0x4c9d50
mov r10, r15
mov rcx, rsi
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
je 0x4c9d40
cmp al, 0x5c
je 0x4c9d40
mov byte [rsi + r10], 0x2f
mov byte [rsi + r10 + 1], 0
mov rdx, rbx
mov rcx, rsi
call sub.msvcrt.dll_strcat
xor edx, edx
mov rcx, rsi
call qword [sym.imp.msvcrt.dll__access]
test eax, eax
je 0x4c9cf0
mov rdx, rsi
mov ecx, dword [rdx]
add rdx, 4
lea eax, [rcx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x4c9ca3
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, rsi
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 0x4c9d0f
mov rdx, qword [rbp - 0x58]
mov rcx, rsi
call qword [sym.imp.msvcrt.dll__stat64]
test eax, eax
js 0x4c9d0f
movzx eax, word [rbp - 0x2a]
and ax, 0xf000
cmp ax, 0x8000
je 0x4c9d81
cmp byte [r15], 0
je 0x4c98fa
mov rdx, rdi
jmp 0x4c9c34
cmp r14d, eax
jne 0x4c9b96
jmp 0x4c9b9e
xor r13d, r13d
jmp 0x4c9b2b
mov byte [rsi + r10], 0
jmp 0x4c9c86
mov byte [rsi], 0x2e
mov byte [rsi + 1], 0x2f
mov byte [rsi + 2], 0
jmp 0x4c9c86
xor r13d, r13d
jmp 0x4c9b4c
mov qword [rbp - 0x50], rdx
call sub.msvcrt.dll_malloc
mov rdx, qword [rbp - 0x50]
mov qword [rbp - 0x48], rax
mov rsi, rax
jmp 0x4c9c1d
mov rbx, rsi
jmp 0x4c98fa
xor eax, eax
jmp 0x4c9a08