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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x469a36
mov eax, dword fs:[0]
push eax
sub esp, 0x2ac
mov eax, dword [0x4b0408]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
push 0x40
lea eax, [ebp - 0x50]
mov edi, 1
push 0
push eax
call fcn.00431580
push 0x104
lea eax, [ebp - 0x154]
push 0
push eax
call fcn.00431580
mov ebx, dword [sym.imp.KERNEL32.dll_CreateEventA]
add esp, 0x18
push 0
push edi
push edi
push 0
call ebx
mov dword [ebp - 0x168], eax
mov dword [esi + 0x20], eax
lea eax, [ebp - 0x174]
push eax
call fcn.0041c1b0
add esp, 4
test eax, eax
je 0x402159
push 0x104
lea eax, [ebp - 0x154]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x154]
push eax
call fcn.0041cd10
push dword [ebp - 0x174]
lea eax, [ebp - 0x154]
push eax
push str..pipepoenvuewt
lea eax, [ebp - 0x50]
push str._s__s__d
push eax
call fcn.00401c50
add esp, 0x18
lea eax, [ebp - 0x50]
push eax
call fcn.00402180
mov ecx, eax
mov dword [esi + 0x24], ecx
test ecx, ecx
jne 0x401dff
xor edi, edi
jmp 0x401e0c
lea eax, [esi + 0x10]
push eax
push ecx
call fcn.00402260
mov dword [esi + 0x34], eax
mov eax, dword [esi + 4]
mov dword [esi + 0xc], edi
test eax, eax
je 0x401e1d
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
cmp dword [esi + 0xc], 0
je 0x402159
push 0
push 0
push 1
push 0
call ebx
mov ecx, dword [ebp - 0x168]
push 0xffffffffffffffff
mov dword [esi + 8], eax
mov dword [ebp - 0x16c], eax
lea eax, [ebp - 0x170]
push 0
push eax
push 2
mov dword [ebp - 0x170], ecx
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
push 0
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x402159
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [esi + 0x34], 0
je 0x402018
push 0
lea eax, [ebp - 0x164]
mov dword [esi + 0x34], 0
push eax
lea ebx, [esi + 0x10]
push ebx
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x401ee1
call edi
cmp eax, 0xea
jne 0x401eee
lea eax, [ebp - 0x160]
mov dword [ebp - 0x160], 0
push eax
push 0
push 0
push 0
push 0
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x401edd
cmp dword [ebp - 0x160], 0
jbe 0x401edd
mov eax, dword [ebp - 0x164]
jmp 0x401eeb
call edi
jmp 0x401eee
mov eax, dword [ebp - 0x164]
test eax, eax
je 0x401eee
add dword [esi + 0x30], eax
lea eax, [ebp - 0x158]
mov dword [ebp - 0x158], 0
push eax
push 0
push 0
push 0
push 0
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
mov ecx, dword [ebp - 0x158]
test ecx, ecx
jne 0x401f2e
cmp dword [esi + 0x30], ecx
jne 0x402118
mov ecx, 0x800
mov dword [ebp - 0x158], ecx
mov edx, dword [esi + 0x30]
lea eax, [edx + ecx]
cmp eax, dword [esi + 0x28]
jbe 0x401f88
mov edi, dword [esi + 0x2c]
push eax
call fcn.0042c0b7
mov ecx, dword [esi + 0x30]
add ecx, dword [ebp - 0x158]
push ecx
push 0
push eax
mov dword [esi + 0x2c], eax
call fcn.00431580
add esp, 0x10
test edi, edi
je 0x401f73
push dword [esi + 0x30]
push edi
push dword [esi + 0x2c]
call fcn.00431e40
push edi
call fcn.0042c0c0
add esp, 0x10
mov edx, dword [esi + 0x30]
mov ecx, dword [ebp - 0x158]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [edx + ecx]
mov dword [esi + 0x28], eax
push ebx
lea eax, [ebp - 0x15c]
mov dword [ebp - 0x15c], 0
push eax
mov eax, dword [esi + 0x2c]
push ecx
add eax, edx
push eax
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40200a
call edi
cmp eax, 0xea
je 0x401fce
cmp eax, 0x3e5
jne 0x402118
mov dword [esi + 0x34], 1
jmp 0x402118
push 0
lea eax, [ebp - 0x15c]
mov dword [ebp - 0x15c], 0
push eax
push ebx
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
mov eax, dword [ebp - 0x15c]
test eax, eax
mov ecx, dword [ebp - 0x158]
cmovne ecx, eax
add dword [esi + 0x30], ecx
mov dword [ebp - 0x15c], ecx
jmp 0x402118
mov eax, dword [ebp - 0x15c]
add dword [esi + 0x30], eax
jmp 0x402118
cmp dword [esi + 0x30], 0
je 0x402118
mov edi, dword [esi + 0x2c]
lea ecx, [ebp - 0x1d4]
call fcn.00417a70
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x2b8]
call fcn.00413fb0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x2b8]
push 0
push edi
call fcn.00416b10
lea eax, [ebp - 0x2b8]
push eax
lea ecx, [ebp - 0x1d4]
call fcn.004194a0
mov eax, dword [esi + 0x38]
lea ecx, [ebp - 0x1d4]
mov eax, dword [eax + 0x60]
add eax, 0x9d38
push eax
call fcn.004198c0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x2b8]
call fcn.004141e0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x1d4]
call fcn.00417b90
push dword [esi + 0x2c]
call fcn.0042c0c0
add esp, 4
mov dword [esi + 0x2c], 0
lea eax, [ebp - 0x178]
mov dword [esi + 0x30], 0
mov dword [esi + 0x28], 0
mov dword [ebp - 0x17c], 0
push 0
push eax
push 4
lea eax, [ebp - 0x17c]
mov dword [ebp - 0x178], 0
push eax
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4020f7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
lea eax, [esi + 0x10]
push eax
push dword [esi + 0x24]
call fcn.00402260
mov dword [esi + 0x34], eax
mov eax, dword [ebp - 0x168]
mov dword [ebp - 0x170], eax
mov eax, dword [esi + 8]
push 0xffffffffffffffff
mov dword [ebp - 0x16c], eax
lea eax, [ebp - 0x170]
push 0
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
push 0
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x401e72
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0042bd08
mov esp, ebp
pop ebp
ret