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

Disassembly:
sub esp, 0x20
push ebx
push ebp
push esi
push edi
mov esi, ecx
xor edi, edi
cmp dword [esi + 4], edi
je 0x4959ff
cmp dword [esi + 8], edi
je 0x495b1a
lea ecx, [ecx]
cmp dword [esi + 0x10], 0xffffffff
jne 0x4958a4
lea eax, [esi + 0x270]
push eax
push 0x1388
push 0x800
push 0x800
push 0xff
push 6
push 3
lea ecx, [esi + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov edi, eax
mov byte [esi + 0x27c], 1
cmp edi, 0xffffffff
je 0x495b1a
push 0
push edi
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
mov byte [esi + 0x27c], 0
mov dword [esi + 0x10], edi
lea ebp, [esi + 0x230]
push ebp
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x22c], 0
jne 0x4958cd
push ebp
mov byte [esi + 0x27c], 1
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x4959e3
mov byte [esi + 0x27c], 0
mov eax, dword [esi + 0x214]
mov edx, dword [esi + 0x228]
mov ebx, dword [edx]
lea edi, [esi + 0x214]
test eax, eax
jne 0x49598e
call fcn.004e73ca
xor eax, eax
cmp ebx, dword [eax + 0x14]
jne 0x495901
call fcn.004e73ca
mov eax, dword [edi + 0x14]
mov eax, dword [eax]
mov ecx, dword [edi]
mov ebx, dword [ebx + 8]
push eax
push ecx
lea ecx, [esp + 0x30]
push ecx
mov ecx, edi
mov dword [esp + 0x2c], ebx
call fcn.00495380
push ebp
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [ebx + 4]
push 0
lea eax, [esp + 0x18]
push eax
push 4
lea ecx, [esp + 0x28]
mov dword [esp + 0x28], edx
mov edx, dword [esi + 0x10]
push ecx
push edx
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x14], 4
jne 0x495995
mov ecx, dword [esp + 0x1c]
mov edx, dword [ebx]
push 0
lea eax, [esp + 0x18]
push eax
mov eax, dword [esi + 0x10]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebx + 8], 0
je 0x49597b
mov ecx, dword [ebx + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [ebx]
push edx
call fcn.004a3d2b
push ebx
call fcn.004a3d15
add esp, 8
jmp 0x4959eb
mov eax, dword [eax]
jmp 0x4958f7
push ebp
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [edi + 0x14]
mov ebp, dword [eax]
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x20]
push ecx
push edx
push ebp
mov ecx, edi
call fcn.004950e0
push 1
mov ecx, edi
mov ebx, eax
call fcn.004956d0
mov dword [ebp + 4], ebx
mov eax, dword [ebx + 4]
mov dword [eax], ebx
lea eax, [esi + 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esi + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov dword [esi + 0x10], 0xffffffff
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [esi + 8], 0
jne 0x495850
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret
mov bl, 1
cmp dword [esi + 8], edi
je 0x495b1a
lea ebx, [ebx]
test bl, bl
je 0x495a28
push 1
lea edx, [esi + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeW]
test eax, eax
je 0x495b07
or ebp, 0xffffffff
cmp dword [esi + 0x10], ebp
jne 0x495a4c
push edi
push 0x40000000
push 3
push edi
push edi
push 0xc0000000
lea eax, [esi + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi + 0x10], eax
mov eax, dword [esi + 0x10]
cmp eax, ebp
je 0x495b07
push edi
lea ecx, [esp + 0x1c]
push ecx
push 4
lea edx, [esp + 0x1c]
push edx
push eax
xor bl, bl
mov dword [esp + 0x2c], edi
mov dword [esp + 0x24], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x495b02
cmp dword [esp + 0x10], edi
je 0x495b02
push 0xc
call fcn.004a3ce6
mov edi, eax
mov eax, dword [esp + 0x14]
mov dword [edi + 4], eax
mov ecx, dword [esp + 0x14]
push ecx
mov dword [esp + 0x2c], edi
call fcn.004a3d20
add esp, 8
mov dword [edi], eax
test eax, eax
je 0x495b0f
mov ecx, dword [esp + 0x10]
push 0
lea edx, [esp + 0x1c]
push edx
mov edx, dword [esi + 0x10]
push ecx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x10]
jne 0x495af1
lea edi, [esi + 0x230]
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ecx, [esp + 0x24]
push ecx
lea ecx, [esi + 0x214]
call fcn.004957f0
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x495b0f
mov edx, dword [esi + 0x10]
push edx
mov bl, 1
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0x10], ebp
jmp 0x495b0f
mov bl, 1
mov dword [esi + 0x10], ebp
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
xor edi, edi
cmp dword [esi + 8], edi
jne 0x495a10
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret