Function at 0x440080
Capabilities:
Read file on windows
Read pipe
Write file on windows

Disassembly:
sub esp, 8
mov eax, dword [ebx + 0x1c]
push ebp
push esi
push edi
xor edi, edi
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], edi
cmp eax, edi
je 0x44009c
cmp eax, 0xffffffff
jne 0x4400a3
mov eax, ebx
call fcn.0043ffb0
mov ecx, dword [ebx + 0x1c]
push edi
push edi
lea eax, [esp + 0x14]
push eax
push edi
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4400f5
call ebp
cmp eax, 0xe9
je 0x4400d0
call ebp
cmp eax, 0x6d
jne 0x4400f5
mov edx, dword [ebx + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
mov dword [ebx + 0x1c], edi
call fcn.0043ffb0
test eax, eax
jne 0x4400f5
call ebp
push eax
push str.DesClientMsgPipe_Client:_Reopen_named_pipe_error__error_code:_ld.
jmp 0x440282
mov edx, dword [ebx + 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
lea eax, [esp + 0x14]
push eax
push 4
lea ecx, [esp + 0x24]
push ecx
push edx
call esi
test eax, eax
jne 0x44011f
call ebp
push eax
push str.DesClientMsgPipe_Client:_Write_command_id_error__error_code:_ld.
jmp 0x440282
mov edx, dword [ebx + 0x1c]
push edi
lea eax, [esp + 0x14]
push eax
push 4
lea ecx, [esp + 0x2c]
push ecx
push edx
call esi
test eax, eax
jne 0x440143
call ebp
push eax
push str.DesClientMsgPipe_Client:_Write_task_buffer_length_error__error_code:_ld.
jmp 0x440282
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
push edi
lea eax, [esp + 0x14]
push eax
mov eax, dword [ebx + 0x1c]
push ecx
push edx
push eax
call esi
test eax, eax
jne 0x44016a
call ebp
push eax
push str.DesClientMsgPipe_Client:_Write_task_buffer_error__error_code:_ld.
jmp 0x440282
mov ecx, dword [ebx + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov edi, dword [ebx + 0x1c]
mov esi, 4
call fcn.004402c0
test eax, eax
jne 0x440192
call ebp
push eax
push str.DesClientMsgPipe_Client:_PeekNamedPipe_error__error_code:_ld.
jmp 0x440282
mov ecx, dword [ebx + 0x1c]
push 0
lea edx, [esp + 0x10]
push edx
push 4
lea eax, [esp + 0x24]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4401c4
call ebp
cmp eax, 0xea
je 0x4401c4
call ebp
push eax
push str.DesClientMsgPipe_Client:_Read_command_id_error__error_code:_ld.
jmp 0x440282
mov edi, dword [ebx + 0x1c]
call fcn.004402c0
test eax, eax
jne 0x4401dd
call ebp
push eax
push str.DesClientMsgPipe_Client:_PeekNamedPipe_error__error_code:_ld.
jmp 0x440282
mov esi, dword [esp + 0x28]
mov eax, dword [ebx + 0x1c]
push 0
lea edx, [esp + 0x10]
push edx
push 4
push esi
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x44020c
call ebp
cmp eax, 0xea
je 0x44020c
call ebp
push eax
push str.DesClientMsgPipe_Client:_Read_task_buffer_length_error__error_code:_ld.
jmp 0x440282
mov esi, dword [esi]
mov edi, dword [ebx + 0x1c]
call fcn.004402c0
test eax, eax
jne 0x440224
call ebp
push eax
push str.DesClientMsgPipe_Client:_PeekNamedPipe_error__error_code:_ld.
jmp 0x440282
mov esi, dword [esp + 0x24]
mov eax, dword [esi]
test eax, eax
je 0x44023d
push eax
call fcn.00443d41
add esp, 4
mov dword [esi], 0
mov edi, dword [esp + 0x28]
mov ecx, dword [edi]
push ecx
call fcn.00443d36
add esp, 4
mov dword [esi], eax
test eax, eax
jne 0x440261
push str.DesClientMsgPipe_Client:_Not_enough_memory.
call fcn.0043fd90
add esp, 4
jmp 0x44028a
mov ecx, dword [edi]
push 0
lea edx, [esp + 0x10]
push edx
mov edx, dword [ebx + 0x1c]
push ecx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4402b6
call ebp
push eax
push str.DesClientMsgPipe_Client:_Read_task_buffer_error__error_code:_ld.
call fcn.0043fd90
add esp, 8
xor esi, esi
call ebp
cmp eax, 0xe9
je 0x44029c
call ebp
cmp eax, 0x6d
jne 0x4402b4
mov eax, dword [ebx + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
mov dword [ebx + 0x1c], 0
call fcn.0043ffb0
mov eax, esi
pop edi
pop esi
pop ebp
add esp, 8
ret 0x14