Function at 0x43151e
Capabilities:
Create pipe
Create two anonymous pipes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [ebp + 0xc]
push ebx
and al, 3
push esi
neg al
sbb eax, eax
xor ebx, ebx
neg eax
test byte [ebp + 0xc], 2
push edi
mov dword [ebp - 0x14], eax
jne 0x431544
cmp eax, ebx
mov dword [ebp - 0x10], ebx
jne 0x43154b
mov dword [ebp - 0x10], 1
mov eax, 0x8000
test dword [ebp + 0xc], eax
je 0x431561
mov dword [ebp - 0x20], eax
mov byte [ebp + 0xd], 0x62
mov byte [ebp + 0xe], bl
jmp 0x43156b
mov dword [ebp - 0x20], 0x4000
mov byte [ebp + 0xd], bl
or dword [ebp - 0x2c], 0xffffffff
mov dword [ebp - 0x38], 0xc
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x30], 1
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ebx
call sym.ruby187c.exc_rb_w32_enter_critical
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
cmp dword [ebp - 0x10], ebx
mov edi, dword [sym.imp.KERNEL32.dll_DuplicateHandle]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], eax
je 0x4315e4
lea eax, [ebp - 0x38]
push 0x800
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
je 0x4316e6
push 2
push ebx
lea eax, [ebp - 0x18]
push ebx
push eax
push dword [ebp - 4]
push dword [ebp - 0x24]
push dword [ebp - 4]
call edi
test eax, eax
je 0x431702
push dword [ebp - 0x24]
call esi
cmp dword [ebp - 0x14], ebx
je 0x431628
lea eax, [ebp - 0x38]
push 0x800
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
je 0x43172e
push 2
push ebx
lea eax, [ebp - 0x1c]
push ebx
push eax
push dword [ebp - 4]
push dword [ebp - 0x28]
push dword [ebp - 4]
call edi
test eax, eax
je 0x431747
push dword [ebp - 0x28]
call esi
push dword [ebp - 4]
call esi
push ebx
lea eax, [ebp - 0x38]
push dword [ebp - 8]
push dword [ebp - 0xc]
push eax
push ebx
push dword [ebp + 8]
call fcn.00431a95
add esp, 0x18
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x43177c
cmp dword [ebp - 0x10], ebx
mov edi, dword [sym.imp.MSVCRT.dll__fdopen]
je 0x431695
push dword [ebp - 0x20]
push dword [ebp - 0x18]
call fcn.004329e2
pop ecx
mov dword [ebp + 8], eax
pop ecx
push dword [ebp - 8]
call esi
cmp dword [ebp + 8], 0xffffffff
je 0x43179c
lea eax, [ebp + 0xc]
mov byte [ebp + 0xc], 0x72
push eax
push dword [ebp + 8]
call edi
pop ecx
cmp eax, ebx
pop ecx
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
je 0x4317a3
cmp dword [ebp - 0x14], ebx
je 0x4316d8
mov eax, dword [ebp - 0x20]
or al, 1
push eax
push dword [ebp - 0x1c]
call fcn.004329e2
pop ecx
mov dword [ebp + 8], eax
pop ecx
push dword [ebp - 0xc]
call esi
cmp dword [ebp + 8], 0xffffffff
je 0x4317be
lea eax, [ebp + 0xc]
mov byte [ebp + 0xc], 0x77
push eax
push dword [ebp + 8]
call edi
pop ecx
cmp eax, ebx
pop ecx
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
je 0x4317c5
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
mov dword [ebp - 0x2c], eax
jmp 0x4317e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.ruby187c.exc_rb_w32_map_errno
pop ecx
mov esi, eax
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], esi
jmp 0x4317e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.ruby187c.exc_rb_w32_map_errno
pop ecx
mov esi, eax
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], esi
push dword [ebp - 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 8]
call esi
push dword [ebp - 4]
jmp 0x431798
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.ruby187c.exc_rb_w32_map_errno
pop ecx
mov edi, eax
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], edi
jmp 0x43176d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.ruby187c.exc_rb_w32_map_errno
pop ecx
mov edi, eax
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], edi
push dword [ebp - 0xc]
call esi
push dword [ebp - 0x28]
call esi
push dword [ebp - 4]
call esi
cmp dword [ebp - 0x10], ebx
je 0x4317e9
push dword [ebp - 0x18]
call esi
push dword [ebp - 8]
jmp 0x431798
cmp dword [ebp - 0x10], ebx
je 0x43178b
push dword [ebp - 8]
call esi
push dword [ebp - 0x18]
call esi
cmp dword [ebp - 0x14], ebx
je 0x4317e9
push dword [ebp - 0xc]
call esi
push dword [ebp - 0x1c]
call esi
jmp 0x4317e9
push dword [ebp - 0x18]
call esi
jmp 0x4317ad
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll__close]
pop ecx
cmp dword [ebp - 0x14], ebx
je 0x4317e0
push dword [ebp - 0xc]
call esi
push dword [ebp - 0x1c]
call esi
jmp 0x4317e0
push dword [ebp - 0x1c]
call esi
jmp 0x4317cf
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll__close]
pop ecx
cmp dword [ebp - 0x10], ebx
je 0x4317e0
mov eax, dword [ebp + 0x10]
push dword [eax]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
push dword [ebp - 4]
call fcn.004317f6
pop ecx
call sym.ruby187c.exc_rb_w32_leave_critical
mov eax, dword [ebp - 0x2c]
pop edi
pop esi
pop ebx
leave
ret