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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x374
mov eax, dword [0x597fa8]
xor eax, esp
mov dword [esp + 0x370], eax
mov eax, dword [0x5992a4]
push ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
push esi
push edi
xor edi, edi
cmp eax, edi
mov esi, 1
je 0x4bd223
lea ecx, [esp + 0x18]
push ecx
push eax
mov dword [esp + 0x20], 0x30
mov dword [esp + 0x24], 4
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], 0xbb8
mov dword [esp + 0x28], esi
call ebx
call fcn.004acc50
mov dword [esp + 0x50], eax
mov dword [esp + 0x34], 0xc
mov dword [esp + 0x3c], esi
call fcn.004bb610
cmp eax, edi
mov dword [esp + 0x38], eax
je 0x4bd884
lea edx, [esp + 0x160]
push edx
or ebx, 0xffffffff
call fcn.00523650
lea esi, [esp + 0x160]
call fcn.004bb570
mov eax, dword [esp + 0x168]
push eax
push str.createnamedpipe__S_n
call fcn.0048f080
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.0048f080
mov ecx, dword [0x5992a0]
add esp, 4
push ecx
call fcn.004acc90
test eax, eax
jne 0x4bd861
lea esp, [esp]
push 0x59926c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x599284]
test esi, esi
je 0x4bd48d
lea esp, [esp]
mov eax, dword [esi]
test eax, eax
mov dword [0x599284], eax
jne 0x4bd2f0
mov dword [0x599288], eax
push 0x59926c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [esi + 4]
push edx
push str.device_event__08x_n
call fcn.0048f080
mov eax, dword [esi + 4]
add eax, 0xffff7fff
add esp, 8
cmp eax, 5
ja case.0x4bd31d.32773
jmp dword [eax*4 + 0x4bd930]
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.0048f080
add esp, 0xc
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bd31d.32773
push eax
call fcn.004bbc50
jmp case.0x4bd31d.32773
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bd31d.32773
push eax
call fcn.004bb4c0
jmp case.0x4bd31d.32773
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bd31d.32773
push 0x10
add eax, 0x14
push 0x551558
push eax
call fcn.004af0a0
test eax, eax
je 0x4bd3a7
push str.GUID_IO_VOLUME_DISMOUNT_n
call fcn.0048f080
mov eax, dword [esi + 8]
add esp, 4
push eax
call fcn.004bbc50
jmp case.0x4bd31d.32773
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x551568
push eax
call fcn.004af0a0
test eax, eax
je 0x4bd3d4
push str.GUID_IO_VOLUME_DISMOUNT_FAILED_n
call fcn.0048f080
mov ecx, dword [esi + 8]
add esp, 4
push ecx
jmp 0x4bd460
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x551588
push eax
call fcn.004af0a0
test eax, eax
je 0x4bd403
push str.GUID_IO_VOLUME_LOCK_n
call fcn.0048f080
mov edx, dword [esi + 8]
add esp, 4
push edx
call fcn.004bbc50
jmp case.0x4bd31d.32773
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x551598
push eax
call fcn.004af0a0
test eax, eax
je 0x4bd42c
push str.GUID_IO_VOLUME_LOCK_FAILED_n
call fcn.0048f080
mov eax, dword [esi + 8]
add esp, 4
jmp 0x4bd45f
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x5515a8
push eax
call fcn.004af0a0
test eax, eax
je case.0x4bd31d.32773
push str.GUID_IO_VOLUME_UNLOCK_n
call fcn.0048f080
mov ecx, dword [esi + 8]
add esp, 4
push ecx
jmp 0x4bd460
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bd31d.32773
push eax
call fcn.004bbce0
mov edx, dword [esi + 8]
push edx
call fcn.004a4810
push esi
call fcn.004a4810
push 0x59926c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x599284]
test esi, esi
jne 0x4bd2e0
push 0x59926c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x158]
cmp eax, 0x40
jae 0x4bd4b8
mov ecx, dword [0x59929c]
mov dword [esp + eax*4 + 0x58], ecx
add dword [esp + 0x158], 1
jmp 0x4bd4c3
mov dword [esp + 0x15c], 1
mov esi, dword [0x598cd4]
lea esp, [esp]
cmp ebx, 0xffffffff
jne 0x4bd587
cmp dword [0x599184], 6
jb 0x4bd503
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 0x4bd522
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 0x4bd616
push str.connect..._n
call fcn.0048f080
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 0x4bd55e
push ebx
call fcn.004baf80
jmp 0x4bd587
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
jne 0x4bd579
push ebx
call fcn.004baf80
or ebx, 0xffffffff
jmp 0x4bd4d0
cmp eax, 0x218
je 0x4bd587
cmp eax, 0x3e5
jne 0x4bd5f6
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 0x4bd5b9
push str.connected_n
call fcn.0048f080
add esp, 4
push ebx
call fcn.004baf80
or ebx, 0xffffffff
jmp 0x4bd4d0
mov eax, dword [esp + 0x158]
cmp eax, 0x40
jae 0x4bd5e0
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 0x4bd5eb
mov dword [esp + 0x15c], 1
cmp ebx, 0xffffffff
je 0x4bd4d9
jmp 0x4bd63a
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.0048f080
add esp, 8
or ebx, 0xffffffff
jmp 0x4bd62a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.failed_to_createnamedpipe__d_n
call fcn.0048f080
add esp, 8
mov eax, dword [esp + 0x158]
mov edi, 0x3e8
mov dword [esp + 0x14], edi
mov esi, dword [0x59928c]
test esi, esi
je 0x4bd7bc
mov edx, dword [esi + 0x34]
mov edi, dword [esi]
push edx
push str.update_client__d_n
call fcn.0048f080
add esp, 8
push esi
call fcn.004bb760
call fcn.004bcaa0
lea eax, [esp + 0x10]
push eax
mov ecx, esi
call fcn.004bcbe0
cmp dword [esi + 0x38], 0
je 0x4bd69c
mov ecx, dword [esi + 0x34]
push ecx
push str._d:_disconnected._n
call fcn.0048f080
add esp, 8
mov eax, esi
call fcn.004bd060
mov eax, dword [esp + 0x158]
jmp 0x4bd7ae
cmp dword [esi + 0x50], 0
je 0x4bd6ec
cmp dword [esi + 0x58], 0
je 0x4bd6ec
mov edx, dword [esi + 0x34]
push edx
push str.client__d_write_pending_n
call fcn.0048f080
mov eax, dword [esp + 0x160]
add esp, 8
cmp eax, 0x40
jae 0x4bd6df
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 0x4bd6f3
mov dword [esp + 0x15c], 1
jmp 0x4bd6f3
mov eax, dword [esp + 0x158]
cmp eax, 0x40
jae 0x4bd712
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 0x4bd71d
mov dword [esp + 0x15c], 1
xor edx, edx
cmp dword [esi + 0x64], edx
jbe 0x4bd762
mov ecx, dword [esi + 0x60]
mov ecx, dword [ecx + edx*4]
cmp dword [ecx + 0x64], 2
jne 0x4bd75a
cmp eax, 0x40
jae 0x4bd74f
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 0x4bd75a
mov dword [esp + 0x15c], 1
add edx, 1
cmp edx, dword [esi + 0x64]
jb 0x4bd724
xor edx, edx
cmp dword [esi + 0x70], edx
jbe 0x4bd7ae
lea esp, [esp]
mov ecx, dword [esi + 0x6c]
mov ecx, dword [ecx + edx*4]
cmp dword [ecx + 0x6c], 2
jne 0x4bd7a6
cmp eax, 0x40
jae 0x4bd79b
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 0x4bd7a6
mov dword [esp + 0x15c], 1
add edx, 1
cmp edx, dword [esi + 0x70]
jb 0x4bd770
test edi, edi
mov esi, edi
jne 0x4bd648
mov edi, dword [esp + 0x14]
cmp dword [esp + 0x15c], 0
je 0x4bd7d7
test edi, edi
je 0x4bd7d2
cmp edi, 0x3e8
jbe 0x4bd7d7
mov edi, 0x3e8
push edi
push eax
push str.sleep__d__d_n
call fcn.0048f080
xor esi, esi
add esp, 0xc
cmp edi, esi
je 0x4bd7f1
lea eax, [edi + 0x11]
jmp 0x4bd7f4
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 [0x59929c]
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.0048f080
mov edx, dword [0x5992a0]
add esp, 4
push edx
call fcn.004acc90
test eax, eax
je 0x4bd2c0
cmp ebx, 0xffffffff
je 0x4bd861
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.00401210
mov ebx, dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
xor edi, edi
lea esi, [edi + 1]
mov eax, dword [0x5992a4]
cmp eax, edi
je 0x4bd8bd
lea edx, [esp + 0x18]
push edx
push eax
mov dword [esp + 0x20], 0x30
mov dword [esp + 0x24], 3
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], 0xbb8
mov dword [esp + 0x28], esi
call ebx
mov eax, dword [0x59928c]
cmp eax, edi
je 0x4bd8d3
mov esi, dword [eax]
call fcn.004bd060
cmp esi, edi
mov eax, esi
jne 0x4bd8c6
mov eax, dword [esp + 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x5992a4]
cmp eax, edi
je 0x4bd918
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], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], 0xbb8
call ebx
mov ecx, dword [esp + 0x37c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.005498fd
mov esp, ebp
pop ebp
ret