Function at 0x140003f10
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
sub rsp, 0x30
cmp dword [rcx + 0x74], 0
mov rsi, r8
mov rbp, rdx
mov rdi, rcx
je 0x140003f50
mov eax, dword [rcx + 0x8c]
shr eax, 2
not eax
test al, 1
je 0x140003f7a
nop dword [rax]
call fcn.140004a00
cmp eax, 0xffffffff
je 0x140003f85
cmp dword [rdi + 0x74], 0
jne 0x140003f40
mov qword [rsp + 0x40], rbx
mov ebx, dword [rdi + 0x78]
test ebx, ebx
je 0x140004016
cmp ebx, 0xe
jg 0x140003fa6
je 0x140003f9f
cmp ebx, 1
je 0x140003f98
jle 0x140003fcb
cmp ebx, 3
jle 0x140003fbf
cmp ebx, 5
je 0x140003fb8
jmp 0x140003fcb
call fcn.14001daf4
mov dword [rax], 0xb
or eax, 0xffffffff
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
add rsp, 0x30
pop rdi
ret
mov ebx, 0x82
jmp 0x140003fcb
mov ebx, 0xc
jmp 0x140003fcb
cmp ebx, 0x50
je 0x140003fc6
cmp ebx, 0x7b
je 0x140003fbf
cmp ebx, 0x522
jne 0x140003fcb
mov ebx, 0xd
jmp 0x140003fcb
mov ebx, 2
jmp 0x140003fcb
mov ebx, 0x11
call fcn.14001daf4
mov dword [rax], ebx
call fcn.14001daf4
mov r8, rdi
lea rcx, str.write___ERROR:_d_on_prior_unblocking_write__io:_p
mov edx, dword [rax]
call fcn.140007d70
mov rcx, qword [rdi + 0x90]
xor esi, esi
mov dword [rdi + 0x78], esi
call qword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 3
jne 0x140004052
call fcn.14001daf4
cmp dword [rax], 0x6d
jne 0x140004052
call fcn.14001daf4
mov dword [rax], 0x20
jmp 0x140004052
cmp qword [rdi + 0x60], 0
jne 0x140004071
mov ecx, 0x19000
call fcn.14001da34
mov qword [rdi + 0x60], rax
test rax, rax
jne 0x14000406a
call fcn.14001daf4
mov ebx, 0xc
mov dword [rax], ebx
call fcn.14001daf4
mov r8, rdi
lea rcx, str.write___ERROR:_d__io:_p
mov edx, dword [rax]
call fcn.140007d70
or eax, 0xffffffff
mov rbx, qword [rsp + 0x40]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
add rsp, 0x30
pop rdi
ret
mov dword [rdi + 0x68], 0x19000
mov ebx, dword [rdi + 0x68]
mov r8, rbp
mov rcx, qword [rdi + 0x60]
cmp esi, ebx
mov rdx, rsi
cmovb ebx, esi
movsxd r9, ebx
call fcn.1400024d0
test eax, eax
je 0x14000409f
mov edx, eax
lea rcx, str.memcpy_s_failed_with_error:__d.
call fcn.140007d70
jmp 0x140004052
cmp dword [rdi + 0x84], 3
je 0x14000414c
mov rcx, qword [rdi + 0x90]
call qword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 2
je 0x14000414c
mov rdx, qword [rdi + 0x60]
lea rax, [0x140003eb0]
mov rcx, qword [rdi + 0x90]
lea r9, [rdi + 0x20]
mov r8d, ebx
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WriteFileEx]
test eax, eax
jne 0x14000415e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140003e60
mov ebx, eax
call fcn.14001daf4
mov dword [rax], ebx
mov rcx, qword [rdi + 0x90]
call qword [sym.imp.KERNEL32.dll_GetFileType]
stosd dword [rdi], eax
mov dl, 2
add byte [rbx + 0x247503f8], al
call fcn.14001daf4
cmp dword [rax], 0x6d
jne 0x140004136
mov rdx, rdi
lea rcx, str.write___ERROR:read_end_of_the_pipe_closed__io:_p
call fcn.140007d70
call fcn.14001daf4
mov dword [rax], 0x20
call fcn.14001daf4
mov r8, rdi
lea rcx, str.write_ERROR_from_cb_2_:_d__io:_p
mov edx, dword [rax]
jmp 0x14000404d
mov edx, ebx
mov rcx, rdi
call fcn.140005060
test eax, eax
jne 0x140004052
mov eax, dword [rdi + 0x8c]
xor esi, esi
shr eax, 2
not eax
mov dword [rdi + 0x6c], ebx
mov dword [rdi + 0x74], 1
test al, 1
je 0x1400041ad
nop dword [rax]
call fcn.140004a00
cmp eax, 0xffffffff
jne 0x1400041a8
call fcn.14001daf4
cmp dword [rax], 4
jne 0x140004052
cmp dword [rdi + 0x74], esi
jne 0x140004052
call fcn.14001daf4
mov dword [rax], esi
cmp dword [rdi + 0x74], esi
jne 0x140004180
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SleepEx]
cmp dword [rdi + 0x74], esi
jne 0x1400041f1
mov ebp, dword [rdi + 0x78]
test ebp, ebp
je 0x1400041f1
call fcn.14001daf4
mov ecx, ebp
mov rdx, rax
call fcn.140003e60
mov dword [rdx], eax
lea rcx, str.write___ERROR_from_cb:_d__io:_p
mov edx, dword [rdi + 0x78]
mov r8, rdi
call fcn.140007d70
mov dword [rdi + 0x78], esi
jmp 0x140004052
mov eax, ebx
jmp 0x140004055