Function at 0x140008990
Capabilities:
Check if file exists
Get file attributes
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 [0x1416e97c0]
xor rax, rbp
mov qword [rbp + 0x50], rax
mov ebx, r8d
mov rsi, rdx
mov r13, rcx
mov qword [rbp + 0x40], rcx
xor edi, edi
mov r15d, edi
mov qword [rbp + 8], rdi
mov dword [rbp + 0x18], 0x100
mov ecx, 0x100
call fcn.140021d74
mov r14, rax
mov qword [rbp + 0x38], rax
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [rbp + 0x1c], eax
cmp eax, 0xffffffff
je 0x140008d64
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, rsi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r15, rax
mov qword [rbp + 8], rax
cmp rax, 0xffffffffffffffff
je 0x140008d64
mov r15d, edi
mov dword [rbp + 0x14], edi
mov eax, 0x8000
call fcn.1401b1e20
sub rsp, rax
lea r12, [rsp + 0x40]
mov qword [rbp + 0x30], r12
mov qword [rsp + 0x20], rdi
lea r9, [rbp + 4]
mov r8d, eax
mov rdx, r12
mov rcx, qword [rbp + 8]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140008d60
cmp ebx, 0xffffffff
jne 0x140008ade
mov ecx, edi
mov r8d, dword [rbp + 4]
mov dword [rbp + 0x20], ecx
cmp ecx, r8d
jae 0x140008aac
mov eax, ecx
movzx edx, byte [rax + r12]
cmp dl, 0xd
je 0x140008aac
cmp dl, 0xa
je 0x140008aac
inc ecx
jmp 0x140008a8f
cmp edi, r8d
jne 0x140008ab5
mov ebx, edi
jmp 0x140008ade
mov eax, edi
cmp byte [rax + r12], 0xa
jne 0x140008ac5
mov ebx, 1
jmp 0x140008ade
lea eax, [r8 - 1]
cmp edi, eax
jae 0x140008ad9
lea eax, [rdi + 1]
cmp byte [rax + r12], 0xa
mov ebx, edi
je 0x140008ade
mov ebx, 2
mov dword [r13 + 0x4c], ebx
movsxd rax, ebx
lea rbx, section..data
mov rbx, qword [rbx + rax*8]
mov qword [rbp + 0x28], rbx
lea rcx, [r13 + 0x58]
xor edx, edx
mov r8d, 0x1000
call fcn.140009ad0
mov r13d, edi
mov dword [rbp + 0x10], edi
mov esi, edi
mov dword [rbp], edi
mov ecx, dword [rbp + 4]
cmp r13d, ecx
jae 0x140008c7e
mov eax, r13d
movsx r12d, byte [rax + r12]
mov dword [rbp + 0x4c], r12d
inc r13d
mov dword [rbp + 0x10], r13d
cmp r13d, ecx
jne 0x140008b64
cmp ecx, 0x8000
jne 0x140008b64
mov qword [rsp + 0x20], rdi
lea r9, [rbp + 4]
mov r8d, ecx
mov rdx, qword [rbp + 0x30]
mov rcx, qword [rbp + 8]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140008d60
mov r13d, edi
mov dword [rbp + 0x10], edi
movsxd rax, r15d
mov byte [rax + r14], r12b
inc r15d
mov dword [rbp + 0x14], r15d
mov eax, dword [rbp + 0x18]
cmp r15d, eax
jne 0x140008bb1
add eax, 0x100
mov dword [rbp + 0x18], eax
mov dword [rbp + 0x48], eax
movsxd rcx, eax
call fcn.140021d74
mov rbx, rax
movsxd r8, r15d
mov rdx, r14
mov rcx, rax
call fcn.1401b22b0
mov rcx, r14
call fcn.140021d7c
mov r14, rbx
mov qword [rbp + 0x38], rbx
mov rbx, qword [rbp + 0x28]
movsxd rax, esi
cmp r12b, byte [rax + rbx]
jne 0x140008c70
inc esi
mov dword [rbp], esi
movsxd rcx, esi
cmp byte [rcx + rbx], 0
jne 0x140008c75
movsxd rax, r15d
sub rax, rcx
mov byte [rax + r14], 0
test r14, r14
je 0x140008c50
or rcx, 0xffffffffffffffff
inc rcx
cmp byte [r14 + rcx], 0
jne 0x140008be4
inc ecx
cmp ecx, 0x3fffffff
jg 0x140008c50
movsxd rax, ecx
add rax, rax
lea rdx, [rax + 0xf]
cmp rdx, rax
ja 0x140008c11
movabs rdx, 0xffffffffffffff0
and rdx, 0xfffffffffffffff0
mov rax, rdx
call fcn.1401b1e20
sub rsp, rdx
lea rbx, [rsp + 0x40]
test rbx, rbx
je 0x140008c50
mov word [rbx], di
mov dword [rsp + 0x28], ecx
mov qword [rsp + 0x20], rbx
or r9d, 0xffffffff
mov r8, r14
xor edx, edx
lea ecx, [rdx + 3]
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
cmove rbx, rdi
jmp 0x140008c53
mov rbx, rdi
or r9d, 0xffffffff
or r8d, r9d
mov rdx, rbx
mov rcx, qword [rbp + 0x40]
call fcn.1400081b0
mov r15d, edi
mov dword [rbp + 0x14], edi
mov rbx, qword [rbp + 0x28]
mov dword [rbp], edi
mov esi, edi
mov r12, qword [rbp + 0x30]
jmp 0x140008b10
movsxd rax, r15d
mov byte [rax + r14], 0
test r14, r14
je 0x140008cff
or rcx, 0xffffffffffffffff
inc rcx
cmp byte [r14 + rcx], 0
jne 0x140008c93
inc ecx
cmp ecx, 0x3fffffff
jg 0x140008cff
movsxd rax, ecx
add rax, rax
lea rdx, [rax + 0xf]
cmp rdx, rax
ja 0x140008cc0
movabs rdx, 0xffffffffffffff0
and rdx, 0xfffffffffffffff0
mov rax, rdx
call fcn.1401b1e20
sub rsp, rdx
lea rbx, [rsp + 0x40]
test rbx, rbx
je 0x140008cff
mov word [rbx], di
mov dword [rsp + 0x28], ecx
mov qword [rsp + 0x20], rbx
or r9d, 0xffffffff
mov r8, r14
xor edx, edx
lea ecx, [rdx + 3]
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
cmove rbx, rdi
jmp 0x140008d02
mov rbx, rdi
or r9d, 0xffffffff
or r8d, r9d
mov rdx, rbx
mov rbx, qword [rbp + 0x40]
mov rcx, rbx
call fcn.1400081b0
mov dword [rbx + 0x40], 1
mov eax, dword [rbp + 0x1c]
and eax, 1
mov dword [rbx + 0x44], eax
mov dword [rbx + 0x48], edi
mov qword [rbx + 0xb0], rdi
mov dword [rbx + 0x54], 0x80000
mov qword [rbx + 0xa8], rdi
mov edi, 1
mov dword [rsp + 0x20], 0xffffffff
mov r9d, 0x1000
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call fcn.14000a130
mov r15, qword [rbp + 8]
test r14, r14
je 0x140008d71
mov rcx, r14
call fcn.140021d7c
test r15, r15
je 0x140008d7f
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov rcx, qword [rbp + 0x50]
xor rcx, rbp
call fcn.1401b1e80
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.140053250
test eax, eax
jne 0x1400191b4
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret
lea rcx, [rdi + 0x180]
or r8d, 0xffffffff
mov rdx, rbx
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
jmp 0x140008990