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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x374
mov eax, dword [0x597f98]
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 0x4bd263
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.004acc70
mov dword [esp + 0x50], eax
mov dword [esp + 0x34], 0xc
mov dword [esp + 0x3c], esi
call fcn.004bb650
cmp eax, edi
mov dword [esp + 0x38], eax
je 0x4bd8c4
lea edx, [esp + 0x160]
push edx
or ebx, 0xffffffff
call fcn.00401210
lea esi, [esp + 0x160]
call fcn.004bb5b0
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 [0x5992a0]
add esp, 4
push ecx
call fcn.004accb0
test eax, eax
jne 0x4bd8a1
lea esp, [esp]
push 0x59926c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x599284]
test esi, esi
je 0x4bd4cd
lea esp, [esp]
mov eax, dword [esi]
test eax, eax
mov dword [0x599284], eax
jne 0x4bd330
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.0048f0a0
mov eax, dword [esi + 4]
add eax, 0xffff7fff
add esp, 8
cmp eax, 5
ja case.0x4bd35d.32773
jmp dword [eax*4 + 0x4bd970]
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.0x4bd35d.32773
push eax
call fcn.004bbc90
jmp case.0x4bd35d.32773
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bd35d.32773
push eax
call fcn.004bb500
jmp case.0x4bd35d.32773
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bd35d.32773
push 0x10
add eax, 0x14
push 0x551558
push eax
call fcn.004af0e0
test eax, eax
je 0x4bd3e7
push str.GUID_IO_VOLUME_DISMOUNT_n
call fcn.0048f0a0
mov eax, dword [esi + 8]
add esp, 4
push eax
call fcn.004bbc90
jmp case.0x4bd35d.32773
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x551568
push eax
call fcn.004af0e0
test eax, eax
je 0x4bd414
push str.GUID_IO_VOLUME_DISMOUNT_FAILED_n
call fcn.0048f0a0
mov ecx, dword [esi + 8]
add esp, 4
push ecx
jmp 0x4bd4a0
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x551588
push eax
call fcn.004af0e0
test eax, eax
je 0x4bd443
push str.GUID_IO_VOLUME_LOCK_n
call fcn.0048f0a0
mov edx, dword [esi + 8]
add esp, 4
push edx
call fcn.004bbc90
jmp case.0x4bd35d.32773
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x551598
push eax
call fcn.004af0e0
test eax, eax
je 0x4bd46c
push str.GUID_IO_VOLUME_LOCK_FAILED_n
call fcn.0048f0a0
mov eax, dword [esi + 8]
add esp, 4
jmp 0x4bd49f
mov eax, dword [esi + 8]
push 0x10
add eax, 0x14
push 0x5515a8
push eax
call fcn.004af0e0
test eax, eax
je case.0x4bd35d.32773
push str.GUID_IO_VOLUME_UNLOCK_n
call fcn.0048f0a0
mov ecx, dword [esi + 8]
add esp, 4
push ecx
jmp 0x4bd4a0
mov eax, dword [esi + 8]
cmp dword [eax + 4], 6
jne case.0x4bd35d.32773
push eax
call fcn.004bbd20
mov edx, dword [esi + 8]
push edx
call fcn.004a4850
push esi
call fcn.004a4850
push 0x59926c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x599284]
test esi, esi
jne 0x4bd320
push 0x59926c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x158]
cmp eax, 0x40
jae 0x4bd4f8
mov ecx, dword [0x59929c]
mov dword [esp + eax*4 + 0x58], ecx
add dword [esp + 0x158], 1
jmp 0x4bd503
mov dword [esp + 0x15c], 1
mov esi, dword [0x598cc4]
lea esp, [esp]
cmp ebx, 0xffffffff
jne 0x4bd5c7
cmp dword [0x599184], 6
jb 0x4bd543
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 0x4bd562
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 0x4bd656
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 0x4bd59e
push ebx
call fcn.004bafc0
jmp 0x4bd5c7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x217
jne 0x4bd5b9
push ebx
call fcn.004bafc0
or ebx, 0xffffffff
jmp 0x4bd510
cmp eax, 0x218
je 0x4bd5c7
cmp eax, 0x3e5
jne 0x4bd636
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 0x4bd5f9
push str.connected_n
call fcn.0048f0a0
add esp, 4
push ebx
call fcn.004bafc0
or ebx, 0xffffffff
jmp 0x4bd510
mov eax, dword [esp + 0x158]
cmp eax, 0x40
jae 0x4bd620
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 0x4bd62b
mov dword [esp + 0x15c], 1
cmp ebx, 0xffffffff
je 0x4bd519
jmp 0x4bd67a
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 0x4bd66a
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 [0x59928c]
test esi, esi
je 0x4bd7fc
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.004bb7a0
call fcn.004bcae0
lea eax, [esp + 0x10]
push eax
mov ecx, esi
call fcn.004bcc20
cmp dword [esi + 0x38], 0
je 0x4bd6dc
mov ecx, dword [esi + 0x34]
push ecx
push str._d:_disconnected._n
call fcn.0048f0a0
add esp, 8
mov eax, esi
call fcn.004bd0a0
mov eax, dword [esp + 0x158]
jmp 0x4bd7ee
cmp dword [esi + 0x50], 0
je 0x4bd72c
cmp dword [esi + 0x58], 0
je 0x4bd72c
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 0x4bd71f
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 0x4bd733
mov dword [esp + 0x15c], 1
jmp 0x4bd733
mov eax, dword [esp + 0x158]
cmp eax, 0x40
jae 0x4bd752
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 0x4bd75d
mov dword [esp + 0x15c], 1
xor edx, edx
cmp dword [esi + 0x64], edx
jbe 0x4bd7a2
mov ecx, dword [esi + 0x60]
mov ecx, dword [ecx + edx*4]
cmp dword [ecx + 0x64], 2
jne 0x4bd79a
cmp eax, 0x40
jae 0x4bd78f
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 0x4bd79a
mov dword [esp + 0x15c], 1
add edx, 1
cmp edx, dword [esi + 0x64]
jb 0x4bd764
xor edx, edx
cmp dword [esi + 0x70], edx
jbe 0x4bd7ee
lea esp, [esp]
mov ecx, dword [esi + 0x6c]
mov ecx, dword [ecx + edx*4]
cmp dword [ecx + 0x6c], 2
jne 0x4bd7e6
cmp eax, 0x40
jae 0x4bd7db
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 0x4bd7e6
mov dword [esp + 0x15c], 1
add edx, 1
cmp edx, dword [esi + 0x70]
jb 0x4bd7b0
test edi, edi
mov esi, edi
jne 0x4bd688
mov edi, dword [esp + 0x14]
cmp dword [esp + 0x15c], 0
je 0x4bd817
test edi, edi
je 0x4bd812
cmp edi, 0x3e8
jbe 0x4bd817
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 0x4bd831
lea eax, [edi + 0x11]
jmp 0x4bd834
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.0048f0a0
mov edx, dword [0x5992a0]
add esp, 4
push edx
call fcn.004accb0
test eax, eax
je 0x4bd300
cmp ebx, 0xffffffff
je 0x4bd8a1
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.00401230
mov ebx, dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
xor edi, edi
lea esi, [edi + 1]
mov eax, dword [0x5992a4]
cmp eax, edi
je 0x4bd8fd
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 0x4bd913
mov esi, dword [eax]
call fcn.004bd0a0
cmp esi, edi
mov eax, esi
jne 0x4bd906
mov eax, dword [esp + 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x5992a4]
cmp eax, edi
je 0x4bd958
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.005498cd
mov esp, ebp
pop ebp
ret