Function at 0x300509d0
Capabilities:
Connect pipe
Read pipe
Write pipe

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
mov eax, dword [0x30215e88]
xor eax, esp
mov dword [esp + 0x28], eax
push ebx
push esi
or ebx, 0xffffffff
push edi
pushfd
mov eax, dword fs:[0x18]
pop esi
mov dword [esp + 0x1c], esi
test eax, eax
jne 0x30050a04
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
jmp 0x30050a15
mov ecx, dword [eax + 0x34]
mov eax, dword [eax + 0xbf4]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], eax
push 0x30268700
call dword [sym.imp.KERNEL32.dll_TryEnterCriticalSection]
test eax, eax
je 0x30050a67
mov ecx, dword [0x30240930]
test ecx, ecx
je 0x30050a4e
mov edx, dword [0x30240934]
call fcn.300494c0
mov ecx, dword [0x30240930]
call fcn.300011f0
mov dword [0x30240930], 0
push 0x30268700
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x3024092c], 0
je 0x30050a67
call fcn.300493c0
mov edx, dword [ebp + 8]
lea eax, [ebp + 0xc]
push eax
xor ecx, ecx
call fcn.300505a0
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
jle 0x30050c46
lea ecx, [eax + 1]
pushfd
mov eax, dword fs:[0x18]
pop dword [esp + 0x10]
test eax, eax
jne 0x30050a9e
or esi, 0xffffffff
or edi, 0xffffffff
jmp 0x30050aa7
mov esi, dword [eax + 0x34]
mov edi, dword [eax + 0xbf4]
push ecx
push 8
push dword [0x3026d8b0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword fs:[0x18]
mov dword [esp + 0x18], eax
test ecx, ecx
je 0x30050ad8
mov eax, dword [esp + 0x10]
mov dword [ecx + 0x34], esi
mov dword [ecx + 0xbf4], edi
test eax, eax
je 0x30050ad8
push eax
popfd
mov esi, dword [esp + 0x18]
lea eax, [ebp + 0xc]
mov edx, dword [ebp + 8]
mov ecx, esi
push eax
call fcn.300505a0
add esp, 4
cmp dword [0x3026b2b8], 0
je 0x30050bcb
mov ecx, str.pipe
call fcn.30003500
mov esi, eax
mov dword [esp + 0x28], esi
test esi, esi
je 0x30050bed
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
mov edx, 8
lea ecx, [esp + 0x30]
call fcn.3004c440
add esp, 4
lea edi, [esi - 1]
lea ecx, [ecx]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x30050b30
mov ax, word [0x30201ed8]
lea edx, [esp + 0x2c]
mov ecx, edx
mov word [edi], ax
mov dword [esp + 0x10], ecx
lea ecx, [ecx]
mov al, byte [edx]
inc edx
test al, al
jne 0x30050b50
sub edx, ecx
lea edi, [esi - 1]
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x30050b60
mov esi, dword [esp + 0x10]
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x28]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [edx - 1]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x30050b81
mov eax, dword [str..log]
mov dword [ecx], eax
mov al, byte [0x30201ee0]
push 0x302039a0
push edx
mov byte [ecx + 4], al
call fcn.30166354
mov esi, eax
add esp, 8
test esi, esi
je 0x30050bed
push esi
push 1
push dword [esp + 0x1c]
push dword [esp + 0x24]
call fcn.30167d0d
push esi
call fcn.30166490
add esp, 0x14
xor ebx, ebx
jmp 0x30050bed
push 0xffffffffffffffff
lea eax, [esp + 0x18]
push eax
mov eax, dword [esp + 0x1c]
push eax
push esi
push eax
push esi
push 0x302697e0
call dword [sym.imp.KERNEL32.dll_CallNamedPipeW]
neg eax
sbb eax, eax
not eax
and ebx, eax
pushfd
mov eax, dword fs:[0x18]
pop esi
test eax, eax
jne 0x30050c06
or edi, 0xffffffff
mov dword [esp + 0x10], 0xffffffff
jmp 0x30050c13
mov edi, dword [eax + 0x34]
mov eax, dword [eax + 0xbf4]
mov dword [esp + 0x10], eax
push dword [esp + 0x18]
push 0
push dword [0x3026d8b0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword fs:[0x18]
test eax, eax
je 0x30050c42
mov ecx, dword [esp + 0x10]
mov dword [eax + 0x34], edi
mov dword [eax + 0xbf4], ecx
test esi, esi
je 0x30050c42
push esi
popfd
mov esi, dword [esp + 0x1c]
mov ecx, dword fs:[0x18]
test ecx, ecx
je 0x30050c7c
mov eax, dword [esp + 0x20]
mov dword [ecx + 0x34], eax
mov eax, dword [esp + 0x24]
mov dword [ecx + 0xbf4], eax
mov eax, ebx
test esi, esi
je 0x30050c7e
push esi
popfd
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.30159c2d
mov esp, ebp
pop ebp
ret
mov eax, ebx
mov ecx, dword [esp + 0x34]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.30159c2d
mov esp, ebp
pop ebp
ret