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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4446c6
mov eax, dword fs:[0]
push eax
sub esp, 0x180
mov eax, dword [0x454670]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
xor edi, edi
cmp esi, edi
je 0x40674b
mov eax, 0xf
mov dword [ebp - 0x138], eax
mov dword [ebp - 0x13c], edi
mov byte [ebp - 0x14c], 0
push 0x11
push str.UninstallService_
lea ecx, [ebp - 0x168]
mov dword [ebp - 4], edi
mov dword [ebp - 0x154], eax
mov dword [ebp - 0x158], edi
mov byte [ebp - 0x168], 0
call fcn.00401253
mov eax, esi
mov byte [ebp - 4], 1
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406014
sub eax, edx
push eax
push esi
lea ecx, [ebp - 0x168]
call fcn.0040181b
push 3
push 0x44b07c
lea ecx, [ebp - 0x168]
call fcn.0040181b
push 0x100
lea eax, [ebp - 0x130]
push edi
push eax
call fcn.0041b8c0
add esp, 0xc
push 0xf003f
push edi
push edi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebx, eax
mov dword [ebp - 0x18c], ebx
cmp ebx, edi
jne 0x40617b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x100
lea ecx, [ebp - 0x130]
mov esi, eax
push ecx
push esi
call fcn.0040171c
push eax
push str.OpenSCManager_failed____s_n
call fcn.0041bb3b
push esi
lea edx, [ebp - 0x30]
push 0x44b058
push edx
call fcn.0041b190
mov edx, dword [ebp - 0x168]
mov ebx, 0x10
add esp, 0x20
cmp dword [ebp - 0x154], ebx
jae 0x4060be
lea edx, [ebp - 0x168]
mov eax, edx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4060c3
sub eax, esi
push eax
push edx
lea ecx, [ebp - 0x14c]
call fcn.00401253
push 0x20
push str.OpenSCManager_FAILED_with_ErrNo
lea ecx, [ebp - 0x14c]
call fcn.0040181b
lea eax, [ebp - 0x30]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4060f1
sub eax, edx
push eax
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov eax, dword [ebp - 0x14c]
cmp dword [ebp - 0x138], ebx
jae 0x40611e
lea eax, [ebp - 0x14c]
push edi
push eax
push str.UtlSvrHelp
call fcn.00401875
add esp, 0xc
cmp dword [ebp - 0x154], ebx
jb 0x406144
mov ecx, dword [ebp - 0x168]
push ecx
call fcn.0041a6fe
add esp, 4
mov dword [ebp - 0x154], 0xf
mov dword [ebp - 0x158], edi
mov byte [ebp - 0x168], 0
cmp dword [ebp - 0x138], ebx
jb 0x40674b
mov edx, dword [ebp - 0x14c]
push edx
call fcn.0041a6fe
add esp, 4
jmp 0x40674b
push 0xf01ff
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [ebp - 0x188], eax
cmp eax, edi
jne 0x4062de
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push 0x100
lea eax, [ebp - 0x130]
push eax
push edi
call fcn.0040171c
push eax
push esi
push str.OpenService__s__failed____s_n
call fcn.0041bb3b
push edi
lea ecx, [ebp - 0x30]
push 0x44b058
push ecx
call fcn.0041b190
mov edx, dword [ebp - 0x168]
add esp, 0x24
cmp dword [ebp - 0x154], 0x10
jae 0x4061e3
lea edx, [ebp - 0x168]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4061e8
sub eax, edi
push eax
push edx
lea ecx, [ebp - 0x14c]
call fcn.00401253
push 0xc
push str.OpenService_
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406215
sub eax, edx
push eax
push esi
lea ecx, [ebp - 0x14c]
call fcn.0040181b
push 0x14
push str.__FAILED_with_ErrNo
lea ecx, [ebp - 0x14c]
call fcn.0040181b
lea eax, [ebp - 0x30]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406243
sub eax, edx
push eax
lea edx, [ebp - 0x30]
push edx
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov eax, dword [ebp - 0x14c]
mov esi, 0x10
cmp dword [ebp - 0x138], esi
jae 0x406275
lea eax, [ebp - 0x14c]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401875
add esp, 0xc
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [ebp - 0x154], esi
jb 0x4062a3
mov eax, dword [ebp - 0x168]
push eax
call fcn.0041a6fe
add esp, 4
mov dword [ebp - 0x154], 0xf
mov dword [ebp - 0x158], 0
mov byte [ebp - 0x168], 0
cmp dword [ebp - 0x138], esi
jb 0x40674b
mov ecx, dword [ebp - 0x14c]
push ecx
call fcn.0041a6fe
add esp, 4
jmp 0x40674b
lea edx, [ebp - 0x184]
push edx
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x4063ef
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push 0x100
lea eax, [ebp - 0x130]
push eax
push edi
call fcn.0040171c
push eax
push esi
push str.ControlService_try_to_stop__s__failed____s_n
call fcn.0041bb3b
push edi
lea ecx, [ebp - 0x30]
push 0x44b058
push ecx
call fcn.0041b190
mov edx, dword [ebp - 0x168]
mov ebx, 0x10
add esp, 0x24
cmp dword [ebp - 0x154], ebx
jae 0x406347
lea edx, [ebp - 0x168]
mov eax, edx
lea edi, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406350
sub eax, edi
push eax
push edx
lea ecx, [ebp - 0x14c]
call fcn.00401253
push 0x14
push str.ControlService_stop
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov eax, esi
lea ecx, [eax + 1]
lea ecx, [ecx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x406380
sub eax, ecx
push eax
push esi
lea ecx, [ebp - 0x14c]
call fcn.0040181b
push 0x14
push str.__FAILED_with_ErrNo
lea ecx, [ebp - 0x14c]
call fcn.0040181b
lea eax, [ebp - 0x30]
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4063b0
sub eax, edx
push eax
lea edx, [ebp - 0x30]
push edx
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov eax, dword [ebp - 0x14c]
cmp dword [ebp - 0x138], ebx
jae 0x4063dd
lea eax, [ebp - 0x14c]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401875
jmp 0x406553
push esi
push str.Stopping__s.
call fcn.0041bb3b
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 8
push 0x3e8
call edi
mov ecx, dword [ebp - 0x188]
mov ebx, dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
lea eax, [ebp - 0x184]
push eax
push ecx
call ebx
test eax, eax
je 0x406455
cmp dword [ebp - 0x180], 3
jne 0x406455
push 0x44b140
call fcn.0041bb3b
add esp, 4
push 0x3e8
call edi
mov eax, dword [ebp - 0x188]
lea edx, [ebp - 0x184]
push edx
push eax
call ebx
test eax, eax
jne 0x406424
cmp dword [ebp - 0x180], 1
push esi
jne 0x4064a9
push str._n_s_stopped._n
call fcn.0041bb3b
mov eax, dword [ebp - 0x168]
mov ebx, 0x10
add esp, 8
cmp dword [ebp - 0x154], ebx
jae 0x406485
lea eax, [ebp - 0x168]
push eax
lea ecx, [ebp - 0x14c]
call fcn.0040134d
push esi
lea ecx, [ebp - 0x14c]
call fcn.00401645
push 9
push str._stopped.
jmp 0x4063be
push str._n_s_failed_to_stop._n
call fcn.0041bb3b
mov eax, dword [ebp - 0x168]
mov edi, 0x10
add esp, 8
cmp dword [ebp - 0x154], edi
jae 0x4064cf
lea eax, [ebp - 0x168]
push eax
lea ecx, [ebp - 0x14c]
call fcn.0040134d
push esi
lea ecx, [ebp - 0x14c]
call fcn.00401645
push 0x1d
push str._failed_to_stop_with_status:
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov ecx, dword [ebp - 0x180]
push ecx
lea edx, [ebp - 0x30]
push 0x44b058
push edx
call fcn.0041b190
lea eax, [ebp - 0x30]
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406517
sub eax, edx
push eax
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov eax, dword [ebp - 0x14c]
cmp dword [ebp - 0x138], edi
jae 0x406544
lea eax, [ebp - 0x14c]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401875
mov ebx, edi
mov ecx, dword [ebp - 0x188]
add esp, 0xc
push ecx
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x406634
push esi
push str._s_removed._n
call fcn.0041bb3b
mov edx, dword [ebp - 0x168]
add esp, 8
cmp dword [ebp - 0x154], ebx
jae 0x40658d
lea edx, [ebp - 0x168]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406592
sub eax, edi
push eax
push edx
lea ecx, [ebp - 0x14c]
call fcn.00401253
mov eax, esi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4065b0
sub eax, edx
push eax
push esi
lea ecx, [ebp - 0x14c]
call fcn.0040181b
push 9
push str._removed.
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov eax, dword [ebp - 0x14c]
cmp dword [ebp - 0x138], ebx
jae 0x4065ec
lea eax, [ebp - 0x14c]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401875
mov edx, dword [ebp - 0x188]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
add esp, 0xc
push edx
call esi
mov eax, dword [ebp - 0x18c]
push eax
call esi
lea ecx, [ebp - 0x168]
call fcn.004016db
lea ecx, [ebp - 0x14c]
call fcn.004016db
mov eax, 1
jmp 0x40674d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x100
lea ecx, [ebp - 0x130]
mov edi, eax
push ecx
push edi
call fcn.0040171c
push eax
push str.DeleteService_failed____s_n
call fcn.0041bb3b
push edi
lea edx, [ebp - 0x30]
push 0x44b058
push edx
call fcn.0041b190
mov edx, dword [ebp - 0x168]
add esp, 0x20
cmp dword [ebp - 0x154], ebx
jae 0x40667f
lea edx, [ebp - 0x168]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406684
sub eax, edi
push eax
push edx
lea ecx, [ebp - 0x14c]
call fcn.00401253
push 0xe
push str.DeleteService_
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4066b1
sub eax, edx
push eax
push esi
lea ecx, [ebp - 0x14c]
call fcn.0040181b
push 0x14
push str.__FAILED_with_ErrNo
lea ecx, [ebp - 0x14c]
call fcn.0040181b
lea eax, [ebp - 0x30]
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4066e0
sub eax, edx
push eax
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0x14c]
call fcn.0040181b
mov eax, dword [ebp - 0x14c]
cmp dword [ebp - 0x138], ebx
jae 0x40670d
lea eax, [ebp - 0x14c]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401875
mov ecx, dword [ebp - 0x188]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
add esp, 0xc
push ecx
call esi
mov edx, dword [ebp - 0x18c]
push edx
call esi
lea ecx, [ebp - 0x168]
call fcn.004016db
lea ecx, [ebp - 0x14c]
call fcn.004016db
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0041b181
mov esp, ebp
pop ebp
ret