Function at 0x401870
Capabilities:
Delete service
Query service status
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
cmp dword [ebp + 8], 1
push esi
jle 0x401b46
mov esi, dword [ebp + 0xc]
mov ecx, dword [esi + 4]
movzx eax, word [ecx]
cmp eax, 0x2d
je 0x401898
cmp eax, 0x2f
jne 0x401b46
lea eax, [ecx + 2]
push eax
push str.installauto
call fcn.00406c52
add esp, 8
test eax, eax
jne 0x4018bc
push 1
call fcn.00401000
add esp, 4
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 4]
add eax, 2
push eax
push str.installmanual
call fcn.00406c52
add esp, 8
test eax, eax
jne 0x4018e2
push eax
call fcn.00401000
add esp, 4
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 4]
add eax, 2
push eax
push str.remove
call fcn.00406c52
add esp, 8
test eax, eax
jne 0x401a8c
push ebx
push 1
xor esi, esi
push esi
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
mov dword [ebp + 8], ebx
test ebx, ebx
jne 0x40194c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp esi, 5
jne 0x401936
push str.Permission_denied__please_run_as_Administor._n
call fcn.00401b90
add esp, 4
mov eax, esi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret
push esi
push str.OpenSCManager_failed____u_n
call fcn.00401b90
add esp, 8
mov eax, esi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret
push edi
push 0x10024
push str.DshowMonSvc
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edi, eax
test edi, edi
jne 0x4019b0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp esi, 5
jne 0x401990
push str.Permission_denied__please_run_as_Administor._n
call fcn.00401b90
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
add esp, 4
push ebx
call edi
pop edi
pop ebx
mov eax, esi
pop esi
mov esp, ebp
pop ebp
ret
push esi
push str.OpenService_failed____u_n
call fcn.00401b90
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
add esp, 8
push ebx
call edi
pop edi
pop ebx
mov eax, esi
pop esi
mov esp, ebp
pop ebp
ret
push 0x4227f4
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x401a49
push str.DshowMonSvc
push str.Stopping__s.
call fcn.00401b90
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 8
push 0x1f4
call ebx
push 0x4227f4
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x401a23
mov eax, dword [0x4227f8]
cmp eax, 3
jne 0x401a28
push 0x4134a0
call fcn.00401b90
add esp, 4
push 0x1f4
call ebx
push 0x4227f4
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x4019f5
mov eax, dword [0x4227f8]
push str.DshowMonSvc
cmp eax, 1
jne 0x401a39
push 0x4134a4
jmp 0x401a3e
push str._n_s_failed_to_stop._n
call fcn.00401b90
mov ebx, dword [ebp + 8]
add esp, 8
push edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x401a68
push str.DshowMonSvc
push str._s_removed._n
call fcn.00401b90
add esp, 8
jmp 0x401a77
push str.DeleteService_failed____u_n
call fcn.004012f0
add esp, 4
mov esi, eax
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call edi
push ebx
call edi
pop edi
pop ebx
mov eax, esi
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 4]
add eax, 2
push eax
push str.debug
call fcn.00406c52
add esp, 8
test eax, eax
jne 0x401ad4
push eax
push eax
push 1
push eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
push 1
push 0x401170
mov dword [0x422810], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
push dword [0x422810]
call fcn.00401650
add esp, 4
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 4]
add eax, 2
push eax
push str.work
call fcn.00406c52
add esp, 8
test eax, eax
jne 0x401b0b
push str.Global4C9E70AB_2894_4EA9_AB31_9CBE60CA1A34
push eax
push 0x1f0003
call dword [sym.imp.KERNEL32.dll_OpenEventW]
push eax
call fcn.00401650
add esp, 4
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 4]
add eax, 2
push eax
push str.service
call fcn.00406c52
add esp, 8
test eax, eax
jne 0x401b46
mov dword [ebp - 8], eax
mov dword [ebp - 4], eax
lea eax, [ebp - 0x10]
push eax
mov dword [ebp - 0x10], str.DshowMonSvc
mov dword [ebp - 0xc], 0x401440
call dword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
pop esi
mov esp, ebp
pop ebp
ret
push str.dshowmonsvc
push str._s__installauto_tto_install_the_service__Auto_Start__n
call fcn.00401b90
push str.dshowmonsvc
push str._s__installmanual_tto_install_the_service__Manual_Start__n
call fcn.00401b90
push str.dshowmonsvc
push str._s__remove_tto_remove_the_service_n
call fcn.00401b90
push str.dshowmonsvc
push str._s__debug_tto_run_as_a_console_app_for_debugging_n
call fcn.00401b90
add esp, 0x20
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret