Function at 0x140001d20
Capabilities:
Write file on windows

Disassembly:
push rbx
push rdi
push r12
sub rsp, 0x60
xor ebx, ebx
xor edx, edx
xor eax, eax
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x48], rdx
mov qword [rsp + 0x50], rdx
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x38], rax
lea r12, [0x140008fa0]
cmp dword [0x140008910], eax
je 0x140001dc9
mov rdi, qword [0x140008930]
mov r8d, dword [0x140008324]
lea rax, [rsp + 0x48]
cmp rax, rdi
jne 0x140001d7d
cmp r8d, 0x10
mov ecx, ebx
setae cl
jmp 0x140001dfe
mov rcx, qword [0x140008918]
mov rax, rdi
test rcx, rcx
cmove rcx, qword [0x140008928]
sub rax, rcx
mov qword [0x140008918], rcx
cmp rax, 0x10
jge 0x140001da6
mov ecx, ebx
jmp 0x140001dfe
mov rax, qword [rcx]
mov rdx, qword [rcx + 8]
add rcx, 0x10
mov qword [0x140008918], rcx
mov ecx, 1
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x50], rdx
jmp 0x140001dfe
mov rdx, qword [0x140008328]
lea r8, [rsp + 0x48]
mov r9d, setsockopt
mov rcx, r12
call fcn.140004580
mov rdx, qword [rsp + 0x50]
mov r8d, dword [0x140008324]
mov rdi, qword [0x140008930]
cmp eax, 0x10
mov ecx, ebx
sete cl
test ecx, ecx
jne 0x140001e24
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Error_reading_request_header._n
add rcx, 0x60
call section..text
xor eax, eax
add rsp, 0x60
pop r12
pop rdi
pop rbx
ret
mov qword [rsp + 0x90], rbp
mov qword [rsp + 0x98], rsi
mov esi, r8d
cmp rdx, rsi
mov rcx, rdi
cmovb esi, edx
xor edx, edx
mov r8d, esi
mov ebp, esi
call sub.msvcrt.dll_memset
mov r11, qword [rsp + 0x48]
mov r8, qword [0x140008940]
add r8, r11
cmp byte [0x140008915], bl
je 0x140001e6f
mov edx, esi
mov rcx, rdi
call fcn.1400015e0
jmp 0x140001e99
cmp byte [0x140008914], bl
je 0x140001e8f
mov rcx, qword [0x140008908]
mov r9, r8
mov rdx, rdi
mov r8d, esi
call qword [0x140008f80]
jmp 0x140001e99
mov edx, esi
mov rcx, rdi
call fcn.140001200
cmp eax, 0xffffffff
jne 0x140001eca
call qword [sym.imp.msvcrt.dll__errno]
lea rdx, str.Device_read:__m_n
movsxd rcx, dword [rax]
mov qword [rsp + 0x38], rbx
mov qword [rsp + 0x30], rcx
mov rcx, qword [sym.imp.msvcrt.dll__iob]
add rcx, 0x60
call section..text
jmp 0x140001f0c
mov rdx, qword [rsp + 0x50]
movsxd r9, eax
mov qword [rsp + 0x30], rbx
mov qword [rsp + 0x38], rbp
cmp rdx, r9
je 0x140001f0c
mov rcx, qword [rsp + 0x48]
mov r8, qword [0x140008940]
mov qword [rsp + 0x20], rdx
add r8, rcx
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Partial_read_at__I64i:_Got__I64i__req__I64u._n
add rcx, 0x60
call section..text
mov edx, dword [0x140008910]
test edx, edx
je 0x140001f88
mov r8, qword [0x140008930]
lea rax, [rsp + 0x30]
cmp rax, r8
jne 0x140001f36
cmp dword [0x140008324], 0x10
setae bl
jmp 0x14000203a
mov rcx, qword [0x140008920]
mov rax, r8
test rcx, rcx
cmove rcx, qword [0x140008928]
sub rax, rcx
mov qword [0x140008920], rcx
cmp rax, 0x10
jl 0x14000203a
lea r9, [rsp + 0x30]
add rcx, 0x10
mov ebx, 1
mov rax, qword [r9]
mov qword [0x140008920], rcx
mov qword [rcx - 0x10], rax
mov rax, qword [r9 + 8]
mov qword [rcx - 8], rax
jmp 0x14000203a
mov rbp, qword [0x140008328]
mov edi, ebx
lea rsi, [rsp + 0x30]
nop word [rax + rax]
mov rcx, qword [0x140008fb8]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
test eax, eax
je 0x140001fe3
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 0x140001ff0
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x140002027
lea r8, [rsp + 0x80]
mov r9d, 1
mov rdx, r12
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x140002027
mov eax, dword [rsp + 0x80]
test eax, eax
je 0x140002027
add edi, eax
add rsi, rax
cmp edi, 0x10
jb 0x140001fa0
mov r8, qword [0x140008930]
mov edx, dword [0x140008910]
cmp edi, 0x10
sete bl
mov rsi, qword [rsp + 0x98]
mov rbp, qword [rsp + 0x90]
test ebx, ebx
jne 0x140002070
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
add rsp, 0x60
pop r12
pop rdi
pop rbx
ret
cmp qword [rsp + 0x30], 0
jne 0x1400020c4
test edx, edx
je 0x14000208a
mov edx, dword [rsp + 0x38]
mov rcx, r8
call fcn.140001320
jmp 0x14000209e
mov r9d, dword [rsp + 0x38]
mov rdx, qword [0x140008328]
mov rcx, r12
call fcn.140004690
test eax, eax
jne 0x1400020c4
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.Error_sending_read_response_to_caller._n
add rcx, 0x60
call section..text
xor eax, eax
add rsp, 0x60
pop r12
pop rdi
pop rbx
ret
call fcn.1400013b0
test eax, eax
jne 0x1400020ef
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
add rsp, 0x60
pop r12
pop rdi
pop rbx
ret
mov eax, 1
add rsp, 0x60
pop r12
pop rdi
pop rbx
ret