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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x540
mov eax, dword [0x567650]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push esi
push edi
xor edi, edi
push 8
mov dword [ebp - 0x52c], eax
mov dword [ebp - 0x510], edi
mov dword [ebp - 0x50c], edi
mov dword [ebp - 0x514], edi
mov dword [ebp - 0x508], str..pipe_brwlankey
call fcn.0040858d
add esp, 4
cmp eax, edi
je 0x4080a3
mov ecx, eax
call fcn.00402ac0
jmp 0x4080a5
xor eax, eax
mov dword [0x568d00], eax
cmp eax, edi
je 0x4080f9
push str.WDWSV
mov ecx, eax
call fcn.00401660
test eax, eax
jne 0x4080d8
mov ecx, dword [0x568d00]
cmp ecx, edi
je 0x4080d0
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov dword [0x568d00], edi
jmp 0x4080f9
mov eax, dword [0x568d00]
cmp eax, edi
je 0x4080f9
push str.WSRV:
push str._s______________Log_Start______________n
push 0x40000
push eax
call fcn.00402b30
add esp, 0x10
push 0xbb8
push edi
push 2
call fcn.00407af0
add esp, 0xc
test eax, eax
je 0x4084d6
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventA]
push edi
push edi
push 1
push edi
call esi
mov dword [0x568d04], eax
cmp eax, edi
je 0x4084e8
push 0xbb8
push edi
push 2
mov dword [ebp - 0x510], eax
call fcn.00407af0
add esp, 0xc
test eax, eax
je 0x4084d6
push edi
push edi
push 1
push edi
call esi
mov dword [ebp - 0x50c], eax
cmp eax, edi
je 0x4084d6
push 0xbb8
push edi
push 2
call fcn.00407af0
add esp, 0xc
test eax, eax
je 0x4084d6
push 0x14
call fcn.004fcd52
add esp, 4
mov dword [ebp - 0x514], eax
cmp eax, edi
je 0x4084d6
push 1
mov ecx, eax
push ecx
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x4084d6
mov edx, dword [ebp - 0x514]
lea eax, [ebp - 0x538]
push eax
mov dword [ebp - 0x538], 0xc
mov dword [ebp - 0x530], 1
mov dword [ebp - 0x534], edx
call fcn.00408030
add esp, 4
test eax, eax
je 0x40854a
push 0xbb8
push edi
push 2
call fcn.00407af0
add esp, 0xc
test eax, eax
je 0x4084d6
push ebx
mov ebx, dword [ebp + 8]
mov esi, 1
dec ebx
cmp ebx, esi
jbe 0x408246
lea edi, [esi + 1]
mov ecx, dword [ebp - 0x52c]
mov eax, dword [ecx + esi*4]
mov cl, byte [eax]
cmp cl, 0x2d
je 0x408216
cmp cl, 0x2f
jne 0x408240
inc eax
push eax
push str.pipe
call fcn.004fc083
add esp, 8
test eax, eax
jne 0x408240
cmp edi, dword [ebp + 8]
jae 0x408240
mov edx, dword [ebp - 0x52c]
mov eax, dword [edx + esi*4 + 4]
inc esi
inc edi
mov dword [ebp - 0x508], eax
inc esi
inc edi
cmp esi, ebx
jb 0x408201
mov edx, dword [ebp - 0x508]
lea ecx, [ebp - 0x538]
push ecx
push 0x3e8
push 0
push 0
push 1
push 6
push 0x40000003
push edx
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x408285
push str.Unable_to_create_named_pipe
call fcn.004079a0
add esp, 4
jmp 0x4084d5
push 0
push 0
push 4
call fcn.00407af0
add esp, 0xc
test eax, eax
je 0x4084ce
mov ebx, dword [sym.imp.KERNEL32.dll_ResetEvent]
xor eax, eax
mov dword [ebp - 0x518], eax
mov dword [ebp - 0x528], eax
mov dword [ebp - 0x524], eax
mov dword [ebp - 0x520], eax
mov dword [ebp - 0x51c], eax
mov eax, dword [ebp - 0x50c]
push eax
mov dword [ebp - 0x518], eax
call ebx
lea eax, [ebp - 0x528]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x3e5
jne 0x408309
push 0xffffffffffffffff
push 0
lea ecx, [ebp - 0x510]
push ecx
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
jne 0x4084ce
xor eax, eax
mov dword [ebp - 0x518], eax
mov dword [ebp - 0x528], eax
mov dword [ebp - 0x524], eax
mov dword [ebp - 0x520], eax
mov dword [ebp - 0x51c], eax
mov eax, dword [ebp - 0x50c]
push eax
mov dword [ebp - 0x518], eax
call ebx
push 0x400
lea edx, [ebp - 0x504]
push 0
push edx
call fcn.004fc170
add esp, 0xc
lea eax, [ebp - 0x528]
push eax
lea ecx, [ebp - 0x540]
push ecx
push 0x400
lea edx, [ebp - 0x504]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x408398
call esi
cmp eax, 0x3e5
jne 0x408398
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x510]
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
jne 0x4084ce
mov eax, dword [0x568d00]
test eax, eax
je 0x4083fb
lea ecx, [ebp - 0x504]
push ecx
push str.WSRV:
push str._s_InputData:__s_n
push 0x80000
push eax
call fcn.00402b30
mov edx, dword [0x568d00]
add esp, 0x14
test edx, edx
je 0x4083fb
lea eax, [ebp - 0x504]
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4083d3
sub eax, esi
push eax
push str.WSRV:
push str._s_DataSize_:__d_n
push 0x80000
push edx
call fcn.00402b30
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0x14
push 0x100
lea edx, [ebp - 0x104]
push 0
push edx
call fcn.004fc170
lea eax, [ebp - 0x504]
add esp, 0xc
mov dword [ebp - 0x508], 0
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408424
sub eax, edx
lea ecx, [ebp - 0x508]
push ecx
lea edx, [ebp - 0x104]
push edx
push eax
lea eax, [ebp - 0x504]
push eax
call fcn.00407630
xor eax, eax
mov dword [ebp - 0x518], eax
mov dword [ebp - 0x528], eax
mov dword [ebp - 0x524], eax
mov dword [ebp - 0x520], eax
mov dword [ebp - 0x51c], eax
mov eax, dword [ebp - 0x50c]
add esp, 0x10
push eax
mov dword [ebp - 0x518], eax
call ebx
mov eax, dword [ebp - 0x508]
lea ecx, [ebp - 0x528]
push ecx
lea edx, [ebp - 0x53c]
push edx
push eax
lea ecx, [ebp - 0x104]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4084c2
call esi
cmp eax, 0x3e5
jne 0x4084c2
push 0xffffffffffffffff
push 0
lea edx, [ebp - 0x510]
push edx
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
jne 0x4084ce
push edi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
jmp 0x4082a1
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ebx
mov eax, dword [0x568d04]
xor edi, edi
cmp eax, edi
je 0x4084e8
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x50c]
cmp eax, edi
je 0x4084f9
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x514]
cmp eax, edi
je 0x40850c
push eax
call fcn.004fcd18
add esp, 4
mov eax, dword [0x568d00]
cmp eax, edi
je 0x40854a
push str.WSRV:
push str._s_____________Log_End_____________n_n
push 0x40000
push eax
call fcn.00402b30
mov ecx, dword [0x568d00]
add esp, 0x10
call fcn.00401690
mov ecx, dword [0x568d00]
cmp ecx, edi
je 0x40854a
mov eax, dword [ecx]
mov edx, dword [eax]
push 1
call edx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.004fb314
mov esp, ebp
pop ebp
ret