Function at 0x140018d40
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 [0x1419d0c58]
xor rax, rbp
mov qword [rbp + 0x50], rax
mov ebx, r8d
mov rsi, rdx
mov r14, rcx
mov qword [rbp + 0x40], rcx
xor edi, edi
mov r12, rdi
mov qword [rbp + 8], rdi
mov dword [rbp + 0x18], 0x100
mov ecx, 0x100
call fcn.140022e20
mov r15, 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 0x14000843f
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 r12, rax
mov qword [rbp + 8], rax
cmp rax, 0xffffffffffffffff
je 0x14000843f
mov r12d, edi
mov dword [rbp + 0x14], edi
mov eax, 0x8000
call fcn.140080f60
sub rsp, rax
lea r13, [rsp + 0x40]
mov qword [rbp + 0x30], r13
mov qword [rsp + 0x20], rdi
lea r9, [rbp + 4]
mov r8d, eax
mov rdx, r13
mov rcx, qword [rbp + 8]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x14000843b
cmp ebx, 0xffffffff
jne 0x140008183
mov ecx, edi
mov dword [rbp + 0x20], ecx
mov r8d, dword [rbp + 4]
cmp ecx, r8d
jae 0x14000814f
mov eax, ecx
movzx edx, byte [rax + r13]
cmp dl, 0xd
je 0x14000814f
cmp dl, 0xa
je 0x14000814f
inc ecx
mov dword [rbp + 0x20], ecx
jmp 0x140008132
cmp edi, r8d
jne 0x140008158
mov ebx, edi
jmp 0x140008183
mov eax, edi
cmp byte [rax + r13], 0xa
jne 0x140008168
mov ebx, 1
jmp 0x140008183
lea eax, [r8 - 1]
cmp edi, eax
jae 0x14000817e
lea eax, [rdi + 1]
cmp byte [rax + r13], 0xa
jne 0x14000817e
mov ebx, edi
jmp 0x140008183
mov ebx, 2
mov dword [r14 + 0x4c], ebx
movsxd rax, ebx
lea rbx, [0x1400ba1c8]
mov rbx, qword [rbx + rax*8]
mov qword [rbp + 0x28], rbx
lea rcx, [r14 + 0x58]
xor edx, edx
mov r8d, 0x1000
call fcn.140005b40
mov r14d, edi
mov dword [rbp + 0x10], edi
mov esi, edi
mov dword [rbp], edi
nop word [rax + rax]
mov ecx, dword [rbp + 4]
cmp r14d, ecx
jae 0x14000833e
mov eax, r14d
movsx r13d, byte [rax + r13]
mov dword [rbp + 0x4c], r13d
inc r14d
mov dword [rbp + 0x10], r14d
cmp r14d, ecx
jne 0x140008214
cmp ecx, 0x8000
jne 0x140008214
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 0x140008435
mov r14d, edi
mov dword [rbp + 0x10], edi
movsxd rax, r12d
mov byte [rax + r15], r13b
inc r12d
mov dword [rbp + 0x14], r12d
mov eax, dword [rbp + 0x18]
cmp r12d, eax
jne 0x140008261
add eax, 0x100
mov dword [rbp + 0x18], eax
mov dword [rbp + 0x48], eax
movsxd rcx, eax
call fcn.140022e20
mov rbx, rax
movsxd r8, r12d
mov rdx, r15
mov rcx, rax
call fcn.140068860
mov rcx, r15
call fcn.140022e28
mov r15, rbx
mov qword [rbp + 0x38], rbx
mov rbx, qword [rbp + 0x28]
movsxd rax, esi
cmp r13b, byte [rax + rbx]
jne 0x140008330
inc esi
mov dword [rbp], esi
movsxd rcx, esi
cmp byte [rcx + rbx], 0
jne 0x140008335
movsxd rax, r12d
sub rax, rcx
mov byte [rax + r15], 0
test r15, r15
jne 0x140008295
mov rbx, rdi
jmp 0x14000830c
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_lstrlenA]
lea r9d, [rax + 1]
cmp r9d, 0x3fffffff
jle 0x1400082b0
mov rbx, rdi
jmp 0x14000830c
movsxd rax, r9d
add rax, rax
lea rcx, [rax + 0xf]
cmp rcx, rax
ja 0x1400082c9
movabs rcx, 0xffffffffffffff0
and rcx, 0xfffffffffffffff0
mov rax, rcx
call fcn.140080f60
sub rsp, rcx
lea rbx, [rsp + 0x40]
test rbx, rbx
je 0x140008309
mov word [rbx], di
mov dword [rsp + 0x28], r9d
mov qword [rsp + 0x20], rbx
or r9d, 0xffffffff
mov r8, r15
xor edx, edx
lea ecx, [rdx + 3]
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
cmove rbx, rdi
jmp 0x14000830c
mov rbx, rdi
or r9d, 0xffffffff
or r8d, r9d
mov rdx, rbx
mov rcx, qword [rbp + 0x40]
call fcn.140007d90
mov r12d, edi
mov dword [rbp + 0x14], edi
mov esi, edi
mov dword [rbp], edi
mov rbx, qword [rbp + 0x28]
jmp 0x140008335
mov esi, edi
mov dword [rbp], edi
mov r13, qword [rbp + 0x30]
jmp 0x1400081c0
movsxd rax, r12d
mov byte [rax + r15], 0
test r15, r15
jne 0x140008350
mov rbx, rdi
jmp 0x1400083c7
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_lstrlenA]
lea r9d, [rax + 1]
cmp r9d, 0x3fffffff
jle 0x14000836b
mov rbx, rdi
jmp 0x1400083c7
movsxd rax, r9d
add rax, rax
lea rcx, [rax + 0xf]
cmp rcx, rax
ja 0x140008384
movabs rcx, 0xffffffffffffff0
and rcx, 0xfffffffffffffff0
mov rax, rcx
call fcn.140080f60
sub rsp, rcx
lea rbx, [rsp + 0x40]
test rbx, rbx
je 0x1400083c4
mov word [rbx], di
mov dword [rsp + 0x28], r9d
mov qword [rsp + 0x20], rbx
or r9d, 0xffffffff
mov r8, r15
xor edx, edx
lea ecx, [rdx + 3]
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
cmove rbx, rdi
jmp 0x1400083c7
mov rbx, rdi
or r9d, 0xffffffff
or r8d, r9d
mov rdx, rbx
mov rbx, qword [rbp + 0x40]
mov rcx, rbx
call fcn.140007d90
mov dword [rbx + 0x40], 1
mov eax, dword [rbp + 0x1c]
and eax, 1
mov dword [rbx + 0x44], eax
mov dword [rbx + 0x48], edi
mov dword [rbx + 0xb4], edi
mov dword [rbx + 0xb0], edi
mov dword [rbx + 0x54], 0x80000
mov dword [rbx + 0xa8], edi
mov dword [rbx + 0xac], edi
mov edi, 1
mov dword [rsp + 0x20], 0xffffffff
mov r9d, 0x1000
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call fcn.1400059b0
mov r12, qword [rbp + 8]
jmp 0x14000843f
mov r12, qword [rbp + 8]
jmp 0x14000843f
mov r12, qword [rbp + 8]
test r15, r15
je 0x14000844c
mov rcx, r15
call fcn.140022e28
test r12, r12
je 0x14000845a
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov rcx, qword [rbp + 0x50]
xor rcx, rbp
call fcn.140068690
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.140052c7c
test eax, eax
jne 0x140018d64
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret
lea rcx, [rdi + 0xa0]
or r8d, 0xffffffff
mov rdx, rbx
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
jmp 0x140008030