Function at 0x180005014
Capabilities:
Clear file content
Enumerate pe sections
Get file size
Parse pe header
Read file on windows
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov dword [rax + 0x20], r9d
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x1798]
mov eax, 0x1870
call sub.ntdll.dll___chkstk
sub rsp, rax
mov rbx, rdx
mov r15, rcx
lea r9, [rbp + 0xf70]
lea rdx, [rbp + 0x770]
mov rcx, rbx
mov r14, r8
call fcn.18000cf7c
xor r12d, r12d
xor r9d, r9d
mov qword [rsp + 0x30], r12
lea r8d, [r12 + 1]
mov edx, 0x80000000
mov rcx, rbx
mov dword [rsp + 0x28], 0x8000000
mov edi, r12d
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x180005351
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
test eax, eax
je 0x180005106
mov rcx, qword [0x180013580]
mov r8d, esi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
lea r9, [rbp + 0x17b8]
mov r8d, esi
mov rcx, rbx
mov rdx, rax
mov qword [rsp + 0x20], r12
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1800050ee
cmp dword [rbp + 0x17b8], esi
je 0x180005106
mov rcx, qword [0x180013580]
mov r8, rdi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rdi, r12
mov esi, r12d
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test rdi, rdi
je 0x180005351
mov eax, 0x5a4d
mov r9, r12
mov edx, r12d
mov r13d, 0x60000020
cmp word [rdi], ax
jne 0x180005174
movsxd rcx, dword [rdi + 0x3c]
add rcx, rdi
cmp dword [rcx], 0x4550
jne 0x180005174
movzx eax, word [rcx + 0x14]
movzx r10d, word [rcx + 6]
lea rdx, [rcx + 0x18]
add rdx, rax
mov r8d, r12d
test r10d, r10d
je 0x180005171
mov eax, dword [rdx + 0x24]
and eax, r13d
cmp eax, r13d
je 0x18000516e
inc r8d
add rdx, 0x28
cmp r8d, r10d
jb 0x180005155
jmp 0x180005171
mov r9, rdx
mov edx, dword [rcx + 0x28]
movsxd r10, dword [r14 + 0x3c]
mov rcx, r12
mov r11d, r12d
add r10, r14
movzx eax, word [r10 + 0x14]
movzx ebx, word [r10 + 6]
lea r8, [r10 + 0x18]
add r8, rax
test ebx, ebx
je 0x1800051b3
mov eax, dword [r8 + 0x24]
and eax, r13d
cmp eax, r13d
je 0x1800051b0
inc r11d
add r8, 0x28
cmp r11d, ebx
jb 0x180005196
jmp 0x1800051b3
mov rcx, r8
test r9, r9
je 0x18000533f
test rcx, rcx
je 0x18000533f
mov eax, dword [rcx + 0x10]
cmp dword [r9 + 0x10], eax
jne 0x1800051e1
mov eax, dword [r10 + 0x28]
sub edx, dword [r9 + 0xc]
sub eax, dword [rcx + 0xc]
cmp edx, eax
je 0x18000533f
call qword [sym.imp.KERNEL32.dll_GetTickCount]
lea r9, [rsp + 0x50]
lea r8, [rsp + 0x68]
mov dword [rsp + 0x54], eax
lea rax, [rsp + 0x54]
mov edx, esi
mov qword [rsp + 0x28], rax
mov rax, qword [r15 + 8]
mov rcx, rdi
mov qword [rsp + 0x20], rax
call fcn.1800063f0
mov rsi, qword [rsp + 0x68]
mov rdx, qword [r15 + 8]
mov rcx, qword [r15]
lea rax, [rsp + 0x58]
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0x60]
mov r8, r14
mov qword [rsp + 0x40], rax
mov eax, dword [rsp + 0x50]
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rsi
call fcn.180002548
test eax, eax
je 0x18000532d
movzx eax, word [rbp + 0x770]
mov word [rsp + 0x70], ax
test ax, ax
je 0x18000527e
mov rcx, r12
lea rcx, [rcx + 2]
movzx eax, word [rbp + rcx + 0x770]
mov word [rsp + rcx + 0x70], ax
test ax, ax
jne 0x180005268
lea rdx, [0x1800104b4]
lea rcx, [rsp + 0x70]
call fcn.18000cad0
lea rdx, [rbp + 0xf70]
lea rcx, [rsp + 0x70]
call fcn.18000cad0
lea rdx, [0x1800104a8]
lea rcx, [rsp + 0x70]
call fcn.18000cad0
mov qword [rsp + 0x30], r12
lea rcx, [rsp + 0x70]
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 4
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x180005319
mov r8d, dword [rsp + 0x58]
mov rdx, qword [rsp + 0x60]
lea r9, [rsp + 0x50]
mov rcx, rax
mov dword [rsp + 0x50], r12d
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r8, qword [rsp + 0x60]
mov rcx, qword [0x180013580]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [0x180013580]
mov r8, rsi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [0x180013580]
mov r8, rdi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
lea r11, [rsp + 0x1870]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rdi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret