Function at 0x14001d680
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 8], rcx
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x70
mov qword [rsp + 0x40], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rbp
mov qword [rax + 0x20], rsi
mov rdi, rcx
cmp qword [rcx + 0x68], 0
jne 0x14001d740
lea rcx, [rcx + 0x38]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp qword [rdi + 0x28], 0
je 0x14001d731
or esi, 0xffffffff
xor r15d, r15d
cmp qword [rdi + 0x28], r15
je 0x14001d731
mov rdx, qword [rdi + 0x20]
mov rcx, rdx
shr rcx, 1
mov rax, qword [rdi + 0x10]
and edx, 1
mov rax, qword [rax + rcx*8]
mov rdx, qword [rax + rdx*8]
sub rdx, 0x18
mov eax, esi
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x14001d707
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
inc qword [rdi + 0x20]
mov rax, qword [rdi + 0x18]
add rax, rax
mov rdx, qword [rdi + 0x20]
cmp rax, rdx
cmovbe rdx, r15
mov qword [rdi + 0x20], rdx
dec qword [rdi + 0x28]
jne 0x14001d72b
mov qword [rdi + 0x20], r15
cmp qword [rdi + 0x28], r15
jne 0x14001d6d4
lea rcx, [rdi + 0x38]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x14001da1f
or r13d, 0xffffffff
xor r15d, r15d
lea rsi, [rdi + 0x38]
nop dword [rax + rax]
lea rcx, section..data
mov rax, qword [section..data]
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x38], rbx
mov qword [rsp + 0x48], rsi
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [rsp + 0x50], 1
cmp qword [rdi + 0x28], 0
je 0x14001d9e5
lea rdx, [rsp + 0x58]
lea rcx, [rdi + 8]
call fcn.14004f000
mov r14, rax
mov rax, qword [rax]
test rax, rax
jne 0x14001d7a6
mov rax, r15
jmp 0x14001d7a9
mov rax, qword [rax]
mov r14, qword [r14 + 0x10]
mov rcx, r14
shr rcx, 1
and r14d, 1
mov rdx, qword [rax + 0x10]
cmp rdx, rcx
ja 0x14001d7c3
sub rcx, rdx
mov rax, qword [rax + 8]
mov rcx, qword [rax + rcx*8]
mov r14, qword [rcx + r14*8]
lea rcx, [r14 - 0x18]
lea rsi, [rbx - 0x18]
cmp rcx, rsi
je 0x14001d8fd
cmp dword [rsi + 0x10], 0
jl 0x14001d81f
mov rax, qword [rsi]
cmp qword [rcx], rax
jne 0x14001d81f
call fcn.14001d590
mov rbx, rax
mov ecx, r13d
lock xadd dword [rsi + 0x10], ecx
dec ecx
test ecx, ecx
jg 0x14001d811
mov rcx, qword [rsi]
mov r8, qword [rcx]
mov rdx, rsi
call qword [r8 + 8]
add rbx, 0x18
mov qword [rsp + 0x38], rbx
jmp 0x14001d8fd
movsxd rbp, dword [r14 - 0x10]
test ebp, ebp
jne 0x14001d87f
mov rbp, qword [rsi]
cmp dword [rsi + 8], 0
je 0x14001d8fd
cmp dword [rsi + 0x10], 0
jge 0x14001d850
cmp dword [rbx - 0xc], 0
jl 0x14001d9b9
mov dword [rbx - 0x10], r15d
mov byte [rbx], 0
jmp 0x14001d8fd
mov eax, r13d
lock xadd dword [rsi + 0x10], eax
dec eax
test eax, eax
jg 0x14001d86a
mov rcx, qword [rsi]
mov rax, qword [rcx]
mov rdx, rsi
call qword [rax + 8]
mov rax, qword [rbp]
mov rcx, rbp
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rsp + 0x38], rbx
jmp 0x14001d8fd
test r14, r14
je 0x14001d9da
mov eax, dword [rbx - 0x10]
mov dword [rsp + 0x30], eax
mov r13, r14
sub r13, rbx
test ebp, ebp
js 0x14001d9cf
mov ecx, 1
sub ecx, dword [rsi + 0x10]
mov eax, dword [rsi + 0xc]
sub eax, ebp
or eax, ecx
jge 0x14001d8bf
mov edx, ebp
lea rcx, [rsp + 0x38]
call fcn.14001d4b0
mov rbx, qword [rsp + 0x38]
mov eax, dword [rsp + 0x30]
mov rsi, rbp
movsxd rdx, dword [rbx - 0xc]
mov r9, rbp
mov rcx, rbx
cmp r13, rax
ja 0x14001d8e1
lea r8, [r13 + rbx]
call fcn.14005e528
jmp 0x14001d8e9
mov r8, r14
call fcn.14005e228
cmp ebp, dword [rbx - 0xc]
jg 0x14001d9c4
mov dword [rbx - 0x10], ebp
mov byte [rsi + rbx], 0
or r13d, 0xffffffff
cmp qword [rdi + 0x28], 0
je 0x14001d961
mov rdx, qword [rdi + 0x20]
mov rcx, rdx
shr rcx, 1
mov rax, qword [rdi + 0x10]
and edx, 1
mov rax, qword [rax + rcx*8]
mov rdx, qword [rax + rdx*8]
sub rdx, 0x18
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x14001d938
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
inc qword [rdi + 0x20]
mov rax, qword [rdi + 0x18]
add rax, rax
mov rcx, qword [rdi + 0x20]
cmp rax, rcx
cmovbe rcx, r15
mov qword [rdi + 0x20], rcx
mov rbx, qword [rsp + 0x38]
dec qword [rdi + 0x28]
jne 0x14001d961
mov qword [rdi + 0x20], r15
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov qword [rsp + 0x20], r15
lea r9, [rsp + 0x34]
mov r8d, dword [rbx - 0x10]
mov rdx, rbx
mov rcx, qword [rdi + 0x68]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x14001d991
call fcn.14001d660
nop
lea rdx, [rbx - 0x18]
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
lea rsi, [rdi + 0x38]
jg 0x14001d750
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
jmp 0x14001d747
mov ecx, 0x80070057
call fcn.14001e940
int3
mov ecx, 0x80070057
call fcn.14001e940
int3
mov ecx, 0x80070057
call fcn.14001e940
int3
mov ecx, 0x80070057
call fcn.14001e940
nop
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
nop
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], r13d
dec r13d
test r13d, r13d
jg 0x14001da0c
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
mov rcx, qword [rdi + 0x68]
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x14001da1f
call fcn.14001d660
lea r11, [rsp + 0x70]
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret