Function at 0x40b7b0
Capabilities:
Connect pipe
Read file on windows
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
push ecx
cmp dword [ebp + 8], 0
push ebx
push esi
push edi
mov ebx, ecx
je 0x40ba64
push 0x3e8
push 0
lea eax, [ebx + 0x9c]
push eax
push 4
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 3
ja 0x40ba64
mov ecx, eax
mov dword [ebp - 4], 0
shl ecx, 5
add ecx, ebx
cmp byte [eax + ecx + 0x38], 0
lea edi, [eax + ecx]
je 0x40b8df
push 0
lea eax, [ebp - 4]
push eax
lea esi, [edi + 0x18]
push esi
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
mov eax, dword [edi + 0x34]
setne cl
sub eax, 0
je 0x40b8d0
sub eax, 1
je 0x40b88a
sub eax, 1
jne 0x40ba64
test cl, cl
je 0x40b840
mov eax, dword [ebp - 4]
cmp eax, dword [edi + 0x30]
je 0x40b8d8
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
test eax, eax
je 0x40b87f
push esi
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40b871
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
jne 0x40b8c5
push dword [esi + 0x10]
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor al, al
mov byte [edi + 0x38], al
movzx eax, al
xor eax, 1
mov dword [edi + 0x34], eax
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret 4
test cl, cl
je 0x40b89d
cmp dword [ebp - 4], 0
je 0x40b89d
mov dword [edi + 0x34], 2
jmp 0x40b8df
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
test eax, eax
je 0x40b87f
push esi
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40b871
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
je 0x40b868
cmp eax, 0x3e5
jne 0x40b871
mov al, 1
jmp 0x40b873
test cl, cl
je 0x40ba64
mov dword [edi + 0x34], 1
mov eax, dword [edi + 0x34]
sub eax, 1
je 0x40b997
sub eax, 1
jne 0x40ba64
lea esi, [ebx + 0xac]
push esi
call dword [ebp + 8]
mov eax, dword [ebx + 0xb0]
lea ecx, [ebp - 4]
lea ebx, [edi + 0x18]
mov dword [edi + 0x30], eax
push ebx
push ecx
push eax
push esi
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
setne byte [ebp + 0xb]
call dword [sym.imp.KERNEL32.dll_GetLastError]
test esi, esi
je 0x40b94a
mov ecx, dword [ebp - 4]
cmp ecx, dword [edi + 0x30]
jne 0x40b94a
mov byte [edi + 0x38], 0
mov al, 1
mov dword [edi + 0x34], 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp byte [ebp + 0xb], 0
jne 0x40b95b
cmp eax, 0x3e5
je 0x40b9ff
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
test eax, eax
je 0x40b87f
push ebx
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40b871
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
jne 0x40b8c5
push dword [ebx + 0x10]
jmp 0x40b86b
push 0x1008
lea esi, [ebx + 0xac]
push 0
push esi
call fcn.0042d530
add esp, 0xc
lea ebx, [edi + 0x18]
lea eax, [ebp - 4]
push ebx
push eax
push 0x1008
push esi
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
test esi, esi
setne byte [ebp + 0xb]
call dword [sym.imp.KERNEL32.dll_GetLastError]
test esi, esi
je 0x40b9f2
cmp dword [ebp - 4], 0
je 0x40b9f2
mov byte [edi + 0x38], 0
mov al, 1
mov dword [edi + 0x34], 2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp byte [ebp + 0xb], 0
jne 0x40ba0e
cmp eax, 0x3e5
jne 0x40ba0e
mov byte [edi + 0x38], 1
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
test eax, eax
je 0x40b87f
push ebx
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40b871
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
jne 0x40b8c5
push dword [ebx + 0x10]
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor al, al
mov byte [edi + 0x38], al
movzx eax, al
xor eax, 1
mov dword [edi + 0x34], eax
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 4