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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x8024
call fcn.0040a4a0
push esi
mov dword [ebp - 4], 0
mov eax, dword [ebp + 0x10]
add eax, 0x14
cmp eax, 0x4000
ja 0x401305
push 0x4000
push 0
lea ecx, [ebp - 0x8010]
push ecx
call fcn.00401f70
add esp, 0xc
lea edx, [ebp - 0x8010]
mov dword [ebp - 0x400c], edx
mov eax, 0xdada
mov ecx, dword [ebp - 0x400c]
mov word [ecx], ax
mov edx, 0x14
mov eax, dword [ebp - 0x400c]
mov word [eax + 2], dx
push 0x414bb8
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov ecx, dword [ebp - 0x400c]
mov word [ecx + 4], ax
mov edx, dword [ebp - 0x400c]
mov dword [edx + 0xc], 1
mov eax, dword [ebp - 0x400c]
mov dword [eax + 8], 0
mov ecx, dword [ebp - 0x400c]
mov dx, word [ebp + 0x10]
mov word [ecx + 6], dx
mov eax, dword [ebp - 0x400c]
mov dword [eax + 0x10], 0
mov ecx, dword [ebp - 0x400c]
add ecx, 0x14
mov dword [ebp - 8], ecx
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.00401c00
add esp, 0xc
push 0x4000
push 0
lea edx, [ebp - 0x4008]
push edx
call fcn.00401f70
add esp, 0xc
mov dword [ebp - 0x4010], 0
push 0x3a98
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeW]
test eax, eax
je 0x401245
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x8014], eax
cmp dword [ebp - 0x8014], 0xffffffff
je 0x401231
mov dword [ebp - 0x8018], 0x4000
mov dword [ebp - 0x801c], 0
push 0
lea edx, [ebp - 0x801c]
push edx
mov eax, dword [ebp - 0x8018]
push eax
lea ecx, [ebp - 0x8010]
push ecx
mov edx, dword [ebp - 0x8014]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x8018]
cmp eax, dword [ebp - 0x801c]
je 0x40117f
mov dword [ebp - 4], 0x80004005
cmp dword [ebp - 4], 0
jl 0x401222
mov dword [ebp - 0x8018], 0x4000
mov dword [ebp - 0x801c], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x8020], eax
cmp dword [ebp - 0x801c], 0
jne 0x4011e8
mov esi, dword [ebp - 0x8020]
add esi, dword [ebp + 0x20]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
cmp esi, eax
jbe 0x4011e8
push 0
lea ecx, [ebp - 0x801c]
push ecx
push 0
mov edx, dword [ebp - 0x8018]
push edx
push 0
mov eax, dword [ebp - 0x8014]
push eax
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
jmp 0x4011a9
push 0
lea ecx, [ebp - 0x4010]
push ecx
mov edx, dword [ebp - 0x8018]
push edx
lea eax, [ebp - 0x4008]
push eax
mov ecx, dword [ebp - 0x8014]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401222
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00401b40
add esp, 4
mov dword [ebp - 4], eax
mov edx, dword [ebp - 0x8014]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x401243
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00401b40
add esp, 4
mov dword [ebp - 4], eax
jmp 0x401257
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00401b40
add esp, 4
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jl 0x40126d
cmp dword [ebp - 0x4010], 0x14
jae 0x40126d
mov dword [ebp - 4], 0x80004005
cmp dword [ebp - 4], 0
jl 0x401303
lea eax, [ebp - 0x4008]
mov dword [ebp - 0x8024], eax
mov ecx, dword [ebp - 0x8024]
movzx edx, word [ecx + 6]
cmp edx, dword [ebp + 0x18]
jbe 0x40129f
push 0x6f
call fcn.00401b40
add esp, 4
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x4012b1
mov eax, dword [ebp - 0x8024]
mov ecx, dword [eax + 0x10]
mov dword [ebp - 4], ecx
cmp dword [ebp - 4], 0
jl 0x401303
mov edx, dword [ebp - 0x8024]
movzx eax, word [edx + 6]
test eax, eax
je 0x401303
mov ecx, dword [ebp - 0x8024]
movzx edx, word [ecx + 6]
push edx
mov eax, dword [ebp - 0x8024]
movzx ecx, word [eax + 2]
lea edx, [ebp + ecx - 0x4008]
push edx
mov eax, dword [ebp + 0x14]
push eax
call fcn.00401c00
add esp, 0xc
cmp dword [ebp + 0x1c], 0
je 0x401303
mov ecx, dword [ebp - 0x8024]
movzx edx, word [ecx + 6]
mov eax, dword [ebp + 0x1c]
mov dword [eax], edx
jmp 0x40130c
mov dword [ebp - 4], 0x80070057
mov eax, dword [ebp - 4]
pop esi
mov esp, ebp
pop ebp
ret