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

Disassembly:
push ebp
lea ebp, [esp - 0x3cc]
sub esp, 0x44c
mov eax, dword [0x41a0a0]
xor eax, ebp
mov dword [ebp + 0x3c8], eax
push ebx
push esi
mov esi, dword [ebp + 0x3d8]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
push str.forceinstall
push dword [esi + 4]
call edi
mov ebx, eax
neg ebx
sbb bl, bl
push str.install
push dword [esi + 4]
inc bl
mov byte [ebp - 0x6d], bl
call edi
test eax, eax
je 0x4012c1
test bl, bl
jne 0x4012c1
push str.upgrade
push dword [esi + 4]
call edi
test eax, eax
jne 0x401131
lea edi, [ebp - 0x50]
call fcn.00401378
test eax, eax
je 0x4010cf
mov eax, edi
push eax
call fcn.0040101c
mov ecx, str.maintenanceservice_install.log
mov ebx, eax
call fcn.00404062
push str.Upgrading_service_if_installed...
call fcn.0040101c
mov esi, eax
call fcn.004040cc
xor edi, edi
push edi
call fcn.00401d3f
pop ecx
pop ecx
test eax, eax
jne 0x40111e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_upgrade_service.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
xor edi, edi
inc edi
pop ecx
pop ecx
call fcn.0040101c
mov esi, eax
call fcn.004040bb
mov eax, edi
jmp 0x401360
push str.The_service_was_upgraded_successfully
call fcn.0040101c
mov esi, eax
call fcn.004040cc
jmp 0x40110a
push str.uninstall
push dword [esi + 4]
call edi
test eax, eax
jne 0x40127a
lea edi, [ebp + 0x1bc]
call fcn.00401378
test eax, eax
je 0x401166
mov eax, edi
push eax
call fcn.0040101c
mov ecx, str.maintenanceservice_uninstall.log
mov ebx, eax
call fcn.00404062
push str.Uninstalling_service...
call fcn.0040101c
mov esi, eax
call fcn.004040cc
mov dword [esp], 0xf003f
xor esi, esi
push esi
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
cmp ebx, esi
jne 0x4011ad
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_open_service_manager.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
pop ecx
jmp 0x401251
push 0xf01ff
push str.MozillaMaintenance
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edi, eax
cmp edi, esi
jne 0x4011e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_open_service.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
pop ecx
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x401251
lea eax, [ebp - 0x6c]
push eax
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ControlService]
jmp 0x40121f
push dword [ebp - 0x54]
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 0x68], 1
mov eax, dword [ebp - 0x54]
lea esi, [esi + eax + 0xa]
je 0x401223
cmp esi, 0xea60
ja 0x401223
lea eax, [ebp - 0x6c]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x4011f6
push edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
mov esi, eax
test esi, esi
jne 0x401241
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea esi, [eax - 0x430]
neg esi
sbb esi, esi
inc esi
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call edi
push ebx
call edi
test esi, esi
jne 0x401262
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_uninstall_service.____d_
jmp 0x4010fa
push str.The_service_was_uninstalled_successfully
call fcn.0040101c
mov esi, eax
call fcn.004040cc
xor edi, edi
jmp 0x40110a
and dword [ebp - 0x78], 0
and dword [ebp - 0x74], 0
lea eax, [ebp - 0x80]
push eax
mov dword [ebp - 0x80], str.MozillaMaintenance
mov dword [ebp - 0x7c], 0x4014ee
call dword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x40135e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartServiceCtrlDispatcher_failed.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
pop ecx
jmp 0x40135e
lea edi, [ebp + 0x1bc]
call fcn.00401378
test eax, eax
je 0x4012e7
mov eax, edi
push eax
call fcn.0040101c
mov ecx, str.maintenanceservice_install.log
mov ebx, eax
call fcn.00404062
mov bl, byte [ebp - 0x6d]
xor edi, edi
inc edi
test bl, bl
je 0x4012f8
push 2
pop edi
push str.Installing_service_with_force_specified...
jmp 0x4012fd
push str.Installing_service...
call fcn.0040101c
mov esi, eax
call fcn.004040cc
pop ecx
push edi
call fcn.00401d3f
pop ecx
test eax, eax
jne 0x401340
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_install_service.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
pop ecx
call fcn.0040101c
mov esi, eax
call fcn.004040bb
xor eax, eax
inc eax
jmp 0x401360
push str.The_service_was_installed_successfully
call fcn.0040101c
mov esi, eax
call fcn.004040cc
pop ecx
call fcn.0040101c
mov esi, eax
call fcn.004040bb
xor eax, eax
mov ecx, dword [ebp + 0x3c8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00404ed1
add ebp, 0x3cc
leave
ret