Function at 0x18005c990
Capabilities:
Write file on windows

Disassembly:
mov r11, rsp
push rdi
push r13
push r14
sub rsp, 0x270
mov rax, qword [0x18010f050]
xor rax, rsp
mov qword [rsp + 0x240], rax
mov r14d, edx
mov r13, r8
mov r8, qword [rcx + 0xc8]
sub r8, qword [rcx + 0xc0]
mov rdi, rcx
movabs r9, 0x2aaaaaaaaaaaaaab
mov rax, r9
imul r8
sar rdx, 3
mov rcx, rdx
shr rcx, 0x3f
add rdx, rcx
je 0x18005cc99
cmp dword [rdi + 0x24], 0
jne 0x18005cc99
mov rcx, qword [rdi + 0xc8]
mov qword [r11 + 0x20], rbx
mov qword [r11 - 0x20], rbp
sub rcx, qword [rdi + 0xc0]
mov rax, r9
mov qword [r11 - 0x28], rsi
mov qword [r11 - 0x30], r12
imul rcx
sar rdx, 3
mov rax, rdx
shr rax, 0x3f
add rdx, rax
jne 0x18005ca2f
call fcn.180076fcc
mov r12, qword [rdi + 0xc0]
lea rcx, [rsp + 0x41]
xor edx, edx
mov ebx, dword [r12 + 0x10]
lea rsi, [r12 + 0x10]
mov r8d, 0x1ff
mov qword [rsp + 0x250], r15
mov byte [rsp + 0x40], 0
mov dword [r13], ebx
call fcn.1800795c0
mov ecx, dword [r12 + 0x14]
mov r11d, dword [r12 + 0x1c]
mov eax, dword [r12 + 0x24]
mov rbp, qword [r12]
lea edx, [rcx + r11]
imul rdx, rbx
add rdx, rax
add rdx, rcx
lea rcx, [rdx + r11 - 0x200]
mov qword [rsp + 0x30], rcx
cmp rbp, 0xffffffffffffffff
je 0x18005cc92
mov rax, rcx
xor r15d, r15d
cqo
and edx, 0x1ff
add rax, rdx
and eax, 0x1ff
cmp rax, rdx
je 0x18005cade
lea r9, [rsp + 0x40]
lea r8, [rsp + 0x30]
lea rcx, [rdi + 0x10]
mov rdx, rbp
mov qword [rsp + 0x28], r15
mov dword [rsp + 0x20], 0x200
call fcn.180003fd0
jmp 0x18005cb9c
mov rdx, rcx
xor r9d, r9d
xor r8d, r8d
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x18005cafe
call fcn.180003220
jmp 0x18005cb9c
lea r9, [rsp + 0x38]
lea rdx, [rsp + 0x40]
mov r8d, 0x200
mov rcx, rbp
mov dword [rsp + 0x38], r15d
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x18005cbad
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6f8
je 0x18005cb4b
cmp eax, 0x3e6
je 0x18005cb4b
test eax, eax
jle 0x18005cb9c
movzx eax, ax
or eax, 0x80070000
jmp 0x18005cb9c
lea rcx, [rdi + 0x10]
mov edx, 0x200
call fcn.180003e00
test eax, eax
js 0x18005cb9c
cmp eax, 1
je 0x18005cb9c
mov rcx, qword [rdi + 0x10]
lea rdx, [rsp + 0x40]
mov r8d, 0x200
call fcn.1800785c0
mov rdx, qword [rdi + 0x10]
lea r9, [rsp + 0x38]
mov r8d, 0x200
mov rcx, rbp
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x18005cbad
call fcn.180003220
test eax, eax
js 0x18005cc4d
cmp eax, 1
je 0x18005cc4d
mov rcx, qword [r12 + 8]
mov eax, dword [r13]
mov edx, r14d
sub edx, dword [r12 + 0x28]
shl edx, 2
mov dword [rdx + rcx], eax
mov eax, dword [r12 + 0x20]
mov rdx, qword [r12]
lea rcx, [rax + r14*4]
mov qword [rsp + 0x30], rcx
cmp rdx, 0xffffffffffffffff
je 0x18005cc92
lea r8, [rsp + 0x30]
lea rcx, [rdi + 0x10]
mov r9, r13
mov qword [rsp + 0x28], r15
mov dword [rsp + 0x20], 4
call fcn.180003fd0
test eax, eax
js 0x18005cc4d
cmp eax, 1
je 0x18005cc4d
inc dword [rsi]
cmp dword [rdi + 0x68], r15d
mov rdx, qword [r12]
mov eax, 0x184
mov ecx, 0x170
cmove rax, rcx
mov qword [rsp + 0x30], rax
test rsi, rsi
je 0x18005cc92
cmp rdx, 0xffffffffffffffff
je 0x18005cc92
lea r8, [rsp + 0x30]
lea rcx, [rdi + 0x10]
mov r9, rsi
mov qword [rsp + 0x28], r15
mov dword [rsp + 0x20], 4
call fcn.180003fd0
mov r15, qword [rsp + 0x250]
mov rsi, qword [rsp + 0x260]
mov rbp, qword [rsp + 0x268]
mov rbx, qword [rsp + 0x2a8]
mov r12, qword [rsp + 0x258]
mov rcx, qword [rsp + 0x240]
xor rcx, rsp
call fcn.180076a70
add rsp, 0x270
pop r14
pop r13
pop rdi
ret
mov eax, 0x80070057
jmp 0x18005cc4d
mov eax, 0x80004005
jmp 0x18005cc75