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

Disassembly:
sub esp, 0x540
mov eax, dword [0x416060]
xor eax, esp
mov dword [esp + 0x53c], eax
mov eax, dword [esp + 0x548]
push ebx
push ebp
push esi
push edi
xor edi, edi
push 8
mov dword [esp + 0x38], eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x34], edi
mov dword [esp + 0x14], str..pipe_brwlankey
call fcn.00403f86
add esp, 4
cmp eax, edi
je 0x403840
mov esi, eax
call fcn.00402e90
jmp 0x403842
xor eax, eax
cmp eax, edi
mov ecx, eax
mov dword [0x417f00], ecx
je 0x4038a9
mov edx, dword [eax + 4]
cmp edx, edi
je 0x403875
cmp dword [edx + 4], edi
je 0x403875
mov ecx, edx
mov ecx, dword [ecx + 4]
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
push str.WDWSV
call eax
cmp eax, edi
jne 0x403889
mov ecx, dword [0x417f00]
cmp ecx, edi
je 0x403881
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov dword [0x417f00], edi
jmp 0x4038a9
mov eax, dword [0x417f00]
cmp eax, edi
je 0x4038a9
push str.WSRV:
push str._s______________Log_Start______________n
push 0x40000
call fcn.00402f50
add esp, 0xc
cmp dword [0x417f08], edi
mov ebx, dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
mov esi, 0xbb8
mov ebp, 2
jne 0x40390c
mov eax, dword [0x4172f0]
mov ecx, dword [0x417ee0]
mov dword [0x417ef8], eax
push 0x417ee4
add eax, 1
push ecx
mov dword [0x417eec], edi
mov dword [0x417ee8], ebp
mov dword [0x417ef0], edi
mov dword [0x417efc], esi
mov dword [0x4172f0], eax
call ebx
cmp eax, edi
jne 0x40390c
mov edi, 0x413fec
call fcn.004033e0
jmp 0x403b99
push edi
push edi
push 1
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventA]
call edi
xor ecx, ecx
cmp eax, ecx
mov dword [0x417f0c], eax
je 0x403ba9
cmp dword [0x417f08], ecx
mov dword [esp + 0x14], eax
jne 0x40397f
mov eax, dword [0x4172f0]
mov edx, dword [0x417ee0]
mov dword [0x417ef8], eax
push 0x417ee4
add eax, 1
push edx
mov dword [0x417eec], ecx
mov dword [0x417ee8], ebp
mov dword [0x417ef0], ecx
mov dword [0x417efc], esi
mov dword [0x4172f0], eax
call ebx
test eax, eax
jne 0x40397f
mov edi, 0x413fec
call fcn.004033e0
jmp 0x403b99
push 0
push 0
push 1
push 0
call edi
xor edi, edi
cmp eax, edi
mov dword [esp + 0x18], eax
je 0x403b99
cmp dword [0x417f08], edi
jne 0x4039e9
mov eax, dword [0x4172f0]
mov dword [0x417ef8], eax
add eax, 1
mov dword [0x4172f0], eax
mov eax, dword [0x417ee0]
push 0x417ee4
push eax
mov dword [0x417eec], edi
mov dword [0x417ee8], ebp
mov dword [0x417ef0], edi
mov dword [0x417efc], esi
call ebx
cmp eax, edi
jne 0x4039e9
mov edi, 0x413fec
call fcn.004033e0
jmp 0x403b99
push 0x14
call fcn.00404a02
mov edi, eax
add esp, 4
test edi, edi
mov dword [esp + 0x30], edi
je 0x403b99
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x403b99
lea ecx, [esp + 0x38]
test ecx, ecx
mov dword [esp + 0x38], 0xc
mov dword [esp + 0x40], 1
mov dword [esp + 0x3c], edi
je 0x403c18
xor edi, edi
push edi
lea edx, [esp + 0x40]
push edx
push 1
push str.D:_D_OICI_GA___BG__D_OICI_GA___AN__A_OICI_GRGWGX___AU__A_OICI_GA___BA_
call sub.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorA
cmp eax, edi
je 0x403c18
cmp dword [0x417f08], edi
jne 0x403aa0
mov eax, dword [0x4172f0]
mov dword [0x417ef8], eax
add eax, 1
mov dword [0x4172f0], eax
mov eax, dword [0x417ee0]
push 0x417ee4
push eax
mov dword [0x417eec], edi
mov dword [0x417ee8], ebp
mov dword [0x417ef0], edi
mov dword [0x417efc], esi
call ebx
cmp eax, edi
jne 0x403aa0
mov edi, 0x413fec
call fcn.004033e0
jmp 0x403b99
mov eax, dword [esp + 0x554]
mov esi, 1
add eax, 0xffffffff
cmp eax, esi
jbe 0x403b09
mov edi, ebp
mov ebp, dword [esp + 0x34]
mov eax, dword [ebp + esi*4]
mov cl, byte [eax]
cmp cl, 0x2d
je 0x403ac9
cmp cl, 0x2f
jne 0x403af5
add eax, 1
push eax
push str.pipe
call fcn.00404cdf
add esp, 8
test eax, eax
jne 0x403af5
cmp edi, dword [esp + 0x554]
jae 0x403af5
mov ecx, dword [ebp + esi*4 + 4]
add esi, 1
add edi, 1
mov dword [esp + 0x10], ecx
mov eax, dword [esp + 0x554]
add esi, 1
add eax, 0xffffffff
add edi, 1
cmp esi, eax
jb 0x403ab5
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x38]
push edx
push 0x3e8
push 0
push 0
push 1
push 6
push 0x40000003
push eax
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeA]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x403b3e
mov edi, str.Unable_to_create_named_pipe
call fcn.004033e0
jmp 0x403b99
xor esi, esi
cmp dword [0x417f08], esi
jne 0x403c31
mov ecx, dword [0x417ee0]
push 0x417ee4
push ecx
mov dword [0x417eec], 1
mov dword [0x417ee8], 4
mov dword [0x417ef0], esi
mov dword [0x417efc], esi
mov dword [0x417ef8], esi
call ebx
cmp eax, esi
jne 0x403c31
mov edi, 0x413fec
call fcn.004033e0
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x417f0c]
test eax, eax
je 0x403ba9
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x403bb8
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x30]
test eax, eax
je 0x403bc9
push eax
call fcn.00404925
add esp, 4
mov eax, dword [0x417f00]
test eax, eax
je 0x403c18
push str.WSRV:
push str._s_____________Log_End_____________n_n
push 0x40000
call fcn.00402f50
mov ecx, dword [0x417f00]
mov eax, dword [ecx + 4]
add esp, 0xc
test eax, eax
je 0x403c0c
cmp dword [eax + 4], 0
je 0x403c0c
mov ecx, dword [eax + 4]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
mov ecx, dword [0x417f00]
test ecx, ecx
je 0x403c18
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
mov ecx, dword [esp + 0x54c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00403e28
add esp, 0x540
ret
mov edi, dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ebx, dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
lea ecx, [ecx]
xor eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x18]
push eax
mov dword [esp + 0x30], eax
call edi
lea edx, [esp + 0x1c]
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x403c8f
push 0xffffffffffffffff
push esi
lea eax, [esp + 0x1c]
push eax
push 2
call ebx
cmp eax, 1
jne 0x403b92
xor eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x18]
push eax
mov dword [esp + 0x30], eax
call edi
push 0x400
lea ecx, [esp + 0x150]
push esi
push ecx
call fcn.0040b210
add esp, 0xc
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x4c]
push eax
push 0x400
lea ecx, [esp + 0x158]
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x403d0a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x403d0a
push 0xffffffffffffffff
push esi
lea edx, [esp + 0x1c]
push edx
push 2
call ebx
cmp eax, 1
jne 0x403b92
mov eax, dword [0x417f00]
cmp eax, esi
je 0x403d6a
lea ecx, [esp + 0x14c]
push ecx
push str.WSRV:
push str._s_InputData:__s_n
push 0x80000
call fcn.00402f50
mov eax, dword [0x417f00]
add esp, 0x10
cmp eax, esi
je 0x403d6a
lea ecx, [esp + 0x14c]
lea esi, [ecx + 1]
mov dl, byte [ecx]
add ecx, 1
test dl, dl
jne 0x403d45
sub ecx, esi
push ecx
push str.WSRV:
push str._s_DataSize_:__d_n
push 0x80000
call fcn.00402f50
add esp, 0x10
xor esi, esi
push 0x100
lea edx, [esp + 0x50]
push esi
push edx
call fcn.0040b210
lea eax, [esp + 0x158]
add esp, 0xc
mov dword [esp + 0x10], esi
lea edx, [eax + 1]
jmp 0x403d90
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x403d90
sub eax, edx
push eax
lea eax, [esp + 0x150]
push eax
lea edx, [esp + 0x18]
lea ecx, [esp + 0x54]
call section..text
xor eax, eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x20]
add esp, 8
push eax
mov dword [esp + 0x30], eax
call edi
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x48]
push edx
push eax
lea ecx, [esp + 0x58]
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x403e16
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x403e16
push 0xffffffffffffffff
push esi
lea edx, [esp + 0x1c]
push edx
push 2
call ebx
cmp eax, 1
jne 0x403b92
push ebp
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
jmp 0x403c40