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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x34
mov ebx, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
movzx edi, word [ebx]
test edx, edx
jne 0x403100
mov eax, dword [ebp + 0x1c]
lea edx, [eax + 0x10]
mov eax, ebx
test di, di
je 0x403359
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x403000
sub eax, ebx
sar eax, 1
lea ecx, [edx + eax*2 + 2]
mov dword [esp], ecx
mov dword [ebp - 0x28], ecx
call dword [sym.imp.ucrtbase.dll_malloc]
mov ecx, dword [ebp - 0x28]
mov esi, eax
mov dword [eax], 0x57494e45
mov eax, dword [ebp + 0x14]
mov dword [esi + 4], ecx
mov dword [esi + 0xc], eax
mov eax, ebx
add eax, 2
cmp word [eax], 0
jne 0x403033
sub eax, ebx
sar eax, 1
add eax, 1
mov dword [esi + 8], eax
lea eax, [esi + 0x10]
jmp 0x403053
movzx edi, word [ebx]
add eax, 2
add ebx, 2
mov word [eax - 2], di
test di, di
jne 0x403050
mov eax, dword [ebp + 0x1c]
test eax, eax
jne 0x4031d0
mov eax, dword [ebp + 8]
mov ebx, dword [esi + 4]
lea edi, [ebp - 0x24]
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov eax, dword [eax + 0x24]
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x20]
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 0x4031b3
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x3e5
je 0x403160
test byte [section..data], 2
jne 0x403330
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
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 di, di
je 0x4032f4
mov eax, ebx
add eax, 2
cmp word [eax], 0
jne 0x403112
sub eax, ebx
sar eax, 1
lea eax, [eax + eax + 2]
mov dword [ebp + 0x1c], eax
lea edi, [eax + 0x12]
mov ecx, 0x419be6
mov dword [ebp - 0x28], ecx
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_malloc]
mov ecx, dword [ebp - 0x28]
mov dword [ebp + 0x18], ebx
mov esi, eax
mov dword [eax], 0x57494e45
mov eax, dword [ebp + 0x14]
mov dword [esi + 4], edi
mov ebx, ecx
xor edi, edi
mov dword [esi + 0xc], eax
mov eax, 1
jmp 0x403043
mov eax, dword [0x41706c]
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 0x40339a
lea eax, [ebp - 0x20]
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 0x4030ca
cmp ebx, dword [ebp - 0x24]
je 0x4031f2
test byte [section..data], 2
jne 0x403305
mov eax, 0x1d
jmp 0x4030e0
mov ecx, dword [ebp + 0x1c]
mov eax, dword [esi + 8]
mov dword [esp + 8], ecx
mov ecx, dword [ebp + 0x18]
lea eax, [esi + eax*2 + 0x10]
mov dword [esp], eax
mov dword [esp + 4], ecx
call sym._memcpy
jmp 0x40306d
lea eax, [ebp - 0x20]
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 0x4032d0
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0x3e5
je 0x40327a
test byte [section..data], 2
je 0x4030d7
mov eax, dword [ebp - 0x24]
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], 0x417000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.16
jmp 0x4030d7
mov eax, dword [0x41706c]
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 0x4033d9
lea eax, [ebp - 0x20]
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 0x403235
lea esi, [esi]
mov ecx, dword [ebp - 0x24]
mov ebx, 1
cmp ecx, 4
je 0x4030e7
test byte [section..data], 2
jne 0x403369
mov eax, 0x1e
jmp 0x4030e0
mov edi, 0x14
mov dword [ebp + 0x1c], 2
jmp 0x403129
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], 0x417000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.16
jmp 0x4031c5
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], 0x417000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.16
jmp 0x4030d7
mov eax, dword [ebp + 0x1c]
mov ecx, ebx
mov ebx, dword [ebp + 0x18]
lea edi, [eax + 0x12]
jmp 0x40312e
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], 0x417000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.16
jmp 0x4032ea
test byte [section..data], 2
jne 0x4033b3
mov eax, dword [ebp + 0x20]
xor ebx, ebx
mov dword [eax], 0x41d
jmp 0x4030e7
mov dword [esp + 0xc], str.sending_command_timed_out_n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x417000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.16
jmp 0x4033a3
test byte [section..data], 2
je 0x4033a3
mov dword [esp + 0xc], str.receiving_command_result_timed_out_n
mov dword [esp + 8], str.process_send_command
mov dword [esp + 4], 0x417000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.16
jmp 0x4033a3