Function at 0x18005de80
Capabilities:
Check if file exists
Get file size
Read file on windows
Write file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x2c0
mov qword [rsp + 0x88], 0xfffffffffffffffe
mov qword [rsp + 0x310], rbx
mov rax, qword [0x1800f7050]
xor rax, rsp
mov qword [rsp + 0x2b0], rax
mov r14, rdx
mov rbp, rcx
xor ebx, ebx
lea r12d, [rbx + 1]
mov r15d, 0x80000000
nop dword [rax + rax]
mov word [rsp + 0xa0], bx
xor edx, edx
mov r8d, 0x206
lea rcx, [rsp + 0xa2]
call fcn.1800644c0
lea rdx, [rbp + 0xc0]
lea rcx, [rsp + 0xa0]
call qword [sym.imp.KERNEL32.dll_lstrcpyW]
mov word [rsp + 0x90], bx
xor eax, eax
mov qword [rsp + 0x92], rax
mov r8d, r12d
lea rdx, str..v_02d
lea rcx, [rsp + 0x90]
call fcn.18005fb30
lea rdx, [rsp + 0x90]
lea rcx, [rsp + 0xa0]
call qword [sym.imp.KERNEL32.dll_lstrcatW]
mov edx, 0xc0000000
cmp dword [rbp + 0x24], 0
cmovne edx, r15d
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], 0x20000000
mov dword [rsp + 0x20], 3
xor r9d, r9d
lea r8d, [r9 + 1]
lea rcx, [rsp + 0xa0]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x18005dff6
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x18005e0e8
cmp dword [rbp + 0x24], 0
jne 0x18005e0d3
cmp eax, 5
je 0x18005dfb9
cmp eax, 0x20
je 0x18005dfb9
cmp eax, 0xa7
je 0x18005dfb9
cmp eax, 0x21
je 0x18005dfb9
cmp eax, 0x13
jne 0x18005e0d3
mov dword [rbp + 0x24], 1
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], 3
xor r9d, r9d
lea r8d, [r9 + 1]
mov edx, r15d
lea rcx, [rsp + 0xa0]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rsi, rax
cmp rax, 0xffffffffffffffff
je 0x18005e0c9
mov qword [rsp + 0x50], rsi
mov qword [rsp + 0x48], rbx
lea rdx, [rsp + 0x48]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x18005e4e2
mov rcx, qword [rsp + 0x48]
mov rax, rcx
cqo
and edx, 0x1ff
add rax, rdx
and eax, 0x1ff
cmp rax, rdx
jne 0x18005e4d2
mov qword [rsp + 0x58], rcx
lea rcx, [rbp + 0x90]
lea rdx, [rsp + 0x50]
call fcn.18004ef70
cmp dword [rbp + 0x24], 0
jne 0x18005e0bb
mov qword [rsp + 0x80], 7
mov qword [rsp + 0x78], rbx
mov word [rsp + 0x68], bx
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0xa0]
repne scasw ax, word [rdi]
not rcx
lea r8, [rcx - 1]
lea rdx, [rsp + 0xa0]
lea rcx, [rsp + 0x60]
call fcn.180002750
nop
lea rcx, [rbp + 0x2c8]
lea rdx, [rsp + 0x60]
call fcn.180013750
nop
cmp qword [rsp + 0x80], 8
jb 0x18005e0bb
mov rcx, qword [rsp + 0x68]
call fcn.1800620e0
inc r12d
cmp r12d, 0x40
jg 0x18005e0e8
jmp 0x18005ded0
call fcn.1800030e0
jmp 0x18005e4f4
test eax, eax
jle 0x18005e4f4
movzx eax, ax
or eax, 0x80070000
jmp 0x18005e4f4
lea rcx, [rbp + 0x90]
call fcn.18005f9b0
mov r15, rax
mov rdi, qword [rax + 8]
sub rdi, 0x200
mov qword [rsp + 0x48], rdi
xor edx, edx
mov r8d, 0x200
mov rcx, r14
call fcn.1800644c0
mov r12, qword [r15]
lea rsi, [rbp + 0x10]
cmp r12, 0xffffffffffffffff
je 0x18005e4cb
test r14, r14
je 0x18005e4cb
mov rax, rdi
cqo
and edx, 0x1ff
add rax, rdx
and eax, 0x1ff
cmp rax, rdx
je 0x18005e16e
mov qword [rsp + 0x28], rbx
mov dword [rsp + 0x20], 0x200
mov r9, r14
lea r8, [rsp + 0x48]
mov rdx, r12
mov rcx, rsi
call fcn.180003d30
jmp 0x18005e228
xor r9d, r9d
xor r8d, r8d
mov rdx, rdi
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x18005e18e
call fcn.1800030e0
jmp 0x18005e228
mov dword [rsp + 0x40], ebx
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x40]
mov r8d, 0x200
mov rdx, r14
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x18005e239
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6f8
je 0x18005e1d8
cmp eax, 0x3e6
je 0x18005e1d8
test eax, eax
jle 0x18005e228
movzx eax, ax
or eax, 0x80070000
jmp 0x18005e228
mov edx, 0x200
mov rcx, rsi
call fcn.180003cc0
test eax, eax
js 0x18005e228
cmp eax, 1
je 0x18005e228
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x40]
mov r8d, 0x200
mov rdx, qword [rsi]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x18005e215
call fcn.1800030e0
jmp 0x18005e228
mov r8d, 0x200
mov rdx, qword [rsi]
mov rcx, r14
call fcn.180063290
jmp 0x18005e239
test eax, eax
js 0x18005e4f4
cmp eax, 1
je 0x18005e4f4
mov rdx, r14
mov rcx, rbp
call fcn.18005d7b0
test eax, eax
je 0x18005e24f
xor eax, eax
jmp 0x18005e4f4
xor edx, edx
mov r8d, 0x200
mov rcx, r14
call fcn.1800644c0
mov rdi, qword [rbp + 0xa8]
cmp rdi, qword [rbp + 0xb0]
jbe 0x18005e274
call fcn.18006265c
mov r11, qword [rbp + 0x90]
test r11, r11
jne 0x18005e28a
call fcn.18006265c
mov r11, rbx
jmp 0x18005e28d
mov r11, qword [r11]
cmp rdi, qword [r11 + 0x20]
jb 0x18005e298
call fcn.18006265c
mov rdi, qword [rdi]
cmp rdi, 0xffffffffffffffff
je 0x18005e4c4
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x18005e2c5
call fcn.1800030e0
jmp 0x18005e35f
mov dword [rsp + 0x40], ebx
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x40]
mov r8d, 0x200
mov rdx, r14
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x18005e370
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6f8
je 0x18005e30f
cmp eax, 0x3e6
je 0x18005e30f
test eax, eax
jle 0x18005e35f
movzx eax, ax
or eax, 0x80070000
jmp 0x18005e35f
mov edx, 0x200
mov rcx, rsi
call fcn.180003cc0
test eax, eax
js 0x18005e35f
cmp eax, 1
je 0x18005e35f
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x40]
mov r8d, 0x200
mov rdx, qword [rsi]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x18005e34c
call fcn.1800030e0
jmp 0x18005e35f
mov r8d, 0x200
mov rdx, qword [rsi]
mov rcx, r14
call fcn.180063290
jmp 0x18005e370
test eax, eax
js 0x18005e4f4
cmp eax, 1
je 0x18005e4f4
mov rdx, r14
mov rcx, rbp
call fcn.18005d7b0
test eax, eax
jne 0x18005e389
mov eax, 0xe0035003
jmp 0x18005e4f4
cmp dword [rbp + 0x24], 0
je 0x18005e396
xor eax, eax
jmp 0x18005e4f4
mov rdi, qword [r15 + 8]
dec rdi
and rdi, 0xfffffffffffffe00
mov qword [rsp + 0x48], rdi
mov rbp, qword [r15]
cmp rbp, 0xffffffffffffffff
je 0x18005e4bd
mov rax, rdi
cqo
and edx, 0x1ff
add rax, rdx
and eax, 0x1ff
cmp rax, rdx
je 0x18005e3f3
mov qword [rsp + 0x28], rbx
mov dword [rsp + 0x20], 0x200
mov r9, r14
lea r8, [rsp + 0x48]
mov rdx, rbp
mov rcx, rsi
call fcn.180003e90
jmp 0x18005e4a5
xor r9d, r9d
xor r8d, r8d
mov rdx, rdi
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x18005e413
call fcn.1800030e0
jmp 0x18005e4a5
mov dword [rsp + 0x40], ebx
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x40]
mov r8d, 0x200
mov rdx, r14
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x18005e4ae
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6f8
je 0x18005e459
cmp eax, 0x3e6
je 0x18005e459
test eax, eax
jle 0x18005e4a5
movzx eax, ax
or eax, 0x80070000
jmp 0x18005e4a5
mov edx, 0x200
mov rcx, rsi
call fcn.180003cc0
test eax, eax
js 0x18005e4a5
cmp eax, 1
je 0x18005e4a5
mov r8d, 0x200
mov rdx, r14
mov rcx, qword [rsi]
call fcn.180063290
mov qword [rsp + 0x20], rbx
lea r9, [rsp + 0x40]
mov r8d, 0x200
mov rdx, qword [rsi]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x18005e4ae
call fcn.1800030e0
test eax, eax
js 0x18005e4f4
cmp eax, 1
je 0x18005e4f4
add rdi, 0x200
mov qword [r15 + 8], rdi
xor eax, eax
jmp 0x18005e4f4
mov eax, 0x80070057
jmp 0x18005e4f4
mov eax, 0x80070057
jmp 0x18005e4f4
mov eax, 0x80070057
jmp 0x18005e4f4
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0xe0035003
jmp 0x18005e4f4
call fcn.1800030e0
mov edi, eax
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov rcx, qword [rsp + 0x2b0]
xor rcx, rsp
call fcn.180062100
mov rbx, qword [rsp + 0x310]
add rsp, 0x2c0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret