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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
mov eax, dword [edi + 0x1c]
push ebx
push esi
xor esi, esi
mov dword [ebp - 4], esi
mov dword [ebp - 8], esi
cmp eax, esi
je 0x401e2c
cmp eax, 0xffffffff
jne 0x401e33
mov eax, edi
call fcn.00401d30
mov ecx, dword [edi + 0x1c]
push esi
push esi
lea eax, [ebp - 4]
push eax
push esi
push esi
mov esi, dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
push ecx
call esi
test eax, eax
jne 0x401e8a
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0xe9
je 0x401e61
call ebx
cmp eax, 0x6d
jne 0x401e8a
mov edx, dword [edi + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov dword [edi + 0x1c], 0
call fcn.00401d30
test eax, eax
jne 0x401e8a
call ebx
push eax
push str.DesClientMsgPipe_Client:_Reopen_named_pipe_error__error_code:_ld.
jmp 0x402111
mov edx, dword [edi + 0x1c]
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 8]
push eax
push 4
lea ecx, [ebp + 8]
push ecx
push edx
call ebx
test eax, eax
jne 0x401eb7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_Write_command_id_error__error_code:_ld.
jmp 0x402111
mov edx, dword [edi + 0x1c]
push 0
lea eax, [ebp - 8]
push eax
push 4
lea ecx, [ebp + 0x10]
push ecx
push edx
call ebx
test eax, eax
jne 0x401ede
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_Write_task_buffer_length_error__error_code:_ld.
jmp 0x402111
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [edi + 0x1c]
push ecx
push edx
push eax
call ebx
test eax, eax
jne 0x401f07
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_Write_task_buffer_error__error_code:_ld.
jmp 0x402111
mov ecx, dword [edi + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov ebx, dword [edi + 0x1c]
push 0
push 0
lea edx, [ebp + 0xc]
push edx
push 4
push 0
push ebx
mov dword [ebp + 0xc], 0
call esi
test eax, eax
je 0x401f66
mov edi, edi
cmp dword [ebp + 0xc], 4
jae 0x401f62
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0
lea eax, [ebp + 0xc]
push eax
push 4
push 0
push ebx
call esi
test eax, eax
jne 0x401f30
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_PeekNamedPipe_error__error_code:_ld.
jmp 0x402111
test eax, eax
jne 0x401f77
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_PeekNamedPipe_error__error_code:_ld.
jmp 0x402111
mov eax, dword [edi + 0x1c]
push 0
lea ecx, [ebp - 4]
push ecx
push 4
lea edx, [ebp + 8]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401fad
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0xea
je 0x401fad
call ebx
push eax
push str.DesClientMsgPipe_Client:_Read_command_id_error__error_code:_ld.
jmp 0x402111
mov ebx, dword [edi + 0x1c]
push 0
push 0
lea ecx, [ebp + 0xc]
push ecx
push 4
push 0
push ebx
mov dword [ebp + 0xc], 0
call esi
test eax, eax
je 0x402006
lea ebx, [ebx]
cmp dword [ebp + 0xc], 4
jae 0x402002
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0
lea edx, [ebp + 0xc]
push edx
push 4
push 0
push ebx
call esi
test eax, eax
jne 0x401fd0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_PeekNamedPipe_error__error_code:_ld.
jmp 0x402111
test eax, eax
jne 0x402017
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_PeekNamedPipe_error__error_code:_ld.
jmp 0x402111
mov ebx, dword [ebp + 0x18]
mov ecx, dword [edi + 0x1c]
push 0
lea eax, [ebp - 4]
push eax
push 4
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40204f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
je 0x40204f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_Read_task_buffer_length_error__error_code:_ld.
jmp 0x402111
mov ebx, dword [ebx]
mov eax, dword [edi + 0x1c]
push 0
push 0
lea edx, [ebp + 0xc]
push edx
push ebx
push 0
push eax
mov dword [ebp - 0xc], eax
mov dword [ebp + 0xc], 0
call esi
test eax, eax
je 0x4020a4
cmp dword [ebp + 0xc], ebx
jae 0x4020a0
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebp - 0xc]
push 0
push 0
lea eax, [ebp + 0xc]
push eax
push ebx
push 0
push ecx
call esi
test eax, eax
jne 0x402070
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_PeekNamedPipe_error__error_code:_ld.
jmp 0x402111
test eax, eax
jne 0x4020b2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_PeekNamedPipe_error__error_code:_ld.
jmp 0x402111
mov ebx, dword [ebp + 0x14]
mov eax, dword [ebx]
test eax, eax
je 0x4020ca
push eax
call fcn.0044c90f
add esp, 4
mov dword [ebx], 0
mov esi, dword [ebp + 0x18]
mov edx, dword [esi]
push edx
call fcn.0044c904
add esp, 4
mov dword [ebx], eax
test eax, eax
jne 0x4020ed
push str.DesClientMsgPipe_Client:_Not_enough_memory.
call fcn.00401ab0
add esp, 4
jmp 0x402119
mov edx, dword [esi]
push 0
lea ecx, [ebp - 4]
push ecx
push edx
push eax
mov eax, dword [edi + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40214b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DesClientMsgPipe_Client:_Read_task_buffer_error__error_code:_ld.
call fcn.00401ab0
add esp, 8
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
xor esi, esi
call ebx
cmp eax, 0xe9
je 0x402131
call ebx
cmp eax, 0x6d
jne 0x402149
mov ecx, dword [edi + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov dword [edi + 0x1c], 0
call fcn.00401d30
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14