Function at 0x140057810
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 0x140057871
test rsi, rsi
je 0x140057867
mov rcx, rsi
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
mov eax, 0x80004004
jmp 0x140057b48
mov rax, qword [r14]
mov rcx, r14
mov rax, qword [rax + 8]
call qword [case.0x140057c6a.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 0x14005799f
lea ecx, [r15 + 0x58]
call fcn.1400c8b40
mov rdi, rax
test rax, rax
je 0x1400578f5
mov qword [rax + 8], rbx
lea rax, [0x1400d4dd0]
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 0x1400578f8
mov rdi, rbx
mov r8, qword [rsp + 0x90]
cmp rdi, r8
je 0x14005791d
lea rcx, [rsp + 0x90]
call fcn.140058054
mov r8, rdi
mov qword [rsp + 0x90], rdi
xor edx, edx
lea ecx, [rdx + 1]
call fcn.14000bee0
mov edi, eax
test eax, eax
jns 0x1400579eb
mov byte [rsp + 0x58], bl
lea rcx, [rsp + 0x48]
call fcn.140057b60
nop
lea rcx, [rsp + 0x90]
call fcn.140058054
nop
test rsi, rsi
je 0x14005795c
mov rcx, rsi
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_LeaveCriticalSection]
mov eax, edi
jmp 0x140057b48
lea rax, [rsp + 0x90]
cmp rax, rdi
je 0x1400579cc
mov qword [rdi], rbx
test r15, r15
je 0x1400579cc
lea rcx, [rsp + 0x90]
call fcn.140058054
mov rcx, r15
mov qword [rsp + 0x90], rcx
lea rax, [rcx + 0x50]
cmp rdi, rax
je 0x1400579f3
mov r15, qword [rax]
mov qword [rax], rbx
cmp r15, qword [rdi]
je 0x1400579eb
mov rcx, rdi
call fcn.140058054
mov qword [rdi], r15
mov rcx, qword [rsp + 0x90]
add rcx, 0x30
mov rdx, r12
call fcn.140034874
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 0x140057a9d
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x3e5
je 0x140057a9d
movzx edi, ax
or edi, 0x80070000
test eax, eax
cmovle edi, eax
test edi, edi
js 0x140057aa3
mov edi, 0x8000ffff
jmp 0x140057aa3
mov edi, ebx
test ebx, ebx
jns 0x140057ab4
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 0x140057ac7
mov rax, qword [r15]
mov rcx, r15
mov rax, qword [rax + 8]
call qword [case.0x140057c6a.0]
nop
mov edi, ebx
test edi, edi
js 0x140057931
lea rdi, [r14 + 0xd8]
mov r14, qword [rsp + 0x90]
lea r15, [r14 + 0x50]
cmp r15, rdi
je 0x140057b05
mov r12, qword [rdi]
mov qword [rdi], rbx
cmp r12, qword [r15]
je 0x140057b05
mov rcx, r15
call fcn.140058054
mov qword [r15], r12
mov r14, qword [rsp + 0x90]
lea rax, [rsp + 0x90]
cmp rdi, rax
je 0x140057b2a
mov qword [rsp + 0x90], rbx
cmp r14, qword [rdi]
je 0x140057b2a
mov rcx, rdi
call fcn.140058054
mov qword [rdi], r14
lea rcx, [rsp + 0x90]
call fcn.140058054
nop
test rsi, rsi
je 0x140057b46
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