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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov ebx, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
movzx ecx, word [ebx]
test edx, edx
jne 0x404be8
mov eax, dword [ebp + 0x1c]
lea edi, [eax + 0x12]
mov eax, ebx
test cx, cx
je 0x404df1
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x404a80
sub eax, ebx
mov dword [ebp - 0x3c], ecx
add edi, eax
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_malloc]
mov ecx, dword [ebp - 0x3c]
mov esi, eax
mov dword [eax], 0x57494e45
mov eax, dword [ebp + 0x14]
mov dword [esi + 4], edi
mov dword [esi + 0xc], eax
mov eax, ebx
nop
add eax, 2
cmp word [eax], 0
jne 0x404ab0
sub eax, ebx
sar eax, 1
inc eax
mov dword [esi + 8], eax
lea eax, [esi + 0x10]
jmp 0x404ad3
movzx ecx, word [ebx]
add eax, 2
add ebx, 2
mov word [eax - 2], cx
test cx, cx
jne 0x404ad0
mov eax, dword [ebp + 0x1c]
test eax, eax
jne 0x404ce0
mov eax, dword [ebp + 8]
mov ebx, dword [esi + 4]
lea edi, [ebp - 0x30]
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov eax, dword [eax + 0x24]
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], esi
mov eax, dword [eax + 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
test eax, eax
jne 0x404bb0
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x3e5
je 0x404b60
test byte [0x419020], 2
jne 0x404dc8
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
jmp 0x404bcb
mov eax, dword [0x41924c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
sub esp, 8
cmp eax, 0x102
je 0x404e2c
lea eax, [ebp - 0x2c]
mov dword [esp + 0xc], 0
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp + 8], edi
mov eax, dword [eax + 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetOverlappedResult]
sub esp, 0x10
test eax, eax
je 0x404b42
nop
cmp ebx, dword [ebp - 0x30]
je 0x404c50
test byte [0x419020], 2
jne 0x404d98
mov eax, 0x1d
mov edx, dword [ebp + 0x20]
xor ebx, ebx
mov dword [edx], eax
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_free]
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
or dword [ebp + 0x14], 0x80000000
test cx, cx
je 0x404d80
mov edi, ebx
lea esi, [esi]
add edi, 2
cmp word [edi], 0
jne 0x404c00
sub edi, ebx
lea eax, [edi + 2]
add edi, 0x14
mov dword [ebp + 0x1c], eax
mov ecx, 0x41c3d0
mov dword [ebp - 0x3c], ecx
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_malloc]
mov ecx, dword [ebp - 0x3c]
mov dword [ebp + 0x18], ebx
mov dword [eax], 0x57494e45
mov esi, eax
mov eax, dword [ebp + 0x14]
mov ebx, ecx
mov dword [esi + 4], edi
xor ecx, ecx
mov dword [esi + 0xc], eax
mov eax, 1
jmp 0x404abe
lea eax, [ebp - 0x2c]
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x20]
mov dword [esp + 8], 4
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
jne 0x404d58
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x3e5
je 0x404d02
test byte [0x419020], 2
je 0x404b4f
mov eax, dword [ebp - 0x30]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], str.service_protocol_error___failed_to_read_pipe_r___d__count___ld__n
mov dword [esp + 0x14], eax
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x419020
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x404b4f
mov edx, dword [ebp + 0x1c]
mov eax, dword [esi + 8]
mov dword [esp + 8], edx
mov edx, dword [ebp + 0x18]
lea eax, [esi + eax*2 + 0x10]
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._memcpy
jmp 0x404aed
mov eax, dword [0x41924c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
sub esp, 8
cmp eax, 0x102
je 0x404e6b
lea eax, [ebp - 0x2c]
mov dword [esp + 0xc], 0
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp + 8], edi
mov eax, dword [eax + 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_GetOverlappedResult]
sub esp, 0x10
test eax, eax
je 0x404c93
lea esi, [esi]
mov ecx, dword [ebp - 0x30]
mov ebx, 1
cmp ecx, 4
je 0x404bd2
test byte [0x419020], 2
jne 0x404dfb
mov eax, 0x1e
jmp 0x404bcb
mov dword [ebp + 0x1c], 2
mov edi, 0x14
jmp 0x404c14
mov dword [esp + 0xc], str.service_protocol_error___failed_to_write_pipe__n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x419020
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x404bc6
mov dword [esp + 0xc], str.service_protocol_error___failed_to_write_pipe__n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x419020
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x404b4f
mov ecx, ebx
mov ebx, dword [ebp + 0x18]
jmp 0x404c19
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.service_protocol_error___failed_to_read_pipe_r___d__count___ld__n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x419020
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x404d76
test byte [0x419020], 2
jne 0x404e45
mov eax, dword [ebp + 0x20]
xor ebx, ebx
mov dword [eax], 0x41d
jmp 0x404bd2
mov dword [esp + 0xc], str.sending_command_timed_out_n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x419020
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x404e35
test byte [0x419020], 2
je 0x404e35
mov dword [esp + 0xc], str.receiving_command_result_timed_out_n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x419020
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x404e35