Function at 0x140002100
Capabilities:
Write file on windows

Disassembly:
mov r11, rsp
mov qword [r11 + 0x20], rbx
push rsi
push rdi
push r12
sub rsp, 0x60
mov edx, dword [0x140008910]
xor ebx, ebx
xor edi, edi
xor eax, eax
lea r12, [0x140008fa0]
mov qword [r11 - 0x38], rbx
mov qword [r11 - 0x30], rdi
mov qword [r11 - 0x28], rdi
mov qword [r11 - 0x48], rbx
mov qword [r11 - 0x40], rax
test edx, edx
je 0x1400021ab
mov rsi, qword [0x140008930]
mov r8d, dword [0x140008324]
lea rax, [r11 - 0x30]
cmp rax, rsi
jne 0x14000215f
cmp r8d, 0x10
mov ecx, ebx
setae cl
jmp 0x1400021e6
mov rcx, qword [0x140008918]
mov rax, rsi
test rcx, rcx
cmove rcx, qword [0x140008928]
sub rax, rcx
mov qword [0x140008918], rcx
cmp rax, 0x10
jge 0x140002188
mov ecx, ebx
jmp 0x1400021e6
mov rax, qword [rcx]
mov rdi, qword [rcx + 8]
add rcx, 0x10
mov qword [0x140008918], rcx
mov ecx, 1
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x50], rdi
jmp 0x1400021e6
mov rdx, qword [0x140008328]
lea r8, [rsp + 0x48]
mov r9d, setsockopt
mov rcx, r12
call fcn.140004580
mov rdi, qword [rsp + 0x50]
mov r8d, dword [0x140008324]
mov rsi, qword [0x140008930]
mov edx, dword [0x140008910]
cmp eax, 0x10
mov ecx, ebx
sete cl
test ecx, ecx
je 0x14000220c
mov eax, r8d
cmp rdi, rax
jbe 0x14000221f
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Too_big_block_write_requested:__u_bytes._n
mov r8d, edi
add rcx, 0x60
call section..text
xor eax, eax
mov rbx, qword [rsp + 0x98]
add rsp, 0x60
pop r12
pop rdi
pop rsi
ret
test edx, edx
je 0x140002232
mov edx, edi
mov rcx, rsi
call fcn.140001290
mov r11d, eax
jmp 0x140002257
mov rdx, qword [0x140008328]
mov r9d, edi
mov r8, rsi
mov rcx, r12
call fcn.140004580
mov rsi, qword [0x140008930]
mov r11d, ebx
cmp eax, edi
sete r11b
test r11d, r11d
jne 0x140002286
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Warning:_I_O_stream_inconsistency._n
add rcx, 0x60
call section..text
xor eax, eax
mov rbx, qword [rsp + 0x98]
add rsp, 0x60
pop r12
pop rdi
pop rsi
ret
test byte [0x140008958], 1
je 0x1400022b9
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Device_write_attempt_on_read_only_device._n
mov qword [rsp + 0x30], 9
add rcx, 0x60
mov qword [rsp + 0x38], rbx
call section..text
jmp 0x1400023c4
mov rcx, qword [rsp + 0x48]
mov r9, qword [0x140008940]
add r9, rcx
cmp byte [0x140008915], bl
je 0x1400022e3
mov edx, dword [rsp + 0x50]
mov r8, r9
mov rcx, rsi
call fcn.1400017f0
mov edi, eax
jmp 0x140002319
cmp byte [0x140008914], bl
je 0x140002304
mov r8d, dword [rsp + 0x50]
mov rcx, qword [0x140008908]
mov rdx, rsi
call qword [0x140008f88]
mov edi, eax
jmp 0x140002319
mov r8d, dword [rsp + 0x50]
mov ecx, dword [0x140008320]
mov rdx, rsi
call fcn.140001100
mov edi, eax
cmp edi, 0xffffffff
jne 0x14000234e
call qword [sym.imp.msvcrt.dll__errno]
movsxd rcx, dword [rax]
mov qword [rsp + 0x38], 0xffffffffffffffff
mov qword [rsp + 0x30], rcx
lea rcx, str.Device_write
call qword [sym.imp.msvcrt.dll_perror]
mov r11, qword [rsp + 0x38]
mov r8, qword [rsp + 0x30]
jmp 0x14000235e
movsxd r11, edi
mov r8, rbx
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x38], r11
mov rdx, qword [rsp + 0x50]
cmp rdx, r11
je 0x1400023c4
test edi, edi
jns 0x140002399
mov rcx, qword [rsp + 0x48]
mov r9, qword [0x140008940]
mov qword [rsp + 0x20], rdx
add r9, rcx
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Write_error__code__I64u__at__I64u:_Req__I64u._n
add rcx, 0x60
call section..text
jmp 0x1400023c4
mov rcx, qword [rsp + 0x48]
mov r9, qword [0x140008940]
mov qword [rsp + 0x20], rdx
add r9, rcx
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Partial_write_at__I64u:_Got__I64u__req__I64u._n
add rcx, 0x60
call section..text
cmp dword [0x140008910], ebx
je 0x14000243b
mov rax, qword [0x140008930]
lea rcx, [rsp + 0x30]
cmp rcx, rax
jne 0x1400023ec
cmp dword [0x140008324], 0x10
setae bl
jmp 0x1400024e6
mov rcx, qword [0x140008920]
test rcx, rcx
cmove rcx, qword [0x140008928]
sub rax, rcx
mov qword [0x140008920], rcx
cmp rax, 0x10
jl 0x1400024e6
lea rdx, [rsp + 0x30]
add rcx, 0x10
mov ebx, 1
mov rax, qword [rdx]
mov qword [0x140008920], rcx
mov qword [rcx - 0x10], rax
mov rax, qword [rdx + 8]
mov qword [rcx - 8], rax
jmp 0x1400024e6
mov qword [rsp + 0x90], rbp
mov rbp, qword [0x140008328]
mov edi, ebx
lea rsi, [rsp + 0x30]
mov rcx, qword [0x140008fb8]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
test eax, eax
je 0x140002494
mov r8d, setsockopt
lea r9, [rsp + 0x88]
mov rdx, rsi
mov rcx, rbp
sub r8d, edi
mov dword [0x140008fb0], ebx
mov dword [0x140008fb4], ebx
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1400024a1
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x1400024d8
lea r8, [rsp + 0x80]
mov r9d, 1
mov rdx, r12
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x1400024d8
mov eax, dword [rsp + 0x80]
test eax, eax
je 0x1400024d8
add edi, eax
add rsi, rax
cmp edi, 0x10
jb 0x140002451
mov rbp, qword [rsp + 0x90]
cmp edi, 0x10
sete bl
test ebx, ebx
jne 0x140002514
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Error_sending_write_response_to_caller._n
add rcx, 0x60
call section..text
xor eax, eax
mov rbx, qword [rsp + 0x98]
add rsp, 0x60
pop r12
pop rdi
pop rsi
ret
call fcn.1400013b0
test eax, eax
jne 0x140002547
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Error_flushing_comm_data:__m_n
add rcx, 0x60
call section..text
xor eax, eax
mov rbx, qword [rsp + 0x98]
add rsp, 0x60
pop r12
pop rdi
pop rsi
ret
mov eax, 1
mov rbx, qword [rsp + 0x98]
add rsp, 0x60
pop r12
pop rdi
pop rsi
ret