Function at 0x4bc250
Capabilities:
Check for time delay via gettickcount
Connect pipe

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x374
mov eax, dword [0x596f48]
xor eax, esp
mov dword [esp + 0x370], eax
mov eax, dword [0x598228]
push ebx
xor ebx, ebx
cmp eax, ebx
push esi
push edi
je 0x4bc2b0
lea ecx, [esp + 0x18]
push ecx
push eax
mov dword [esp + 0x20], 0x30
mov dword [esp + 0x24], 4
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], 0xbb8
mov dword [esp + 0x28], 1
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
call fcn.004ac4b0
push 0x14
push 0x40
mov dword [esp + 0x58], eax
mov dword [esp + 0x3c], 0xc
mov dword [esp + 0x44], 1
xor edi, edi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
cmp esi, ebx
je 0x4bc302
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x4bc2fb
push ebx
push ebx
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x4bc2fb
mov edi, esi
jmp 0x4bc302
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp edi, ebx
mov dword [esp + 0x38], edi
je 0x4bc93b
lea edx, [esp + 0x160]
push edx
or ebx, 0xffffffff
call fcn.00522730
lea esi, [esp + 0x160]
call fcn.004ba750
mov eax, dword [esp + 0x168]
push eax
push str.createnamedpipe__S_n
call fcn.0048f0a0
xor edi, edi
add esp, 8
mov dword [esp + 0x158], edi
mov dword [esp + 0x15c], edi
mov dword [esp + 0x14], edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push str.awake_n
mov dword [esp + 0x14], eax
call fcn.0048f0a0
mov ecx, dword [0x598224]
add esp, 4
push ecx
call fcn.004ac4f0
test eax, eax
jne 0x4bc921
mov edi, edi
push 0x5981f0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x598208]
test esi, esi
je 0x4bc54d
lea esp, [esp]
mov eax, dword [esi]
test eax, eax
mov dword [0x598208], eax
jne 0x4bc3b0
mov dword [0x59820c], eax
push 0x5981f0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [esi + 4]
push edx
push str.device_event__08x_n
call fcn.0048f0a0
mov eax, dword [esi + 4]
add eax, 0xffff7fff
add esp, 8
cmp eax, 5
ja case.0x4bc3dd.32773
jmp dword [eax*4 + 0x4bc9f0]
mov eax, dword [esi + 8]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
push ecx
push edx
push str.dbch_devicetype__d__dbch_size__d_n
call fcn.0048f0a0
add esp, 0xc
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bc3dd.32773
push eax
call fcn.004bace0
jmp case.0x4bc3dd.32773
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bc3dd.32773
push eax
call fcn.004ba6a0
jmp case.0x4bc3dd.32773
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bc3dd.32773
push 0x10
add eax, 0x14
push 0x55058c
push eax
call fcn.004ae930
test eax, eax
je 0x4bc467
push str.GUID_IO_VOLUME_DISMOUNT_n
call fcn.0048f0a0
mov eax, dword [esi + 8]
add esp, 4
push eax
call fcn.004bace0
jmp case.0x4bc3dd.32773
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x55059c
push eax
call fcn.004ae930
test eax, eax
je 0x4bc494
push str.GUID_IO_VOLUME_DISMOUNT_FAILED_n
call fcn.0048f0a0
mov ecx, dword [esi + 8]
add esp, 4
push ecx
jmp 0x4bc520
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x5505bc
push eax
call fcn.004ae930
test eax, eax
je 0x4bc4c3
push str.GUID_IO_VOLUME_LOCK_n
call fcn.0048f0a0
mov edx, dword [esi + 8]
add esp, 4
push edx
call fcn.004bace0
jmp case.0x4bc3dd.32773
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x5505cc
push eax
call fcn.004ae930
test eax, eax
je 0x4bc4ec
push str.GUID_IO_VOLUME_LOCK_FAILED_n
call fcn.0048f0a0
mov eax, dword [esi + 8]
add esp, 4
jmp 0x4bc51f
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x5505dc
push eax
call fcn.004ae930
test eax, eax
je case.0x4bc3dd.32773
push str.GUID_IO_VOLUME_UNLOCK_n
call fcn.0048f0a0
mov ecx, dword [esi + 8]
add esp, 4
push ecx
jmp 0x4bc520
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bc3dd.32773
push eax
call fcn.004bad70
mov edx, dword [esi + 8]
push edx
call fcn.004a4030
push esi
call fcn.004a4030
push 0x5981f0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x598208]
test esi, esi
jne 0x4bc3a0
push 0x5981f0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x158]
cmp eax, 0x40
jae 0x4bc578
mov ecx, dword [0x598220]
mov dword [esp + eax*4 + 0x58], ecx
add dword [esp + 0x158], 1
jmp 0x4bc583
mov dword [esp + 0x15c], 1
mov esi, dword [0x597c74]
lea esp, [esp]
cmp ebx, 0xffffffff
jne 0x4bc647
cmp dword [0x598120], 6
jb 0x4bc5c3
mov eax, dword [esp + 0x168]
lea edx, [esp + 0x34]
push edx
push 0
push 0
push 0
push 0xff
push 8
push 0x40000003
push eax
jmp 0x4bc5e2
mov edx, dword [esp + 0x168]
lea ecx, [esp + 0x34]
push ecx
push 0
push 0
push 0
push 0xff
push 0
push 0x40000003
push edx
call esi
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4bc6d6
push str.connect..._n
call fcn.0048f0a0
xor eax, eax
add esp, 4
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x40]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
je 0x4bc61e
push ebx
call fcn.004ba160
jmp 0x4bc647
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
jne 0x4bc639
push ebx
call fcn.004ba160
or ebx, 0xffffffff
jmp 0x4bc590
cmp eax, 0x218
je 0x4bc647
cmp eax, 0x3e5
jne 0x4bc6b6
push 0
lea ecx, [esp + 0x58]
push ecx
lea edx, [esp + 0x48]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x4bc679
push str.connected_n
call fcn.0048f0a0
add esp, 4
push ebx
call fcn.004ba160
or ebx, 0xffffffff
jmp 0x4bc590
mov eax, dword [esp + 0x158]
cmp eax, 0x40
jae 0x4bc6a0
mov ecx, dword [esp + 0x50]
mov dword [esp + eax*4 + 0x58], ecx
mov eax, dword [esp + 0x158]
add eax, 1
mov dword [esp + 0x158], eax
jmp 0x4bc6ab
mov dword [esp + 0x15c], 1
cmp ebx, 0xffffffff
je 0x4bc599
jmp 0x4bc6fa
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.connect_named_pipe_failed__d_n
call fcn.0048f0a0
add esp, 8
or ebx, 0xffffffff
jmp 0x4bc6ea
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.failed_to_createnamedpipe__d_n
call fcn.0048f0a0
add esp, 8
mov eax, dword [esp + 0x158]
mov edi, 0x3e8
mov dword [esp + 0x14], edi
mov esi, dword [0x598210]
test esi, esi
je 0x4bc87c
mov edx, dword [esi + 0x34]
mov edi, dword [esi]
push edx
push str.update_client__d_n
call fcn.0048f0a0
add esp, 8
push esi
call fcn.004ba7f0
call fcn.004bbb30
lea eax, [esp + 0x10]
push eax
mov ecx, esi
call fcn.004bbc70
cmp dword [esi + 0x38], 0
je 0x4bc75c
mov ecx, dword [esi + 0x34]
push ecx
push str._d:_disconnected._n
call fcn.0048f0a0
add esp, 8
mov eax, esi
call fcn.004bc0f0
mov eax, dword [esp + 0x158]
jmp 0x4bc86e
cmp dword [esi + 0x50], 0
je 0x4bc7ac
cmp dword [esi + 0x58], 0
je 0x4bc7ac
mov edx, dword [esi + 0x34]
push edx
push str.client__d_write_pending_n
call fcn.0048f0a0
mov eax, dword [esp + 0x160]
add esp, 8
cmp eax, 0x40
jae 0x4bc79f
mov ecx, dword [esi + 0x2c]
mov dword [esp + eax*4 + 0x58], ecx
mov eax, dword [esp + 0x158]
add eax, 1
mov dword [esp + 0x158], eax
jmp 0x4bc7b3
mov dword [esp + 0x15c], 1
jmp 0x4bc7b3
mov eax, dword [esp + 0x158]
cmp eax, 0x40
jae 0x4bc7d2
mov edx, dword [esi + 0x18]
mov dword [esp + eax*4 + 0x58], edx
mov eax, dword [esp + 0x158]
add eax, 1
mov dword [esp + 0x158], eax
jmp 0x4bc7dd
mov dword [esp + 0x15c], 1
xor edx, edx
cmp dword [esi + 0x64], edx
jbe 0x4bc822
mov ecx, dword [esi + 0x60]
mov ecx, dword [ecx + edx*4]
cmp dword [ecx + 0x64], 2
jne 0x4bc81a
cmp eax, 0x40
jae 0x4bc80f
mov ecx, dword [ecx + 0x5c]
mov dword [esp + eax*4 + 0x58], ecx
mov eax, dword [esp + 0x158]
add eax, 1
mov dword [esp + 0x158], eax
jmp 0x4bc81a
mov dword [esp + 0x15c], 1
add edx, 1
cmp edx, dword [esi + 0x64]
jb 0x4bc7e4
xor edx, edx
cmp dword [esi + 0x70], edx
jbe 0x4bc86e
lea esp, [esp]
mov ecx, dword [esi + 0x6c]
mov ecx, dword [ecx + edx*4]
cmp dword [ecx + 0x6c], 2
jne 0x4bc866
cmp eax, 0x40
jae 0x4bc85b
mov ecx, dword [ecx + 0x64]
mov dword [esp + eax*4 + 0x58], ecx
mov eax, dword [esp + 0x158]
add eax, 1
mov dword [esp + 0x158], eax
jmp 0x4bc866
mov dword [esp + 0x15c], 1
add edx, 1
cmp edx, dword [esi + 0x70]
jb 0x4bc830
test edi, edi
mov esi, edi
jne 0x4bc708
mov edi, dword [esp + 0x14]
cmp dword [esp + 0x15c], 0
je 0x4bc897
test edi, edi
je 0x4bc892
cmp edi, 0x3e8
jbe 0x4bc897
mov edi, 0x3e8
push edi
push eax
push str.sleep__d__d_n
call fcn.0048f0a0
xor esi, esi
add esp, 0xc
cmp edi, esi
je 0x4bc8b1
lea eax, [edi + 0x11]
jmp 0x4bc8b4
or eax, 0xffffffff
push eax
mov eax, dword [esp + 0x15c]
push esi
lea edx, [esp + 0x60]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov ecx, dword [0x598220]
push ecx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
xor edi, edi
mov dword [esp + 0x158], esi
mov dword [esp + 0x15c], esi
mov dword [esp + 0x14], edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push str.awake_n
mov dword [esp + 0x14], eax
call fcn.0048f0a0
mov edx, dword [0x598224]
add esp, 4
push edx
call fcn.004ac4f0
test eax, eax
je 0x4bc380
cmp ebx, 0xffffffff
je 0x4bc921
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [esp + 0x160]
push ecx
call fcn.00401260
xor ebx, ebx
mov eax, dword [0x598228]
cmp eax, ebx
je 0x4bc97c
lea edx, [esp + 0x18]
push edx
push eax
mov dword [esp + 0x20], 0x30
mov dword [esp + 0x24], 3
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], 0xbb8
mov dword [esp + 0x28], 1
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
mov eax, dword [0x598210]
cmp eax, ebx
je 0x4bc992
mov esi, dword [eax]
call fcn.004bc0f0
cmp esi, ebx
mov eax, esi
jne 0x4bc985
mov eax, dword [esp + 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x598228]
cmp eax, ebx
je 0x4bc9db
mov ecx, 1
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], ecx
lea ecx, [esp + 0x18]
push ecx
push eax
mov dword [esp + 0x20], 0x30
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], 0xbb8
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
mov ecx, dword [esp + 0x37c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0054899c
mov esp, ebp
pop ebp
ret