Function at 0x407e26
Capabilities:
Encode data using xor
Read pipe
Write pipe

Disassembly:
push ecx
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 8]
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
lea ebx, [ecx + 0xca]
push esi
lea esi, [ecx - 0x6ff]
add edx, 0xfffffccf
lea eax, [esi + 0x864]
mov dword [esp + 0x14], edx
add ebp, 0x588
push edi
cmp esi, eax
jg 0x408058
lea eax, [esi + 0x3e1]
cmp ebx, eax
je 0x408009
mov eax, dword [0x65c49c]
mov edi, dword [esp + 0x28]
mov eax, dword [eax + 8]
add eax, 0x1b16b1
imul eax, dword [edi + 0xe8]
mov dword [edi + 0xe8], eax
mov ecx, dword [0x65c49c]
mov eax, dword [ecx]
sub eax, dword [edi + 0xd8]
add eax, 0x1e6bf3
or dword [ecx + 0xa0], eax
mov eax, dword [0x65c520]
add eax, dword [0x65c588]
xor eax, 0xb3381
imul eax, dword [edi + 0xd8]
mov dword [edi + 0xd8], eax
lea eax, [ebp - 0x105]
push eax
lea eax, [esi + 0xc4]
push eax
lea eax, [esi + 0x864]
push eax
mov eax, ebx
xor eax, 0xa56
push eax
lea eax, [edx + 0x1e2]
push eax
mov eax, esi
xor eax, 0xd
push 0x65c4a0
push eax
call fcn.00403f96
mov ebp, eax
add esp, 0x1c
mov eax, dword [edi + 0x118]
cmp eax, dword [0x65c4b8]
jae 0x407f26
mov eax, dword [edi + 0x54]
sub eax, dword [0x65c560]
add eax, 0x2d7bf
imul eax, dword [0x65c4f4]
mov dword [0x65c4f4], eax
jmp 0x407f40
mov ecx, dword [0x65c49c]
mov eax, dword [edi + 0xcc]
sub eax, dword [ecx + 0x50]
add eax, 0x10ac23
add dword [ecx + 0xe0], eax
mov edx, esi
xor ebx, 0x36a
xor edx, 0x29f
cmp dword [0x65c598], 0x130ca
jbe 0x407f6f
mov eax, dword [0x65c49c]
mov eax, dword [eax + 0x30]
xor eax, 0x1460faf
sub dword [edi + 0xb0], eax
jmp 0x407f7d
mov eax, dword [edi + 0x108]
add eax, 0x8a42
mov dword [edi + 0x40], eax
mov eax, dword [0x65c550]
xor ebp, 0x869
mov ecx, dword [edi + 0xa0]
add eax, 0xffe18971
sub ecx, dword [0x65c4a8]
add eax, ecx
mov dword [0x65c550], eax
mov eax, dword [edi + 0x108]
xor eax, dword [edi + 0xa0]
xor eax, 0x32d62
mov dword [edi + 0x108], eax
mov ecx, dword [0x65c49c]
mov eax, dword [0x65c4f4]
add eax, 0xfff03bc3
xor dword [ecx + 0xb0], eax
lea eax, [ebx - 0x2dc]
push eax
lea eax, [esi + 0xd]
push eax
push dword [0x65c49c]
lea eax, [edx + 0x6c9]
xor eax, 0x3c7
push eax
push ebp
xor ebp, 0xafb
lea eax, [edx - 0x19b]
push ebp
push eax
call fcn.00401711
add esp, 0x1c
add ebx, 0xffffffc5
jmp 0x40821f
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 0x9c]
or ecx, 0x354a
imul ecx, dword [eax + 0xdc]
cmp dword [0x65c58c], ecx
je 0x40821f
mov eax, dword [0x65c49c]
mov ecx, esi
sub ecx, dword [eax + 0x110]
sub ecx, dword [esp + 0x1c]
cmp esi, ecx
je 0x40821f
mov eax, dword [0x65c5b4]
sub eax, esi
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
jmp 0x40821f
mov edi, dword [esp + 0x28]
mov eax, dword [edi]
xor eax, esi
cmp dword [0x65c4f8], eax
jne 0x408165
mov eax, dword [edi + 0x108]
mov ecx, dword [edi + 0xb8]
and eax, 0x3894
mov dword [esp + 0x20], ecx
cmp ecx, eax
jb 0x408111
mov edx, dword [esp + 0x1c]
mov ecx, esi
xor ecx, dword [esp + 0x1c]
or edx, 0x39e6
mov dword [esp + 0x24], ecx
mov dword [esp + 0x10], edx
mov eax, dword [0x65c49c]
and ebp, 0xffffcb62
mov eax, dword [eax]
xor eax, ecx
mov ecx, dword [0x65c5b4]
or dword [0x65c5c0], eax
mov eax, dword [esp + 0x18]
add eax, ecx
and ecx, ebx
xor eax, 0x3aeb
sub ecx, ebp
push eax
mov eax, dword [edi + 0xe0]
imul eax, esi
or eax, esi
push eax
mov eax, dword [edi + 0x18]
or eax, dword [esp + 0x24]
push edx
sub eax, esi
push eax
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
mov ecx, dword [esp + 0x20]
mov eax, dword [edi + 0x108]
add ecx, 4
mov edx, dword [esp + 0x10]
and eax, 0x3894
mov dword [esp + 0x20], ecx
cmp ecx, eax
mov ecx, dword [esp + 0x24]
jae 0x4080a1
mov edx, dword [esp + 0x18]
mov ecx, dword [0x65c49c]
mov eax, dword [ecx + 0xd0]
add eax, dword [ecx + 0x80]
cmp dword [edi + 0xd4], eax
ja 0x40816b
mov eax, dword [edi + 0x30]
imul eax, ebp
push eax
mov eax, esi
and eax, edx
push eax
push dword [esp + 0x24]
mov eax, dword [edi + 0x114]
sub eax, ebp
push eax
lea eax, [edx + 1]
imul eax, dword [esp + 0x2c]
push eax
mov eax, esi
sub eax, dword [0x65c574]
push eax
mov eax, dword [ecx + 0x88]
xor eax, esi
push eax
call dword [sym.imp.KERNEL32.dll_TransactNamedPipe]
mov ecx, dword [0x65c49c]
mov eax, dword [ecx + 0xf4]
xor eax, dword [0x65c56c]
xor eax, 0x3563
mov dword [0x65c56c], eax
mov eax, dword [ecx + 0xd8]
sub eax, dword [0x65c5b8]
xor eax, ebx
sub ebp, eax
mov eax, dword [edi + 0xcc]
sub eax, dword [edi + 0x28]
add dword [edi + 0x50], eax
mov eax, dword [0x65c4a0]
sub eax, dword [0x65c588]
sub eax, ebp
push eax
mov eax, dword [esp + 0x20]
sub eax, dword [0x65c53c]
or eax, dword [0x65c5b4]
push eax
call dword [sym.imp.KERNEL32.dll_WaitNamedPipeA]
mov ecx, dword [0x65c49c]
mov eax, dword [ecx]
imul eax, dword [ecx + 0x3c]
and eax, dword [0x65c4f4]
xor dword [ecx + 0x3c], eax
mov eax, esi
xor eax, 0x354a
mov ecx, esi
imul eax, dword [edi + 0xd0]
push eax
mov eax, dword [0x65c49c]
push esi
sub ecx, dword [eax + 0x88]
mov eax, dword [edi + 0xbc]
add ecx, ebp
or eax, dword [edi]
push ecx
mov ecx, dword [edi + 0x28]
imul ecx, dword [esp + 0x28]
push eax
push ecx
lea ecx, [esi + 0x354a]
or ecx, ebp
push 0x65c4a0
push ecx
call fcn.004013a0
add esp, 0x1c
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
pop ecx
ret