Function at 0x4040f0
Capabilities:
Delete service
Query service status
Resolve function by parsing pe exports
Stop service

Disassembly:
jmp 0x4040f0
push 0xffffffffffffffff
push 0x434426
mov eax, dword fs:[0]
push eax
sub esp, 0x17c
mov eax, dword [0x43f1c0]
xor eax, esp
mov dword [esp + 0x178], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x43f1c0]
xor eax, esp
push eax
lea eax, [esp + 0x190]
mov dword fs:[0], eax
mov esi, dword [esp + 0x1a0]
xor edi, edi
cmp esi, edi
je 0x404763
mov eax, 0xf
mov dword [esp + 0x4c], eax
mov dword [esp + 0x48], edi
mov byte [esp + 0x38], 0
push 0x11
push str.UninstallService_
lea ecx, [esp + 0x58]
mov dword [esp + 0x1a0], edi
mov dword [esp + 0x70], eax
mov dword [esp + 0x6c], edi
mov byte [esp + 0x5c], 0
call fcn.0040108c
mov eax, esi
mov byte [esp + 0x198], 1
lea edx, [eax + 1]
nop
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x404180
sub eax, edx
push eax
push esi
lea ecx, [esp + 0x58]
call fcn.004011f4
push 3
push 0x438814
lea ecx, [esp + 0x58]
call fcn.004011f4
push 0x100
lea eax, [esp + 0x90]
push edi
push eax
call fcn.0040d630
add esp, 0xc
push 0xf003f
push edi
push edi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebp, eax
cmp ebp, edi
mov dword [esp + 0x14], ebp
jne 0x4042d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x100
lea ecx, [esp + 0x90]
mov esi, eax
push ecx
push esi
call fcn.00401195
push eax
push str.OpenSCManager_failed____s_n
call fcn.0040d70b
push esi
lea edx, [esp + 0x84]
push 0x4387f0
push edx
call fcn.0040c979
mov edx, dword [esp + 0x74]
mov ebx, 0x10
add esp, 0x20
cmp dword [esp + 0x68], ebx
jae 0x404226
lea edx, [esp + 0x54]
mov eax, edx
lea esi, [eax + 1]
jmp 0x404230
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x404230
sub eax, esi
push eax
push edx
lea ecx, [esp + 0x3c]
call fcn.0040108c
push 0x20
push str.OpenSCManager_FAILED_with_ErrNo
lea ecx, [esp + 0x3c]
call fcn.004011f4
lea eax, [esp + 0x6c]
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x404260
sub eax, edx
push eax
lea eax, [esp + 0x70]
push eax
lea ecx, [esp + 0x3c]
call fcn.004011f4
cmp dword [esp + 0x4c], ebx
mov eax, dword [esp + 0x38]
jae 0x404288
lea eax, [esp + 0x38]
push edi
push eax
push str.UtlSvrHelp
call fcn.00401217
add esp, 0xc
cmp dword [esp + 0x68], ebx
jb 0x4042aa
mov ecx, dword [esp + 0x54]
push ecx
call fcn.0040c526
add esp, 4
cmp dword [esp + 0x4c], ebx
mov dword [esp + 0x68], 0xf
mov dword [esp + 0x64], edi
mov byte [esp + 0x54], 0
jb 0x404763
mov edx, dword [esp + 0x38]
push edx
call fcn.0040c526
add esp, 4
jmp 0x404763
push 0xf01ff
push esi
push ebp
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov ebx, eax
cmp ebx, edi
jne 0x404423
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push 0x100
lea eax, [esp + 0x90]
push eax
push edi
call fcn.00401195
push eax
push esi
push str.OpenService__s__failed____s_n
call fcn.0040d70b
push edi
lea ecx, [esp + 0x88]
push 0x4387f0
push ecx
call fcn.0040c979
mov edx, dword [esp + 0x78]
mov ebx, 0x10
add esp, 0x24
cmp dword [esp + 0x68], ebx
jae 0x40433e
lea edx, [esp + 0x54]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x404343
sub eax, edi
push eax
push edx
lea ecx, [esp + 0x3c]
call fcn.0040108c
push 0xc
push str.OpenService_
lea ecx, [esp + 0x3c]
call fcn.004011f4
mov eax, esi
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x404370
sub eax, edx
push eax
push esi
lea ecx, [esp + 0x3c]
call fcn.004011f4
push 0x14
push str.__FAILED_with_ErrNo
lea ecx, [esp + 0x3c]
call fcn.004011f4
lea eax, [esp + 0x6c]
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4043a0
sub eax, edx
push eax
lea edx, [esp + 0x70]
push edx
lea ecx, [esp + 0x3c]
call fcn.004011f4
cmp dword [esp + 0x4c], ebx
mov eax, dword [esp + 0x38]
jae 0x4043c8
lea eax, [esp + 0x38]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401217
add esp, 0xc
push ebp
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [esp + 0x68], ebx
jb 0x4043f2
mov eax, dword [esp + 0x54]
push eax
call fcn.0040c526
add esp, 4
cmp dword [esp + 0x4c], ebx
mov dword [esp + 0x68], 0xf
mov dword [esp + 0x64], 0
mov byte [esp + 0x54], 0
jb 0x404763
mov ecx, dword [esp + 0x38]
push ecx
call fcn.0040c526
add esp, 4
jmp 0x404763
lea edx, [esp + 0x18]
push edx
push 1
push ebx
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x4044e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push 0x100
lea eax, [esp + 0x90]
push eax
push edi
call fcn.00401195
push eax
push esi
push str.ControlService_try_to_stop__s__failed____s_n
call fcn.0040d70b
push edi
lea ecx, [esp + 0x88]
push 0x4387f0
push ecx
call fcn.0040c979
mov eax, dword [esp + 0x78]
mov edi, 0x10
add esp, 0x24
cmp dword [esp + 0x68], edi
jae 0x404489
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x38]
call fcn.004010b9
push str.ControlService_stop
lea ecx, [esp + 0x38]
call fcn.0040114a
push esi
lea ecx, [esp + 0x38]
call fcn.0040114a
push str.__FAILED_with_ErrNo
lea ecx, [esp + 0x38]
call fcn.0040114a
lea edx, [esp + 0x6c]
push edx
lea ecx, [esp + 0x38]
call fcn.0040114a
cmp dword [esp + 0x4c], edi
mov eax, dword [esp + 0x38]
jae 0x4044d5
lea eax, [esp + 0x38]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401217
jmp 0x404604
push esi
push str.Stopping__s.
call fcn.0040d70b
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 8
push 0x3e8
call edi
mov ebp, dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
lea eax, [esp + 0x18]
push eax
push ebx
call ebp
test eax, eax
je 0x40453b
cmp dword [esp + 0x1c], 3
jne 0x40453b
push 0x4388d8
call fcn.0040d70b
add esp, 4
push 0x3e8
call edi
lea ecx, [esp + 0x18]
push ecx
push ebx
call ebp
test eax, eax
jne 0x404514
cmp dword [esp + 0x1c], 1
push esi
jne 0x40457e
push str._n_s_stopped._n
call fcn.0040d70b
mov eax, dword [esp + 0x5c]
mov edi, 0x10
add esp, 8
cmp dword [esp + 0x68], edi
jae 0x404563
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x38]
call fcn.004010b9
push esi
lea ecx, [esp + 0x38]
call fcn.0040114a
push str._stopped.
jmp 0x4045dc
push str._n_s_failed_to_stop._n
call fcn.0040d70b
mov eax, dword [esp + 0x5c]
mov edi, 0x10
add esp, 8
cmp dword [esp + 0x68], edi
jae 0x40459e
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x38]
call fcn.004010b9
push esi
lea ecx, [esp + 0x38]
call fcn.0040114a
push str._failed_to_stop_with_status:
lea ecx, [esp + 0x38]
call fcn.0040114a
mov edx, dword [esp + 0x1c]
push edx
lea eax, [esp + 0x70]
push 0x4387f0
push eax
call fcn.0040c979
add esp, 0xc
lea ecx, [esp + 0x6c]
push ecx
lea ecx, [esp + 0x38]
call fcn.0040114a
cmp dword [esp + 0x4c], edi
mov eax, dword [esp + 0x38]
jae 0x4045f3
lea eax, [esp + 0x38]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401217
mov ebp, dword [esp + 0x20]
add esp, 0xc
push ebx
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x40469a
push esi
push str._s_removed._n
call fcn.0040d70b
mov eax, dword [esp + 0x5c]
add esp, 8
cmp dword [esp + 0x68], edi
jae 0x404632
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x38]
call fcn.004010b9
push esi
lea ecx, [esp + 0x38]
call fcn.0040114a
push str._removed.
lea ecx, [esp + 0x38]
call fcn.0040114a
cmp dword [esp + 0x4c], edi
mov eax, dword [esp + 0x38]
jae 0x404662
lea eax, [esp + 0x38]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401217
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
add esp, 0xc
push ebx
call esi
push ebp
call esi
lea ecx, [esp + 0x50]
call fcn.0040116d
lea ecx, [esp + 0x34]
call fcn.0040116d
mov eax, 1
jmp 0x404765
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x100
lea edx, [esp + 0x90]
mov edi, eax
push edx
push edi
call fcn.00401195
push eax
push str.DeleteService_failed____s_n
call fcn.0040d70b
push edi
lea eax, [esp + 0x84]
push 0x4387f0
push eax
call fcn.0040c979
mov eax, dword [esp + 0x74]
mov edi, 0x10
add esp, 0x20
cmp dword [esp + 0x68], edi
jae 0x4046e9
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x38]
call fcn.004010b9
push str.DeleteService_
lea ecx, [esp + 0x38]
call fcn.0040114a
push esi
lea ecx, [esp + 0x38]
call fcn.0040114a
push str.__FAILED_with_ErrNo
lea ecx, [esp + 0x38]
call fcn.0040114a
lea ecx, [esp + 0x6c]
push ecx
lea ecx, [esp + 0x38]
call fcn.0040114a
cmp dword [esp + 0x4c], edi
mov eax, dword [esp + 0x38]
jae 0x404735
lea eax, [esp + 0x38]
push 0
push eax
push str.UtlSvrHelp
call fcn.00401217
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
add esp, 0xc
push ebx
call esi
push ebp
call esi
lea ecx, [esp + 0x50]
call fcn.0040116d
lea ecx, [esp + 0x34]
call fcn.0040116d
xor eax, eax
mov ecx, dword [esp + 0x190]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x178]
xor ecx, esp
call fcn.0040c96a
add esp, 0x188
ret