Function at 0x140017870
Capabilities:
Check if file exists
Read file on windows

Disassembly:
push rbp
push r12
push r13
push r14
push r15
sub rsp, 0xa0
lea rbp, [rsp + 0x40]
mov qword [rbp + 0x90], rbx
mov qword [rbp + 0x98], rsi
mov qword [rbp + 0xa0], rdi
mov rax, qword [0x1402c3930]
xor rax, rbp
mov qword [rbp + 0x50], rax
mov rbx, rdx
mov r13, rcx
mov qword [rbp + 0x28], rcx
xor edi, edi
mov esi, edi
mov qword [rbp + 0x18], rdi
mov dword [rbp + 0xc], 0x100
mov ecx, 0x100
call fcn.140006860
mov r14, rax
mov qword [rbp + 0x30], rax
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [rbp + 0x24], eax
cmp eax, 0xffffffff
je 0x140007268
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x8000080
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov edx, 0x80000000
lea r8d, [rdi + 1]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
mov qword [rbp + 0x18], rax
cmp rax, 0xffffffffffffffff
je 0x140007268
mov r15d, edi
mov dword [rbp + 0x10], edi
mov eax, 0x8000
call fcn.1401d9d20
sub rsp, rax
lea rbx, [rsp + 0x40]
mov qword [rbp + 0x40], rbx
mov qword [rsp + 0x20], rdi
lea r9, [rbp]
mov r8d, eax
mov rdx, rbx
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140007268
mov ecx, edi
mov r8d, dword [rbp]
mov dword [rbp + 0x20], ecx
cmp ecx, r8d
jae 0x140006fd1
mov eax, ecx
movzx edx, byte [rax + rbx]
cmp dl, 0xd
je 0x140006fd1
cmp dl, 0xa
je 0x140006fd1
inc ecx
jmp 0x140006fb5
cmp edi, r8d
jne 0x140006fda
mov eax, edi
jmp 0x140006ffb
cmp byte [rbx], 0xa
jne 0x140006fe6
mov eax, 1
jmp 0x140006ffb
lea eax, [r8 - 1]
cmp edi, eax
jae 0x140006ff6
cmp byte [rbx + 1], 0xa
mov eax, edi
je 0x140006ffb
mov eax, 2
mov dword [r13 + 0x4c], eax
cdqe
lea rcx, [0x140272a50]
mov rcx, qword [rcx + rax*8]
mov qword [rbp + 0x48], rcx
lea rcx, [r13 + 0x58]
xor edx, edx
mov r8d, 0x1000
call fcn.140008c40
mov r12d, edi
mov dword [rbp + 8], edi
mov esi, edi
mov dword [rbp + 4], edi
call fcn.140002a40
mov dword [rbp + 0x14], eax
mov ecx, dword [rbp]
cmp r12d, ecx
jae 0x14000719b
mov eax, r12d
movsx r13d, byte [rax + rbx]
mov dword [rbp + 0x38], r13d
inc r12d
mov dword [rbp + 8], r12d
cmp r12d, ecx
jne 0x140007087
cmp ecx, 0x8000
jne 0x140007087
mov qword [rsp + 0x20], rdi
lea r9, [rbp]
mov r8d, ecx
mov rdx, rbx
mov rcx, qword [rbp + 0x18]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140007264
mov r12d, edi
mov dword [rbp + 8], edi
movsxd rax, r15d
mov byte [rax + r14], r13b
inc r15d
mov dword [rbp + 0x10], r15d
mov eax, dword [rbp + 0xc]
cmp r15d, eax
jne 0x1400070d9
add eax, 0x100
mov dword [rbp + 0xc], eax
mov dword [rbp + 0x3c], eax
movsxd rcx, eax
call fcn.140006860
mov rbx, rax
movsxd r8, r15d
mov rdx, r14
mov rcx, rax
call fcn.1401dbb60
mov edx, 1
mov rcx, r14
call fcn.140002700
mov r14, rbx
mov qword [rbp + 0x30], rbx
mov rbx, qword [rbp + 0x40]
movsxd rax, esi
mov rcx, qword [rbp + 0x48]
cmp r13b, byte [rax + rcx]
jne 0x14000718d
inc esi
mov dword [rbp + 4], esi
movsxd rax, esi
cmp byte [rax + rcx], 0
jne 0x140007192
sub r15d, esi
movsxd rax, r15d
mov byte [rax + r14], 0
test r14, r14
jne 0x140007111
mov rax, rdi
jmp 0x14000716a
or rdx, 0xffffffffffffffff
inc rdx
cmp byte [r14 + rdx], 0
jne 0x140007115
inc edx
cmp edx, 0x3fffffff
jle 0x14000712e
mov rax, rdi
jmp 0x14000716a
movsxd rax, edx
add rax, rax
lea rcx, [rax + 0xf]
cmp rcx, rax
ja 0x140007147
movabs rcx, 0xffffffffffffff0
and rcx, 0xfffffffffffffff0
mov rax, rcx
call fcn.1401d9d20
sub rsp, rcx
lea rcx, [rsp + 0x40]
mov r9d, dword [rbp + 0x14]
mov r8d, edx
mov rdx, r14
call fcn.1400067c0
or r9d, 0xffffffff
or r8d, r9d
mov rdx, rax
mov r13, qword [rbp + 0x28]
mov rcx, r13
call fcn.140006b90
mov r15d, edi
mov dword [rbp + 0x10], edi
mov esi, edi
mov dword [rbp + 4], edi
jmp 0x140007196
mov esi, edi
mov dword [rbp + 4], edi
mov r13, qword [rbp + 0x28]
jmp 0x140007034
movsxd rax, r15d
mov byte [rax + r14], 0
test r14, r14
jne 0x1400071ad
mov rax, rdi
jmp 0x140007206
or rdx, 0xffffffffffffffff
inc rdx
cmp byte [r14 + rdx], 0
jne 0x1400071b1
inc edx
cmp edx, 0x3fffffff
jle 0x1400071ca
mov rax, rdi
jmp 0x140007206
movsxd rax, edx
add rax, rax
lea rcx, [rax + 0xf]
cmp rcx, rax
ja 0x1400071e3
movabs rcx, 0xffffffffffffff0
and rcx, 0xfffffffffffffff0
mov rax, rcx
call fcn.1401d9d20
sub rsp, rcx
lea rcx, [rsp + 0x40]
mov r9d, dword [rbp + 0x14]
mov r8d, edx
mov rdx, r14
call fcn.1400067c0
or r9d, 0xffffffff
or r8d, r9d
mov rdx, rax
mov rcx, r13
call fcn.140006b90
mov dword [r13 + 0x40], 1
mov eax, dword [rbp + 0x24]
and eax, 1
mov dword [r13 + 0x44], eax
mov dword [r13 + 0x48], edi
mov qword [r13 + 0xb0], rdi
mov dword [r13 + 0x54], 0x80000
mov qword [r13 + 0xa8], rdi
mov edi, 1
mov dword [rsp + 0x20], 0xffffffff
mov r9d, 0x1000
xor r8d, r8d
xor edx, edx
mov rcx, r13
call fcn.140007b00
mov rsi, qword [rbp + 0x18]
test r14, r14
je 0x14000727a
mov edx, 1
mov rcx, r14
call fcn.140002700
test rsi, rsi
je 0x140007288
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov rcx, qword [rbp + 0x50]
xor rcx, rbp
call fcn.1401d92b0
mov rbx, qword [rbp + 0x90]
mov rsi, qword [rbp + 0x98]
mov rdi, qword [rbp + 0xa0]
lea rsp, [rbp + 0x60]
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
mov qword [rsp + 8], rbx
push rdi
sub rsp, 0x20
mov rbx, rdx
mov rdi, rcx
call fcn.140055b18
test eax, eax
jne 0x140017894
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret
lea rcx, [rdi + 0x180]
mov rdx, rbx
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
jmp 0x140006ec0