Function at 0x180003170
Capabilities:
Read file on windows
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x40
xor ebx, ebx
mov rsi, rdx
mov rdi, rcx
mov r12d, 0xfffffff6
lea r9d, [rbx + 2]
xor r8d, r8d
mov rcx, rsi
mov edx, r12d
mov dword [rbp + 0x58], ebx
mov dword [rbp - 0x10], ebx
mov r15d, ebx
mov dword [rbp - 0xc], ebx
mov word [rbp + 0x50], bx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x180003442
lea r9, [rbp - 0x10]
lea r8d, [rbx + 4]
lea rdx, [rbp - 0xc]
mov rcx, rsi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180003442
cmp dword [rbp - 0x10], 4
jne 0x180003442
mov r13d, dword [rbp - 0xc]
lea r9, [rbp - 0x10]
lea r8d, [rbx + 2]
lea rdx, [rbp + 0x50]
mov rcx, rsi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180003442
cmp dword [rbp - 0x10], 2
jne 0x180003442
lea r9, [rbp - 0x10]
lea r8d, [rbx + 4]
lea rdx, [rbp - 0xc]
mov rcx, rsi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180003442
cmp dword [rbp - 0x10], 4
jne 0x180003442
xor r8d, r8d
lea r9d, [rbx + 2]
mov rcx, rsi
cmp r13d, 0x53706158
jne 0x180003273
sub r12d, dword [rbp - 0xc]
mov edx, r12d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x180003284
jmp 0x180003442
xor edx, edx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x180003442
mov rax, qword [rdi + 8]
test rax, rax
je 0x180003428
movzx ecx, word [rax + 4]
test cx, cx
je 0x180003428
mov r13d, ebx
cmp bx, cx
jae 0x1800033a6
mov r12, rbx
nop dword [rax]
movsxd rax, r13d
lea r9, [rbp + 0x58]
mov r8d, 2
lea r14, [rax + rax*2]
mov rax, qword [rdi + 0x10]
mov rcx, rsi
lea rdx, [rax + r14*8]
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180003442
cmp dword [rbp + 0x58], 2
jne 0x180003442
mov rax, qword [rdi + 0x10]
lea r9, [rbp + 0x58]
mov r8d, 2
lea rdx, [rax + r14*8 + 2]
mov rcx, rsi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180003442
cmp dword [rbp + 0x58], 2
jne 0x180003442
mov rax, qword [rdi + 0x10]
lea r9, [rbp + 0x58]
mov r8d, 4
lea rdx, [rax + r14*8 + 4]
mov rcx, rsi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180003442
cmp dword [rbp + 0x58], 4
jne 0x180003442
mov rdx, qword [rdi + 0x10]
lea r9, [rbp + 0x58]
mov rcx, rsi
mov r8d, dword [rdx + r12 + 4]
mov rdx, qword [rdx + r12 + 8]
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180003442
mov rax, qword [rdi + 0x10]
mov ecx, dword [rax + r12 + 4]
cmp ecx, dword [rbp + 0x58]
jne 0x180003442
mov rax, qword [rdi + 8]
lea r15d, [r15 + rcx + 8]
inc r13d
movzx ecx, word [rax + 4]
add r12, 0x18
cmp r13d, ecx
jl 0x1800032b0
mov rax, qword [rdi + 8]
lea r9, [rbp + 0x58]
mov r8d, 4
mov dword [rax + 8], r15d
mov rdx, qword [rdi + 8]
mov rcx, rsi
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180003442
cmp dword [rbp + 0x58], 4
jne 0x180003442
mov rdx, qword [rdi + 8]
lea r9, [rbp + 0x58]
mov r8d, 2
mov rcx, rsi
add rdx, 4
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180003442
cmp dword [rbp + 0x58], 2
jne 0x180003442
mov rdx, qword [rdi + 8]
lea r9, [rbp + 0x58]
mov r8d, 4
mov rcx, rsi
add rdx, 8
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180003442
cmp dword [rbp + 0x58], 4
jne 0x180003442
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x180003442
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x180003447
mov ebx, 0x80004005
mov eax, ebx
mov rbx, qword [rsp + 0x80]
add rsp, 0x40
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret