Function at 0x140004e20
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x68
lea rbp, [rsp + 0x60]
mov esi, dword [rbp + 0x78]
movzx r14d, word [r8]
mov rbx, rcx
mov r13, r8
mov r15d, r9d
test edx, edx
jne 0x140004fb8
lea edx, [rsi + 0x10]
mov rax, r8
test r14w, r14w
je 0x14000516c
nop dword [rax]
add rax, 2
cmp word [rax], 0
jne 0x140004e60
sub rax, r13
sar rax, 1
lea edi, [rdx + rax*2 + 2]
movsxd rcx, edi
call qword [sym.imp.ucrtbase.dll_malloc]
mov dword [rax], 0x57494e45
mov r12, rax
mov dword [rax + 0xc], r15d
mov dword [rax + 4], edi
mov rax, r13
add rax, 2
cmp word [rax], 0
jne 0x140004e90
sub rax, r13
sar rax, 1
inc eax
mov dword [r12 + 8], eax
xor eax, eax
jmp 0x140004eb6
movzx r14d, word [r13 + rax]
mov word [r12 + rax + 0x10], r14w
add rax, 2
test r14w, r14w
jne 0x140004eb0
test esi, esi
jne 0x140005088
mov esi, dword [r12 + 4]
mov rax, qword [rbx + 0x40]
lea r14, [rbp - 0x24]
mov rdx, r12
lea r13, [rbp - 0x20]
mov rcx, qword [rbx + 0x38]
mov qword [rbp - 0x10], 0
mov r9, r14
mov qword [rbp - 8], rax
mov r8d, esi
mov qword [rsp + 0x20], r13
call qword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x140004f70
mov rax, qword gs:[0x30]
cmp dword [rax + 0x68], 0x3e5
je 0x140004f38
test byte [0x14001a020], 2
jne 0x140005148
mov rax, qword gs:[0x30]
mov eax, dword [rax + 0x68]
jmp 0x140004f8b
mov rcx, qword [rbx + 0x40]
mov edx, dword [0x14001a3f0]
call qword [sym.imp.kernel32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x1400051ab
xor r9d, r9d
mov rcx, qword [rbx + 0x38]
mov r8, r14
mov rdx, r13
call qword [sym.imp.kernel32.dll_GetOverlappedResult]
test eax, eax
je 0x140004f19
nop word [rax + rax]
cmp esi, dword [rbp - 0x24]
je 0x140005020
test byte [0x14001a020], 2
jne 0x140005120
mov eax, 0x1d
mov rdi, qword [rbp + 0x80]
xor r13d, r13d
mov dword [rdi], eax
mov rcx, r12
call qword [sym.imp.ucrtbase.dll_free]
mov eax, r13d
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
or r15d, 0x80000000
test r14w, r14w
je 0x140005101
mov rax, r8
nop dword [rax]
add rax, 2
cmp word [rax], 0
jne 0x140004fd0
sub rax, r13
sar rax, 1
lea esi, [rax + rax + 2]
lea r14d, [rsi + 0x12]
movsxd rcx, r14d
lea rdi, [0x14001d580]
call qword [sym.imp.ucrtbase.dll_malloc]
mov qword [rbp + 0x70], r13
mov r13, rdi
mov dword [rax + 4], r14d
mov r12, rax
xor r14d, r14d
mov dword [rax], 0x57494e45
mov dword [rax + 0xc], r15d
mov eax, 1
jmp 0x140004ea2
mov rcx, qword [rbx + 0x38]
mov rdx, qword [rbp + 0x80]
mov qword [rsp + 0x20], r13
mov r9, r14
mov r8d, 4
call qword [sym.imp.kernel32.dll_ReadFile]
test eax, eax
jne 0x1400050d8
mov rax, qword gs:[0x30]
cmp dword [rax + 0x68], 0x3e5
je 0x1400050a3
test byte [0x14001a020], 2
jne 0x1400051c9
mov rax, qword gs:[0x30]
mov eax, dword [rax + 0x68]
mov rbx, qword [rbp + 0x80]
xor r13d, r13d
mov dword [rbx], eax
jmp 0x140004f97
mov eax, dword [r12 + 8]
mov rdx, qword [rbp + 0x70]
mov r8d, esi
lea rcx, [r12 + rax*2 + 0x10]
call sym.memcpy
jmp 0x140004ece
mov rcx, qword [rbx + 0x40]
mov edx, dword [0x14001a3f0]
call qword [sym.imp.kernel32.dll_WaitForSingleObject]
cmp eax, 0x102
je 0x14000521d
xor r9d, r9d
mov rcx, qword [rbx + 0x38]
mov r8, r14
mov rdx, r13
call qword [sym.imp.kernel32.dll_GetOverlappedResult]
test eax, eax
je 0x140005059
nop dword [rax]
mov edx, dword [rbp - 0x24]
mov r13d, 1
cmp edx, 4
je 0x140004f97
test byte [0x14001a020], 2
jne 0x14000517f
mov eax, 0x1e
jmp 0x140005072
mov ecx, 0x14
mov r14d, 0x14
mov esi, 2
jmp 0x140004feb
lea r9, str.service_protocol_error___failed_to_write_pipe__n
lea r8, str.process_send_command
mov ecx, 1
lea rdx, [0x14001a020]
call sym.wine_dbg_log.constprop.0
jmp 0x140004f86
lea r9, str.service_protocol_error___failed_to_write_pipe__n
lea r8, str.process_send_command
mov ecx, 1
lea rdx, [0x14001a020]
call sym.wine_dbg_log.constprop.0
jmp 0x140004f26
lea r14d, [rsi + 0x12]
mov r13, qword [rbp + 0x70]
mov rdi, r8
movsxd rcx, r14d
jmp 0x140004ff2
mov dword [rsp + 0x28], edx
lea r9, str.service_protocol_error___failed_to_read_pipe_r___d__count___ld__n
lea r8, str.process_send_command
mov ecx, 1
mov dword [rsp + 0x20], eax
lea rdx, [0x14001a020]
call sym.wine_dbg_log.constprop.0
jmp 0x1400050f7
test byte [0x14001a020], 2
jne 0x1400051fc
mov rax, qword [rbp + 0x80]
xor r13d, r13d
mov dword [rax], 0x41d
jmp 0x140004f97
mov eax, dword [rbp - 0x24]
mov dword [rsp + 0x20], 0
lea r9, str.service_protocol_error___failed_to_read_pipe_r___d__count___ld__n
lea r8, str.process_send_command
lea rdx, [0x14001a020]
mov ecx, 1
mov dword [rsp + 0x28], eax
call sym.wine_dbg_log.constprop.0
jmp 0x140005066
lea r9, str.sending_command_timed_out_n
lea r8, str.process_send_command
mov ecx, 1
lea rdx, [0x14001a020]
call sym.wine_dbg_log.constprop.0
jmp 0x1400051b4
test byte [0x14001a020], 2
je 0x1400051b4
lea r9, str.receiving_command_result_timed_out_n
lea r8, str.process_send_command
mov ecx, 1
lea rdx, [0x14001a020]
call sym.wine_dbg_log.constprop.0
jmp 0x1400051b4