Function at 0x478572
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 0x4785e5
cmp qword [rbp + 0x88], 0
je 0x4785e5
cmp qword [rbp + 0x90], 0
jne 0x4785ef
mov eax, 0
jmp 0x478bd8
mov rcx, qword [rbp + 0x80]
call fcn.00478094
cmp qword [rbp + 0x80], rax
jne 0x47887e
lea rcx, [0x004feda0]
call sub.msvcrt.dll_getenv
mov qword [rbp - 0x10], rax
cmp qword [rbp - 0x10], 0
je 0x47887e
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 0x478646
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 0x4786a6
mov rax, qword [rbp - 0x18]
add rax, 0xf
add rax, 0xf
shr rax, 4
shl rax, 4
call fcn.00487db0
sub rsp, rax
lea rax, [rsp + 0x20]
add rax, 0xf
shr rax, 4
shl rax, 4
mov qword [rbp], rax
jmp 0x4786be
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 0x4786e8
mov rax, qword [rbp + 8]
movzx eax, byte [rax]
test al, al
jne 0x478873
mov rax, qword [rbp + 8]
cmp rax, qword [rbp + 0x10]
jne 0x478714
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 0x4787aa
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 0x47878f
mov rax, qword [rbp + 8]
sub rax, 1
movzx eax, byte [rax]
cmp al, 0x5c
je 0x47878f
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 0x4787aa
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.00478150
test eax, eax
je 0x47881a
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.00478150
test eax, eax
jne 0x478852
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 0x478852
movzx eax, word [rbp - 0x5a]
movzx eax, ax
and eax, 0xf000
cmp eax, 0x8000
jne 0x478852
mov rax, qword [rbp]
mov qword [rbp + 0x80], rax
jmp 0x47887e
mov rax, qword [rbp + 8]
movzx eax, byte [rax]
test al, al
je 0x47887d
mov rax, qword [rbp + 8]
add rax, 1
mov qword [rbp + 0x10], rax
mov rax, qword [rbp + 0x10]
mov qword [rbp + 8], rax
jmp 0x478878
add qword [rbp + 8], 1
jmp 0x4786ce
nop
cmp dword [rbp + 0x98], 0
je 0x478899
mov rcx, qword [rbp + 0x80]
call fcn.004780b0
mov qword [rbp + 0x20], rax
jmp 0x4788a9
mov rcx, qword [rbp + 0x80]
call sub.msvcrt.dll__strdup
mov qword [rbp + 0x20], rax
cmp qword [rbp + 0x20], 0
je 0x478b91
lea rdx, [rbp - 0x20]
mov rax, qword [rbp + 0x20]
mov rcx, rax
call fcn.004781d0
mov qword [rbp + 0x58], rax
mov rax, qword [rbp + 0x20]
mov rcx, rax
call fcn.00494cb8
cmp qword [rbp + 0x58], 0
je 0x478b94
lea rdx, [rbp - 0x24]
mov rax, qword [rbp + 0x88]
mov rcx, rax
call fcn.004781d0
mov qword [rbp + 0x50], rax
cmp qword [rbp + 0x50], 0
je 0x478b97
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 0x47897d
mov dword [rbp + 0x44], 0
jmp 0x47895b
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 0x478965
add dword [rbp + 0x44], 1
mov eax, dword [rbp - 0x24]
cmp dword [rbp + 0x44], eax
jl 0x47891d
jmp 0x478966
nop
mov eax, dword [rbp - 0x20]
test eax, eax
jle 0x478b9a
mov eax, dword [rbp - 0x24]
cmp dword [rbp + 0x44], eax
je 0x478b9a
lea rdx, [rbp - 0x28]
mov rax, qword [rbp + 0x90]
mov rcx, rax
call fcn.004781d0
mov qword [rbp + 0x48], rax
cmp qword [rbp + 0x48], 0
je 0x478b9d
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 0x4789f4
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 0x4789fe
add dword [rbp + 0x40], 1
mov eax, dword [rbp + 0x40]
cmp eax, dword [rbp - 0x1c]
jl 0x4789b6
jmp 0x4789ff
nop
cmp dword [rbp + 0x40], 0
je 0x478ba0
mov dword [rbp + 0x3c], 0
mov dword [rbp + 0x44], 0
jmp 0x478a46
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 0x478a19
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 0x478a9b
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 0x478a6e
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 0x478ba3
mov rax, qword [rbp + 0x30]
mov byte [rax], 0
mov dword [rbp + 0x44], 0
jmp 0x478afa
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 0x478ad3
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 0x478b49
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 0x478b24
mov rax, qword [rbp + 0x28]
mov byte [rax], 0
mov eax, dword [rbp + 0x40]
mov dword [rbp + 0x44], eax
jmp 0x478b87
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 0x478b60
jmp 0x478b9a
nop
jmp 0x478ba4
nop
jmp 0x478ba4
nop
jmp 0x478ba4
nop
jmp 0x478ba4
nop
jmp 0x478ba4
nop
jmp 0x478ba4
nop
mov rax, qword [rbp + 0x58]
mov rcx, rax
call fcn.00478505
mov rax, qword [rbp + 0x50]
mov rcx, rax
call fcn.00478505
mov rax, qword [rbp + 0x48]
mov rcx, rax
call fcn.00478505
mov rax, qword [rbp + 0x18]
mov rcx, rax
call fcn.00494cb8
mov rax, qword [rbp + 0x30]
lea rsp, [rbp + 0x68]
pop rdi
pop rbp
ret