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

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x410]
sub rsp, 0x510
mov rax, qword [0x180026008]
xor rax, rsp
mov qword [rbp + 0x3f0], rax
mov rax, qword [rbp + 0x470]
xor r15d, r15d
mov qword [rsp + 0x60], rax
mov r14, rcx
mov rax, qword [rbp + 0x478]
mov esi, r15d
mov qword [rsp + 0x70], r9
mov edi, r15d
mov qword [rsp + 0x78], r8
xor r9d, r9d
mov qword [rsp + 0x50], rdx
xor r8d, r8d
xor edx, edx
mov qword [rbp - 0x78], rax
mov qword [rsp + 0x58], rcx
mov dword [rbp - 0x30], r15d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
lea edx, [r15 + 8]
mov r8d, 0x400
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
lea r9, [rbp - 0x2c]
mov dword [rbp - 0x2c], r15d
mov rdx, rax
mov qword [rsp + 0x20], r15
mov r8d, 0x400
mov rcx, r14
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
lea r12d, [r15 + 1]
test eax, eax
je 0x18000360b
cmp dword [rbp - 0x2c], 0x400
jne 0x18000360b
movsxd rax, dword [rbx + 0x3c]
mov edi, r12d
mov esi, dword [rax + rbx + 0x50]
test rbx, rbx
je 0x180003624
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
jne 0x18000362f
xor eax, eax
jmp 0x180003b4a
lea edi, [rsi + 0xfffff]
mov qword [rsp + 0x508], r13
mov eax, 0xfff00000
and rdi, rax
mov qword [rbp - 0x80], rdi
nop dword [rax]
lea rcx, str.kernel32
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
xorps xmm0, xmm0
mov rbx, rax
movups xmmword [rbp - 0x60], xmm0
movups xmmword [rbp - 0x50], xmm0
movups xmmword [rbp - 0x40], xmm0
sub rbx, rdi
je 0x1800036ab
nop dword [rax]
nop dword [rax + rax]
mov r8d, 0x30
lea rdx, [rbp - 0x60]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
cmp dword [rbp - 0x40], 0x10000
jne 0x1800036a2
cmp qword [rbp - 0x48], rdi
jae 0x1800036ab
sub rbx, 0x100000
jne 0x180003680
mov r12, qword [rbp - 0x60]
mov qword [rbp - 0x68], r12
test r12, r12
je 0x180003b3f
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
xor edx, edx
lea rcx, [rbp - 0x10]
mov r8d, 0x400
call fcn.18000a5a0
lea r9, [rbp - 0x28]
mov dword [rbp - 0x28], r15d
mov r8d, 0x400
mov qword [rsp + 0x20], r15
lea rdx, [rbp - 0x10]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x180003b3f
cmp dword [rbp - 0x28], 0x400
jne 0x180003b3f
mov rdi, qword [rsp + 0x60]
lea rdx, [rbp - 0x10]
movsxd rax, dword [rbp + 0x2c]
add rdx, rax
movsxd r8, dword [rdi + 0x3c]
add r8, rdi
movzx eax, word [r8 + 0x14]
mov ecx, dword [rax + r8 + 0x4c]
movzx eax, word [rdx + 0x14]
mov r13d, dword [rax + rdx + 0x4c]
sub r13, rcx
add r13, r12
mov qword [rsp + 0x68], r13
je 0x180003b3f
mov ebx, dword [r8 + 0x50]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, ebx
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rsi, rax
test rax, rax
je 0x180003b3f
movsxd r14, dword [rdi + 0x3c]
mov rdx, rdi
add r14, rdi
mov rcx, rax
mov r8d, dword [r14 + 0x54]
call fcn.18000aa00
movzx ebx, word [r14 + 0x14]
mov edi, r15d
add rbx, 0x2c
cmp r15w, word [r14 + 6]
jae 0x1800037d3
mov r12, qword [rsp + 0x60]
add rbx, r14
mov eax, dword [rbx - 4]
test eax, eax
je 0x1800037c0
mov edx, dword [rbx]
mov r8d, eax
mov ecx, dword [rbx - 8]
add rdx, r12
add rcx, rsi
call fcn.18000aa00
movzx eax, word [r14 + 6]
inc edi
add rbx, 0x28
cmp edi, eax
jl 0x1800037a6
mov r12, qword [rbp - 0x68]
mov rcx, rsi
call fcn.180001e30
test eax, eax
je 0x180003b2b
mov rdx, r13
mov rcx, rsi
call fcn.180001f90
test eax, eax
je 0x180003b2b
mov rcx, rsi
call fcn.180002090
test eax, eax
je 0x180003b2b
mov rcx, rsi
call fcn.180002150
test eax, eax
je 0x180003b2b
mov rbx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x58]
mov rdx, rbx
call fcn.180002fb0
test eax, eax
je 0x180003b2b
mov rdx, r12
mov rcx, rbx
call fcn.1800030d0
test eax, eax
je 0x180003b2b
mov r14d, r15d
mov dword [rbp - 0x20], r15d
mov dword [rbp - 0x70], r15d
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov edx, 8
mov r8d, 0x400
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rbx
mov r12, rax
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
lea r9, [rbp - 0x20]
mov qword [rsp + 0x20], r15
mov r8d, 0x400
mov rdx, r12
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x18000392b
cmp dword [rbp - 0x20], 0x400
jne 0x18000392b
movsxd rdx, dword [r12 + 0x3c]
xor r9d, r9d
movsxd rcx, dword [rsi + 0x3c]
add rdx, r12
add rcx, rsi
xor r8d, r8d
movzx eax, word [rdx + 0x14]
movzx edi, word [rcx + 0x14]
add rdi, rcx
mov rcx, rbx
mov edx, dword [rax + rdx + 0x54]
sub edx, dword [rdi + 0x4c]
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [rdi + 0x4c]
mov ebx, r15d
test eax, eax
je 0x18000391f
mov r13, qword [rsp + 0x50]
nop dword [rax + rax]
sub eax, ebx
mov edx, ebx
add rdx, rsi
mov qword [rsp + 0x20], r15
mov r8d, eax
lea r9, [rbp - 0x70]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x18000391a
add ebx, dword [rbp - 0x70]
mov eax, dword [rdi + 0x4c]
cmp ebx, eax
jb 0x1800038f0
mov r13, qword [rsp + 0x68]
cmp ebx, dword [rdi + 0x4c]
mov eax, 1
cmove r14d, eax
test r12, r12
je 0x180003944
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, r12
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
test r14d, r14d
je 0x180003b2b
mov rdi, qword [rbp - 0x68]
lea rcx, [rbp - 0x70]
mov r14, qword [rsp + 0x50]
xor r9d, r9d
mov qword [rsp + 0x30], r14
xor r8d, r8d
mov dword [rsp + 0x28], 0x1000000
mov ebx, r15d
mov qword [rbp - 0x20], r15
lea edx, [r9 + 0xf]
mov qword [rbp - 0x70], r15
mov qword [rbp - 0x68], rdi
mov dword [rsp + 0x20], 2
call fcn.1800093e1
mov r12d, 1
test eax, eax
js 0x1800039f7
mov rcx, qword [rbp - 0x70]
lea rax, [rbp - 0x18]
mov dword [rsp + 0x48], 4
lea r8, [rbp - 0x68]
mov dword [rsp + 0x40], r15d
xor r9d, r9d
mov dword [rsp + 0x38], r12d
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], r15
lea rdx, [r9 - 1]
mov qword [rbp - 0x18], r15
mov qword [rsp + 0x20], r15
call fcn.1800093ff
test eax, eax
js 0x1800039f7
mov rcx, qword [rbp - 0x68]
cmp rcx, rdi
jne 0x1800039f7
mov r8, qword [rsp + 0x70]
lea r9, [rbp - 0x20]
mov rdx, qword [rsp + 0x78]
call fcn.1800032f0
mov ebx, r12d
cmp qword [rbp - 0x70], r15
je 0x180003a12
mov edx, 0x519991a3
mov ecx, 0x8f8308d
call fcn.180004230
mov rcx, qword [rbp - 0x70]
call rax
test ebx, ebx
jne 0x180003a4f
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rsi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r14d, dword [rbp - 0x30]
mov eax, r14d
inc r14d
mov dword [rbp - 0x30], r14d
cmp eax, 0x64
jae 0x180003b3f
mov rdi, qword [rbp - 0x80]
mov r14, qword [rsp + 0x58]
jmp 0x180003650
movsxd rcx, dword [r13 + 0x3c]
lea r9, [rbp - 0x30]
add rcx, r13
mov r8d, 4
movzx ebx, word [rcx + 0x14]
mov eax, dword [rcx + 0x50]
add rbx, rcx
sub eax, dword [rbx + 0x4c]
mov dword [rbp - 0x30], r15d
mov ecx, dword [rbx + 0x4c]
add rcx, r13
mov edx, eax
mov edi, eax
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x180003a98
mov eax, dword [rbx + 0x4c]
mov r8d, edi
lea rdx, [rax + rsi]
lea rcx, [rax + r13]
call fcn.18000aa00
mov rcx, qword [rsp + 0x58]
mov rdx, r14
call fcn.180002fb0
movsxd rax, dword [r13 + 0x3c]
xor r8d, r8d
mov edx, r12d
mov rcx, r13
mov r9d, dword [rax + r13 + 0x28]
add r9, r13
call r9
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov edx, 8
mov rcx, rax
lea r8d, [rdx + 0x20]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rbx, rax
lea rcx, [0x18002a190]
mov qword [rax + 0x10], r13
mov dword [rax + 0x18], r12d
mov rax, qword [rbp - 0x20]
mov qword [rbx + 0x20], rax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rax, qword [0x18002a188]
lea rdx, [0x18002a180]
mov qword [rbx], rdx
lea rcx, [0x18002a190]
mov qword [rbx + 8], rax
mov qword [rax], rbx
mov qword [0x18002a188], rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, qword [rbp - 0x78]
mov r15d, r12d
mov qword [rax], r13
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rsi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r13, qword [rsp + 0x508]
mov eax, r15d
mov rcx, qword [rbp + 0x3f0]
xor rcx, rsp
call fcn.180009470
add rsp, 0x510
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret