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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x54476c
mov eax, dword fs:[0]
push eax
sub esp, 0x548
mov eax, dword [0x59bad0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
xor ebx, ebx
push 8
mov dword [ebp - 0x538], eax
mov dword [ebp - 0x51c], ebx
mov dword [ebp - 0x518], ebx
mov dword [ebp - 0x534], ebx
mov dword [ebp - 0x514], str..pipe_brwlankey
call fcn.0041c286
mov esi, eax
add esp, 4
mov dword [ebp - 0x554], esi
mov dword [ebp - 4], ebx
cmp esi, ebx
je 0x4036d5
push 8
mov dword [esi], vtable.CBrDbgOutA.0
call fcn.0041c286
add esp, 4
mov dword [ebp - 0x54c], eax
mov byte [ebp - 4], 1
cmp eax, ebx
je 0x4036cb
mov edi, eax
call fcn.00402c50
mov byte [ebp - 4], bl
mov dword [esi + 4], eax
jmp 0x4036d7
xor eax, eax
mov byte [ebp - 4], al
mov dword [esi + 4], eax
jmp 0x4036d7
xor esi, esi
mov dword [ebp - 4], 0xffffffff
mov ecx, esi
mov dword [0x5a3ae0], ecx
cmp esi, ebx
je 0x403743
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x40370f
cmp dword [eax + 4], ebx
je 0x40370f
mov ecx, dword [eax + 4]
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
push str.WDWSV
call eax
cmp eax, ebx
jne 0x403723
mov ecx, dword [0x5a3ae0]
cmp ecx, ebx
je 0x40371b
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov dword [0x5a3ae0], ebx
jmp 0x403743
mov eax, dword [0x5a3ae0]
cmp eax, ebx
je 0x403743
push str.WSRV:
push str._s______________Log_Start______________n
push 0x40000
call fcn.00402f40
add esp, 0xc
mov edi, dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
mov esi, 0xbb8
cmp dword [0x5a3af0], ebx
jne 0x4037a3
mov eax, dword [0x59d198]
mov ecx, dword [0x5a3ac0]
mov dword [0x5a3ad8], eax
push 0x5a3ac4
inc eax
push ecx
mov dword [0x5a3acc], ebx
mov dword [0x5a3ac8], 2
mov dword [0x5a3ad0], ebx
mov dword [0x5a3adc], esi
mov dword [0x59d198], eax
call edi
cmp eax, ebx
jne 0x4037a3
mov edi, 0x572c14
call fcn.00403240
jmp 0x403a3d
push ebx
push ebx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [0x5a3af4], eax
cmp eax, ebx
je 0x403a4d
mov dword [ebp - 0x51c], eax
cmp dword [0x5a3af0], ebx
jne 0x403816
mov eax, dword [0x59d198]
mov edx, dword [0x5a3ac0]
mov dword [0x5a3ad8], eax
push 0x5a3ac4
inc eax
push edx
mov dword [0x5a3acc], ebx
mov dword [0x5a3ac8], 2
mov dword [0x5a3ad0], ebx
mov dword [0x5a3adc], esi
mov dword [0x59d198], eax
call edi
cmp eax, ebx
jne 0x403816
mov edi, 0x572c14
call fcn.00403240
jmp 0x403a3d
push ebx
push ebx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp - 0x518], eax
cmp eax, ebx
je 0x403a3d
cmp dword [0x5a3af0], ebx
jne 0x403883
mov eax, dword [0x59d198]
mov dword [0x5a3ad8], eax
inc eax
mov dword [0x59d198], eax
mov eax, dword [0x5a3ac0]
push 0x5a3ac4
push eax
mov dword [0x5a3acc], ebx
mov dword [0x5a3ac8], 2
mov dword [0x5a3ad0], ebx
mov dword [0x5a3adc], esi
call edi
cmp eax, ebx
jne 0x403883
mov edi, 0x572c14
call fcn.00403240
jmp 0x403a3d
push 0x14
call fcn.0051cc97
add esp, 4
mov dword [ebp - 0x534], eax
cmp eax, ebx
je 0x403a3d
push 1
mov ebx, eax
push ebx
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x403a3b
lea ecx, [ebp - 0x544]
mov dword [ebp - 0x544], 0xc
mov dword [ebp - 0x53c], 1
mov dword [ebp - 0x540], ebx
test ecx, ecx
je 0x403abf
xor ebx, ebx
push ebx
lea edx, [ebp - 0x540]
push edx
push 1
push str.D:_D_OICI_GA___BG__D_OICI_GA___AN__A_OICI_GRGWGX___AU__A_OICI_GA___BA_
call dword [sym.imp.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorA]
cmp eax, ebx
je 0x403abf
cmp dword [0x5a3af0], ebx
jne 0x403949
mov eax, dword [0x59d198]
mov dword [0x5a3ad8], eax
inc eax
mov dword [0x59d198], eax
mov eax, dword [0x5a3ac0]
push 0x5a3ac4
push eax
mov dword [0x5a3acc], ebx
mov dword [0x5a3ac8], 2
mov dword [0x5a3ad0], ebx
mov dword [0x5a3adc], esi
call edi
cmp eax, ebx
jne 0x403949
mov edi, 0x572c14
call fcn.00403240
jmp 0x403a3b
mov eax, dword [ebp + 8]
mov esi, 1
dec eax
cmp eax, esi
jbe 0x4039a3
lea edi, [esi + 1]
lea esp, [esp]
mov ebx, dword [ebp - 0x538]
mov eax, dword [ebx + esi*4]
mov cl, byte [eax]
cmp cl, 0x2d
je 0x403975
cmp cl, 0x2f
jne 0x403999
inc eax
push eax
push str.pipe
call fcn.0051cc46
add esp, 8
test eax, eax
jne 0x403999
cmp edi, dword [ebp + 8]
jae 0x403999
mov ecx, dword [ebx + esi*4 + 4]
inc esi
inc edi
mov dword [ebp - 0x514], ecx
mov eax, dword [ebp + 8]
inc esi
dec eax
inc edi
cmp esi, eax
jb 0x403960
mov eax, dword [ebp - 0x514]
lea edx, [ebp - 0x544]
push edx
push 0x3e8
push 0
push 0
push 1
push 6
push 0x40000003
push eax
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4039dc
mov edi, str.Unable_to_create_named_pipe
call fcn.00403240
jmp 0x403a3b
xor esi, esi
cmp dword [0x5a3af0], esi
jne 0x403adb
mov ecx, dword [0x5a3ac0]
push 0x5a3ac4
push ecx
mov dword [0x5a3acc], 1
mov dword [0x5a3ac8], 4
mov dword [0x5a3ad0], esi
mov dword [0x5a3adc], esi
mov dword [0x5a3ad8], esi
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
cmp eax, esi
jne 0x403adb
mov edi, 0x572c14
call fcn.00403240
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
mov eax, dword [0x5a3af4]
cmp eax, ebx
je 0x403a4d
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x518]
cmp eax, ebx
je 0x403a5e
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x534]
cmp eax, ebx
je 0x403a71
push eax
call fcn.0051cc5d
add esp, 4
mov eax, dword [0x5a3ae0]
cmp eax, ebx
je 0x403abf
push str.WSRV:
push str._s_____________Log_End_____________n_n
push 0x40000
call fcn.00402f40
mov ecx, dword [0x5a3ae0]
mov eax, dword [ecx + 4]
add esp, 0xc
cmp eax, ebx
je 0x403ab3
cmp dword [eax + 4], ebx
je 0x403ab3
mov ecx, dword [eax + 4]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
mov ecx, dword [0x5a3ae0]
cmp ecx, ebx
je 0x403abf
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0051c462
mov esp, ebp
pop ebp
ret
mov edi, dword [sym.imp.KERNEL32.dll_ResetEvent]
xor eax, eax
mov dword [ebp - 0x520], eax
mov dword [ebp - 0x530], eax
mov dword [ebp - 0x52c], eax
mov dword [ebp - 0x528], eax
mov dword [ebp - 0x524], eax
mov eax, dword [ebp - 0x518]
push eax
mov dword [ebp - 0x520], eax
call edi
lea edx, [ebp - 0x530]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x403b46
push 0xffffffffffffffff
push esi
lea eax, [ebp - 0x51c]
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
jne 0x403a34
xor eax, eax
mov dword [ebp - 0x520], eax
mov dword [ebp - 0x530], eax
mov dword [ebp - 0x52c], eax
mov dword [ebp - 0x528], eax
mov dword [ebp - 0x524], eax
mov eax, dword [ebp - 0x518]
push eax
mov dword [ebp - 0x520], eax
call edi
push 0x400
lea ecx, [ebp - 0x510]
push esi
push ecx
call fcn.0051f1a0
add esp, 0xc
lea edx, [ebp - 0x530]
push edx
lea eax, [ebp - 0x548]
push eax
push 0x400
lea ecx, [ebp - 0x510]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x403bd7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x403bd7
push 0xffffffffffffffff
push esi
lea edx, [ebp - 0x51c]
push edx
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
jne 0x403a34
mov eax, dword [0x5a3ae0]
cmp eax, esi
je 0x403c33
lea ecx, [ebp - 0x510]
push ecx
push str.WSRV:
push str._s_InputData:__s_n
push 0x80000
call fcn.00402f40
mov eax, dword [0x5a3ae0]
add esp, 0x10
cmp eax, esi
je 0x403c33
lea ecx, [ebp - 0x510]
lea esi, [ecx + 1]
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x403c10
sub ecx, esi
push ecx
push str.WSRV:
push str._s_DataSize_:__d_n
push 0x80000
call fcn.00402f40
add esp, 0x10
xor esi, esi
push 0x100
lea edx, [ebp - 0x110]
push esi
push edx
call fcn.0051f1a0
lea eax, [ebp - 0x510]
add esp, 0xc
mov dword [ebp - 0x514], esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403c57
sub eax, edx
push eax
lea eax, [ebp - 0x510]
push eax
lea edx, [ebp - 0x514]
lea ecx, [ebp - 0x110]
call section..text
xor eax, eax
mov dword [ebp - 0x520], eax
mov dword [ebp - 0x530], eax
mov dword [ebp - 0x52c], eax
mov dword [ebp - 0x528], eax
mov dword [ebp - 0x524], eax
mov eax, dword [ebp - 0x518]
add esp, 8
push eax
mov dword [ebp - 0x520], eax
call edi
mov eax, dword [ebp - 0x514]
lea ecx, [ebp - 0x530]
push ecx
lea edx, [ebp - 0x550]
push edx
push eax
lea ecx, [ebp - 0x110]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x403cfa
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x403cfa
push 0xffffffffffffffff
push esi
lea edx, [ebp - 0x51c]
push edx
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 1
jne 0x403a34
push ebx
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
jmp 0x403ae1