Function at 0x40b6c0
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 0x40b974
push 0x3e8
push 0
lea eax, [ebx + 0x9c]
push eax
push 4
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 3
ja 0x40b974
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 0x40b7ef
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 0x40b7e0
sub eax, 1
je 0x40b79a
sub eax, 1
jne 0x40b974
test cl, cl
je 0x40b750
mov eax, dword [ebp - 4]
cmp eax, dword [edi + 0x30]
je 0x40b7e8
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
test eax, eax
je 0x40b78f
push esi
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40b781
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
jne 0x40b7d5
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 0x40b7ad
cmp dword [ebp - 4], 0
je 0x40b7ad
mov dword [edi + 0x34], 2
jmp 0x40b7ef
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
test eax, eax
je 0x40b78f
push esi
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40b781
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
je 0x40b778
cmp eax, 0x3e5
jne 0x40b781
mov al, 1
jmp 0x40b783
test cl, cl
je 0x40b974
mov dword [edi + 0x34], 1
mov eax, dword [edi + 0x34]
sub eax, 1
je 0x40b8a7
sub eax, 1
jne 0x40b974
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 0x40b85a
mov ecx, dword [ebp - 4]
cmp ecx, dword [edi + 0x30]
jne 0x40b85a
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 0x40b86b
cmp eax, 0x3e5
je 0x40b90f
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
test eax, eax
je 0x40b78f
push ebx
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40b781
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
jne 0x40b7d5
push dword [ebx + 0x10]
jmp 0x40b77b
push 0x1008
lea esi, [ebx + 0xac]
push 0
push esi
call fcn.0042d440
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 0x40b902
cmp dword [ebp - 4], 0
je 0x40b902
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 0x40b91e
cmp eax, 0x3e5
jne 0x40b91e
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 0x40b78f
push ebx
push dword [edi + 0x2c]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40b781
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
jne 0x40b7d5
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