Function at 0x14005998c
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x60
mov qword [rax - 0x58], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov r12, rdx
mov r14, rcx
lea rsi, [rcx + 0x60]
mov qword [rsp + 0xa0], rsi
mov rcx, rsi
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_EnterCriticalSection]
mov qword [rsp + 0xa8], rsi
xor ebx, ebx
cmp byte [r14 + 0x88], bl
je 0x1400599ed
test rsi, rsi
je 0x1400599e3
mov rcx, rsi
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
mov eax, 0x80004004
jmp 0x140059cc4
mov rax, qword [r14]
mov rcx, r14
mov rax, qword [rax + 8]
call qword [case.0x140059dea.0]
mov rcx, rbx
mov qword [rsp + 0x90], rbx
lea rax, [rsp + 0x90]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x40], r14
movups xmm0, xmmword [rsp + 0x38]
movdqu xmmword [rsp + 0x48], xmm0
mov byte [rsp + 0x58], 1
lea rdi, [r14 + 0xd0]
mov r15, qword [rdi]
test r15, r15
jne 0x140059b1b
lea ecx, [r15 + 0x58]
call fcn.1400cade8
mov rdi, rax
test rax, rax
je 0x140059a71
mov qword [rax + 8], rbx
lea rax, [0x1400d5bf8]
mov qword [rdi], rax
mov qword [rdi + 0x30], rbx
mov qword [rdi + 0x38], rbx
mov qword [rdi + 0x40], rbx
mov dword [rdi + 0x48], ebx
mov qword [rdi + 0x50], rbx
jmp 0x140059a74
mov rdi, rbx
mov r8, qword [rsp + 0x90]
cmp rdi, r8
je 0x140059a99
lea rcx, [rsp + 0x90]
call fcn.14005a1dc
mov r8, rdi
mov qword [rsp + 0x90], rdi
xor edx, edx
lea ecx, [rdx + 1]
call fcn.14000cc54
mov edi, eax
test eax, eax
jns 0x140059b67
mov byte [rsp + 0x58], bl
lea rcx, [rsp + 0x48]
call fcn.140059ce0
nop
lea rcx, [rsp + 0x90]
call fcn.14005a1dc
nop
test rsi, rsi
je 0x140059ad8
mov rcx, rsi
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
mov eax, edi
jmp 0x140059cc4
lea rax, [rsp + 0x90]
cmp rax, rdi
je 0x140059b48
mov qword [rdi], rbx
test r15, r15
je 0x140059b48
lea rcx, [rsp + 0x90]
call fcn.14005a1dc
mov rcx, r15
mov qword [rsp + 0x90], rcx
lea rax, [rcx + 0x50]
cmp rdi, rax
je 0x140059b6f
mov r15, qword [rax]
mov qword [rax], rbx
cmp r15, qword [rdi]
je 0x140059b67
mov rcx, rdi
call fcn.14005a1dc
mov qword [rdi], r15
mov rcx, qword [rsp + 0x90]
add rcx, 0x30
mov rdx, r12
call fcn.140035844
mov rcx, qword [rsp + 0x90]
add rcx, 0x10
xor edx, edx
lea r8d, [rdx + 0x20]
call sub.msvcrt.dll_memset
mov rax, qword [rsp + 0x90]
mov rcx, qword [rax + 8]
mov qword [rax + 0x28], rcx
mov r15, qword [r14 + 0x90]
lock inc dword [r15 + 0x58]
mov rcx, qword [r15 + 0x30]
call qword [sym.imp.api_ms_win_core_threadpool_l1_2_0.dll_StartThreadpoolIo]
mov qword [rsp + 0x38], r15
mov byte [rsp + 0x40], 1
mov rax, qword [rsp + 0x90]
mov r8d, dword [rax + 0x48]
mov rdx, qword [rax + 0x40]
mov rcx, qword [r14 + 0x90]
add rax, 0x10
mov qword [rsp + 0x20], rax
xor r9d, r9d
mov rcx, qword [rcx + 0x20]
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
test eax, eax
jne 0x140059c19
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x3e5
je 0x140059c19
movzx edi, ax
or edi, 0x80070000
test eax, eax
cmovle edi, eax
test edi, edi
js 0x140059c1f
mov edi, 0x8000ffff
jmp 0x140059c1f
mov edi, ebx
test ebx, ebx
jns 0x140059c30
mov rcx, qword [r15 + 0x30]
call qword [sym.imp.api_ms_win_core_threadpool_l1_2_0.dll_CancelThreadpoolIo]
lock dec dword [r15 + 0x58]
jmp 0x140059c43
mov rax, qword [r15]
mov rcx, r15
mov rax, qword [rax + 8]
call qword [case.0x140059dea.0]
nop
mov edi, ebx
test edi, edi
js 0x140059aad
lea rdi, [r14 + 0xd8]
mov r14, qword [rsp + 0x90]
lea r15, [r14 + 0x50]
cmp r15, rdi
je 0x140059c81
mov r12, qword [rdi]
mov qword [rdi], rbx
cmp r12, qword [r15]
je 0x140059c81
mov rcx, r15
call fcn.14005a1dc
mov qword [r15], r12
mov r14, qword [rsp + 0x90]
lea rax, [rsp + 0x90]
cmp rdi, rax
je 0x140059ca6
mov qword [rsp + 0x90], rbx
cmp r14, qword [rdi]
je 0x140059ca6
mov rcx, rdi
call fcn.14005a1dc
mov qword [rdi], r14
lea rcx, [rsp + 0x90]
call fcn.14005a1dc
nop
test rsi, rsi
je 0x140059cc2
mov rcx, rsi
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
xor eax, eax
mov rbx, qword [rsp + 0x98]
add rsp, 0x60
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret