Function at 0x140001c38
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.140003d50
mov r8d, esi
lea rcx, [rsp + 0x60]
xor edx, edx
call fcn.140003d50
mov rbx, qword [0x140019d70]
cmp dword [rbx + 0x20], edi
je 0x140001cc9
mov rax, qword [0x140019d68]
lea rdx, [rsp + 0x60]
mov rcx, qword [0x140019d78]
mov r8d, 0x104
call qword [rax + 0x40]
jmp 0x140001d7b
mov r8, rsi
lea rcx, [rbp + 0x170]
xor edx, edx
call fcn.140003d50
mov rcx, qword [rbx + 0x24]
lea rdx, [rbp + 0x170]
mov r8d, 0x104
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
dec eax
cmp eax, 0x102
ja 0x140001f1d
mov rax, qword [0x140019d68]
lea rcx, [rbp + 0x170]
call qword [rax + 0x60]
test eax, eax
je 0x140001d65
mov rax, qword [0x140019d68]
lea rdx, [rsp + 0x60]
mov rcx, qword [0x140019d78]
mov r8d, 0x104
call qword [rax + 0x40]
mov rax, qword [0x140019d68]
lea rcx, [rsp + 0x60]
call qword [rax + 0x48]
mov rax, qword [0x140019d68]
lea rcx, [rsp + 0x60]
call qword [rax + 0x50]
mov rax, qword [0x140019d68]
lea rdx, [rbp + 0x170]
lea rcx, [rsp + 0x60]
call qword [rax + 0x58]
jmp 0x140001d7b
lea r8, [rbp + 0x170]
mov edx, 0x104
lea rcx, [rsp + 0x60]
call fcn.140004880
lea rdx, [rsp + 0x60]
lea rcx, [rbp + 0x380]
call qword [sym.imp.SHLWAPI.dll_PathCanonicalizeW]
lea rcx, [rbp + 0x380]
call fcn.1400048e8
test rax, rax
je 0x140001f1d
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 0x140001f1d
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov rcx, qword [0x140019d70]
mov r8d, dword [rcx + 0x2c]
mov edx, dword [rcx + 0x30]
add edx, r8d
cmp eax, edx
jb 0x140001ebd
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 0x140001eb8
mov rcx, qword [0x140019d70]
xor r9d, r9d
xor r8d, r8d
mov edx, dword [rcx + 0x30]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rcx, qword [0x140019d70]
mov ebx, edi
mov dword [rsp + 0x40], edi
mov r8d, dword [rcx + 0x2c]
test r8d, r8d
je 0x140001e91
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 [0x140019d70]
test eax, eax
je 0x140001e91
add ebx, dword [rsp + 0x40]
mov r8d, dword [rcx + 0x2c]
cmp ebx, r8d
jb 0x140001e5e
cmp ebx, dword [rcx + 0x2c]
jne 0x140001ea4
mov rsi, r12
mov r15d, ebx
mov r13d, 1
jmp 0x140001eb8
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 0x140001f1d
mov r8, qword [0x140019d70]
lea rcx, [0x140018bb0]
add r8, 0x38
mov dword [rsp + 0x28], r15d
mov r9, rsi
mov qword [rsp + 0x20], rsi
call fcn.1400012dc
mov rax, qword [0x140019d68]
mov r8d, r15d
mov rdx, rsi
xor ecx, ecx
call qword [rax]
mov rcx, qword [0x140019d70]
cmp dword [rcx + 0x34], eax
jne 0x140001f1d
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.140002b90
mov rbx, qword [rsp + 0x6f0]
add rsp, 0x6a0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret