Function at 0x180001cf4
Capabilities:
Get file size
Query environment variable
Read file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x5a0]
sub rsp, 0x6a0
mov rax, qword [section..data]
xor rax, rsp
mov qword [rbp + 0x590], rax
mov qword [rsp + 0x50], rdx
mov r12, rcx
mov qword [rsp + 0x48], rcx
mov esi, 0x208
mov r8d, esi
lea rcx, [rbp + 0x380]
xor edx, edx
xor edi, edi
call fcn.1800036b0
mov r8d, esi
lea rcx, [rsp + 0x60]
xor edx, edx
call fcn.1800036b0
mov rbx, qword [0x180017d70]
cmp dword [rbx + 0x14], edi
je 0x180001d81
mov rcx, qword [0x180017d78]
lea rdx, [rsp + 0x60]
mov r8d, 0x104
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
jmp 0x180001e2f
mov r8, rsi
lea rcx, [rbp + 0x170]
xor edx, edx
call fcn.1800036b0
mov rcx, qword [rbx + 0x18]
lea rdx, [rbp + 0x170]
mov r8d, 0x104
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
dec eax
cmp eax, 0x102
ja 0x180001fd1
mov rax, qword [0x180017d68]
lea rcx, [rbp + 0x170]
call qword [rax + 0x60]
test eax, eax
je 0x180001e19
mov rcx, qword [0x180017d78]
lea rdx, [rsp + 0x60]
mov r8d, 0x104
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov rax, qword [0x180017d68]
lea rcx, [rsp + 0x60]
call qword [rax + 0x48]
mov rax, qword [0x180017d68]
lea rcx, [rsp + 0x60]
call qword [rax + 0x50]
mov rax, qword [0x180017d68]
lea rdx, [rbp + 0x170]
lea rcx, [rsp + 0x60]
call qword [rax + 0x58]
jmp 0x180001e2f
lea r8, [rbp + 0x170]
mov edx, 0x104
lea rcx, [rsp + 0x60]
call fcn.1800043b0
lea rdx, [rsp + 0x60]
lea rcx, [rbp + 0x380]
call qword [sym.imp.SHLWAPI.dll_PathCanonicalizeW]
lea rcx, [rbp + 0x380]
call fcn.180004418
test rax, rax
je 0x180001fd1
mov qword [rsp + 0x30], rdi
lea rcx, [rbp + 0x380]
mov r8d, 3
mov dword [rsp + 0x28], 0x80
xor r9d, r9d
mov dword [rsp + 0x20], r8d
mov edx, 0x80000000
mov rsi, rdi
mov r15d, edi
mov r13d, edi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r14, rax
cmp rax, 0xffffffffffffffff
je 0x180001fd1
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov rcx, qword [0x180017d70]
mov r8d, dword [rcx + 0x20]
mov edx, dword [rcx + 0x24]
add edx, r8d
cmp eax, edx
jb 0x180001f71
mov ebx, r8d
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, ebx
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r12, rax
test rax, rax
je 0x180001f6c
mov rcx, qword [0x180017d70]
xor r9d, r9d
xor r8d, r8d
mov edx, dword [rcx + 0x24]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rcx, qword [0x180017d70]
mov ebx, edi
mov dword [rsp + 0x40], edi
mov r8d, dword [rcx + 0x20]
test r8d, r8d
je 0x180001f45
mov edx, ebx
lea r9, [rsp + 0x40]
add rdx, r12
mov qword [rsp + 0x20], rdi
sub r8d, ebx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rcx, qword [0x180017d70]
test eax, eax
je 0x180001f45
add ebx, dword [rsp + 0x40]
mov r8d, dword [rcx + 0x20]
cmp ebx, r8d
jb 0x180001f12
cmp ebx, dword [rcx + 0x20]
jne 0x180001f58
mov rsi, r12
mov r15d, ebx
mov r13d, 1
jmp 0x180001f6c
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, r12
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r12, qword [rsp + 0x48]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test r13d, r13d
je 0x180001fd1
mov r8, qword [0x180017d70]
lea rcx, [0x180016ba0]
add r8, 0x2c
mov dword [rsp + 0x28], r15d
mov r9, rsi
mov qword [rsp + 0x20], rsi
call fcn.1800012dc
mov rax, qword [0x180017d68]
mov r8d, r15d
mov rdx, rsi
xor ecx, ecx
call qword [rax]
mov rcx, qword [0x180017d70]
cmp dword [rcx + 0x28], eax
jne 0x180001fd1
mov rax, qword [rsp + 0x50]
mov edi, 1
mov qword [r12], rsi
mov dword [rax], r15d
mov eax, edi
mov rcx, qword [rbp + 0x590]
xor rcx, rsp
call fcn.180002360
mov rbx, qword [rsp + 0x6f0]
add rsp, 0x6a0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret