Function at 0x140065820
Capabilities:
Write file on windows

Disassembly:
push r14
sub rsp, 0x90
movsxd rax, ecx
lea rcx, [rax + rax*8]
mov rax, qword [0x140124308]
lea r14, [rcx*8]
mov qword [rsp + 0xb8], r14
cmp dword [r14 + rax + 0x34], 0
je 0x140065bca
mov qword [rsp + 0x88], rbx
mov rbx, qword [r14 + rax + 0x18]
mov qword [rsp + 0x78], rsi
cmp qword [rbx + 0x40], 0
jne 0x1400658fa
mov rcx, rbx
call fcn.1400654c0
mov rcx, qword [0x140124308]
add rcx, r14
mov rdx, qword [rcx + 0x18]
movsxd r8, dword [rdx + 0xfc]
cmp eax, r8d
jge 0x1400658b6
xor esi, esi
cmp dword [rcx + 0x3c], 5
mov dword [rcx + 0x34], esi
je 0x1400658df
mov dword [rcx + 0x3c], 5
mov r8, rdx
mov edx, dword [rdx + 0xbc]
mov ecx, eax
call fcn.1400653d0
jmp 0x1400658df
mov rax, r8
add rax, qword [rdx + 0x100]
cmp rax, qword [rcx]
jbe 0x1400658cf
mov qword [rcx], rax
mov dword [rcx + 0x40], 1
xor esi, esi
mov dword [rdx + 0x10], esi
xor edx, edx
mov rcx, qword [rcx + 0x18]
call fcn.14005a5f0
mov rax, qword [0x140124308]
mov qword [r14 + rax + 0x18], rsi
mov qword [r14 + rax + 0x20], rsi
mov dword [r14 + rax + 0x34], esi
jmp 0x140065bbd
mov qword [rsp + 0x80], rbp
xor esi, esi
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x68], r12
mov qword [rsp + 0x60], r13
mov qword [rsp + 0x58], r15
mov r15d, esi
mov qword [rsp + 0xb0], rsi
nop dword [rax]
nop word [rax + rax]
mov rcx, qword [rbx + 0x40]
lea r12, [rbx + 0x40]
mov ebp, dword [rbx + 0xfc]
mov r13, rbx
mov edx, 1
test rcx, rcx
je 0x14006598e
nop dword [rax + rax]
movsxd rax, dword [rbx + 0xfc]
add rax, qword [rbx + 0x100]
cmp rax, qword [rcx + 0x100]
jne 0x14006598e
cmp edx, 0x400
jge 0x14006598e
cmp ebp, 0x100000
jge 0x14006598e
add ebp, dword [rcx + 0xfc]
inc edx
mov dword [rbx + 0x10], esi
mov rbx, rcx
mov rcx, qword [rcx + 0x40]
test rcx, rcx
jne 0x140065950
lea rax, [rbx + 0x40]
add r15d, ebp
mov rbx, qword [rax]
mov qword [rax], rsi
mov dword [rsp + 0xa0], r15d
cmp qword [r12], rsi
jne 0x1400659b8
mov rcx, r13
call fcn.1400654c0
mov edi, eax
jmp 0x140065aa4
mov r15d, esi
lea r14, [0x140124340]
mov rdi, r13
cmp dword [rdi + 4], 2
je 0x140065a8f
movsxd r8, dword [rdi + 0xfc]
mov rcx, r14
mov rdx, qword [rdi + 0x80]
call fcn.14006ffd0
movsxd rcx, dword [rdi + 0xfc]
mov rdi, qword [rdi + 0x40]
add r14, rcx
add r15d, ecx
test rdi, rdi
jne 0x1400659c5
call fcn.140051fb0
mov ecx, dword [r13 + 0x100]
lea r9, [rsp + 0xa8]
mov dword [rsp + 0x40], ecx
lea rdx, [0x140124340]
mov rcx, qword [r13 + 0x100]
mov r14, rax
shr rcx, 0x20
lea rax, [rsp + 0x30]
mov dword [rsp + 0x44], ecx
mov r8d, r15d
mov rcx, qword [r13 + 0xf0]
mov qword [rsp + 0x30], rsi
mov qword [rsp + 0x38], rsi
mov qword [rsp + 0x48], rsi
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140065a65
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
neg edi
jmp 0x140065a6c
mov edi, dword [rsp + 0xa8]
call fcn.140051fb0
sub rax, r14
cmp rax, 0x3e8
jle 0x140065a94
mov ecx, dword [r13 + 0xbc]
mov r8, rax
mov edx, edi
call fcn.140065be0
jmp 0x140065a94
mov edi, 0xfffffffc
mov r15d, dword [rsp + 0xa0]
mov r14, qword [rsp + 0xb8]
cmp edi, ebp
jge 0x140065b48
test rbx, rbx
je 0x140065ace
mov rax, rbx
mov dword [rax + 0x10], esi
mov rax, qword [rax + 0x40]
test rax, rax
jne 0x140065ab4
lea edx, [rax + 1]
mov rcx, rbx
call fcn.14005a5f0
mov rbx, rsi
mov rcx, qword [r12]
test rcx, rcx
je 0x140065ae1
mov edx, 1
call fcn.14005a5f0
mov rax, qword [0x140124308]
cmp dword [r14 + rax + 0x3c], 5
mov dword [r14 + rax + 0x34], esi
mov qword [r14 + rax + 0x18], rsi
mov qword [r14 + rax + 0x20], rsi
je 0x140065b19
mov dword [r14 + rax + 0x3c], 5
mov r8, r13
mov edx, dword [r13 + 0xbc]
mov ecx, edi
call fcn.1400653d0
mov rdi, qword [rsp + 0xb0]
test rbx, rbx
je 0x140065b87
mov rax, qword [0x140124308]
cmp dword [r14 + rax + 0x3c], 1
jne 0x140065930
cmp r15d, 0x100000
jl 0x140065930
jmp 0x140065b87
movsxd rdi, ebp
mov edx, 1
add rdi, qword [r13 + 0x100]
mov rcx, r13
mov qword [rsp + 0xb0], rdi
call fcn.14005a5f0
mov rcx, qword [0x140124308]
add rcx, r14
sub dword [rcx + 0x34], ebp
cmp r13, qword [rcx + 0x18]
jne 0x140065b7e
mov qword [rcx + 0x18], rbx
test rbx, rbx
jne 0x140065b21
mov qword [rcx + 0x20], rsi
mov rax, qword [0x140124308]
mov r15, qword [rsp + 0x58]
mov r13, qword [rsp + 0x60]
mov r12, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x80]
cmp rdi, qword [r14 + rax]
jbe 0x140065bb8
mov qword [r14 + rax], rdi
mov dword [r14 + rax + 0x40], 1
mov rdi, qword [rsp + 0x70]
mov rbx, qword [rsp + 0x88]
mov rsi, qword [rsp + 0x78]
add rsp, 0x90
pop r14
ret