Function at 0x401d3f
Capabilities:
Create service

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x244
mov eax, dword [0x41a0a0]
xor eax, esp
mov dword [esp + 0x240], eax
push ebx
push esi
push edi
push 0xf003f
xor esi, esi
push esi
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
mov dword [esp + 0x18], ebx
cmp ebx, esi
jne 0x401da6
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
xor eax, eax
mov ecx, dword [esp + 0x24c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00404ed1
mov esp, ebp
pop ebp
ret
push 0x105
lea eax, [esp + 0x3c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x401dde
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_obtain_module_filename_when_attempting_to_install_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 0x401d8f
mov edi, 0xf01ff
push edi
mov esi, str.MozillaMaintenance
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0xc], eax
call ebx
cmp dword [esp + 0xc], 0
jne 0x401e2b
cmp eax, 0x424
je 0x40225d
call ebx
push eax
push str.Could_not_open_service.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
pop ecx
push dword [esp + 0x18]
jmp 0x401dd6
push dword [esp + 0xc]
call fcn.00402418
pop ecx
test eax, eax
jne 0x401e4f
call ebx
push eax
push str.Could_not_reset_security_ACE_on_service_handle._It_might_not_be_possible_to_start_the_service._This_error_should_never_happen.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
pop ecx
mov esi, dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
lea eax, [esp + 0x1c]
push eax
push 0
push 0
push dword [esp + 0x18]
call esi
test eax, eax
jne 0x401e9c
call ebx
cmp eax, 0x7a
je 0x401e9c
call ebx
push eax
push str.Could_not_determine_buffer_size_for_query_service_config.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop ecx
pop ecx
push dword [esp + 0xc]
call esi
push dword [esp + 0x18]
call esi
jmp 0x401d8f
push dword [esp + 0x1c]
call fcn.004057d2
pop ecx
mov edi, eax
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x20]
mov dword [esp + 0x18], edi
push edi
push dword [esp + 0x18]
call esi
test eax, eax
jne 0x401efa
call ebx
push eax
push str.Could_open_service_but_could_not_query_service_config.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
xor esi, esi
pop ecx
push edi
call fcn.0040573a
pop ecx
push dword [esp + 0xc]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [esp + 0x18]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, esi
jmp 0x401d91
cmp dword [0x41bdcc], 0
jne 0x401f79
push dword [esp + 0xc]
mov edi, dword [edi + 0xc]
lea ebx, [esp + 0x18]
call fcn.00401bd7
pop ecx
test eax, eax
jne 0x401f3b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_fix_service_path._This_should_never_happen.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
xor esi, esi
pop ecx
inc esi
mov edi, dword [esp + 0x10]
jmp 0x401ed8
cmp dword [esp + 0x14], 0
je 0x401f6f
push dword [ebp + 8]
mov dword [0x41bdcc], 1
push str.Restarting_install_action:__d
call fcn.0040101c
mov esi, eax
call fcn.004040cc
push dword [ebp + 8]
call fcn.00401d3f
add esp, 0xc
mov esi, eax
jmp 0x401f35
mov edi, dword [esp + 0x10]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [edi + 0xc]
call dword [sym.imp.SHLWAPI.dll_PathUnquoteSpacesW]
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x38]
push eax
push dword [edi + 0xc]
call fcn.00401737
mov esi, eax
add esp, 0x14
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x48]
push eax
call fcn.00401737
add esp, 0x14
test eax, eax
jne 0x401fde
push str.Could_not_obtain_version_number_from_new_path
call fcn.0040101c
mov esi, eax
call fcn.004040f1
jmp 0x401ed5
cmp dword [ebp + 8], 2
je 0x40202d
test esi, esi
je 0x40202d
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x10]
jb 0x40202d
jne 0x402016
mov eax, dword [esp + 0x24]
cmp eax, dword [esp + 0x20]
jb 0x40202d
jne 0x402016
mov eax, dword [esp + 0x34]
cmp eax, dword [esp + 0x14]
jb 0x40202d
jne 0x402016
mov eax, dword [esp + 0x28]
cmp eax, dword [esp + 0x30]
jb 0x40202d
push 4
push 0
lea eax, [esp + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
xor esi, esi
inc esi
jmp 0x401ed8
push dword [esp + 0xc]
call fcn.004017fa
pop ecx
push dword [esp + 0xc]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call fcn.004022e9
test eax, eax
jne 0x402058
push edi
call fcn.0040573a
pop ecx
xor esi, esi
jmp 0x401ee9
push dword [edi + 0xc]
lea eax, [esp + 0x3c]
push eax
call fcn.00405745
pop ecx
test eax, eax
pop ecx
lea eax, [esp + 0x38]
jne 0x402092
push eax
push str.File_is_already_in_the_correct_location__no_action_needed_for_upgrade.__The_path_is:___ls_
call fcn.0040101c
mov esi, eax
call fcn.004040cc
push edi
call fcn.0040573a
add esp, 0xc
xor esi, esi
inc esi
jmp 0x401ee9
push 0
push dword [edi + 0xc]
mov dword [esp + 0x18], 1
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x4021fd
call ebx
push eax
push str.Could_not_overwrite_old_service_binary_file._This_should_never_happen__but_if_it_does_the_next_upgrade_will_fix_it__the_service_is_not_a_critical_component_that_needs_to_be_installed_for_upgrades_to_work.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
push dword [edi + 0xc]
call fcn.0040550b
mov esi, eax
add esp, 0xc
cmp esi, 3
jbe 0x4021e5
xor ecx, ecx
push 2
pop edx
lea eax, [esi + 1]
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004057d2
pop ecx
lea ecx, [esi + esi + 2]
push ecx
push 0
push eax
mov dword [esp + 0x18], eax
call fcn.004056c0
add esp, 0xc
push esi
push dword [edi + 0xc]
push dword [esp + 0x14]
call fcn.00404ee0
mov eax, dword [esp + 0x18]
add esp, 0xc
push 3
lea eax, [eax + esi*2 - 6]
push 0x415dc4
push eax
call fcn.00404ee0
add esp, 0xc
push 9
push dword [esp + 0x10]
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x4021b7
push 0
push dword [edi + 0xc]
lea eax, [esp + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x40216b
push str.The_new_service_binary_could_not_be_copied_in._The_service_will_not_be_upgraded.
call fcn.0040101c
mov esi, eax
call fcn.004040f1
and dword [esp + 0x14], 0
jmp 0x40217c
push str.The_new_service_binary_was_copied_in_by_first_moving_the_old_one_out_of_the_way.
call fcn.0040101c
mov esi, eax
call fcn.004040cc
pop ecx
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x4021a3
push dword [esp + 0xc]
push str.The_old_temp_service_path_was_deleted:__ls.
call fcn.0040101c
mov esi, eax
call fcn.004040cc
pop ecx
jmp 0x4021b4
push str.The_old_temp_service_path_was_not_deleted.
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
jmp 0x4021da
call ebx
push eax
push dword [esp + 0x10]
push dword [edi + 0xc]
push str.Could_not_move_old_service_file_out_of_the_way_from:___ls__to___ls_._Service_will_not_be_upgraded.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
add esp, 0x10
and dword [esp + 0x10], 0
push dword [esp + 0xc]
call fcn.0040573a
jmp 0x40220e
push str.Service_binary_path_was_less_than_3__service_will_not_be_updated.__This_should_never_happen.
call fcn.0040101c
mov esi, eax
call fcn.004040f1
and dword [esp + 0x14], 0
jmp 0x40220e
push str.The_new_service_binary_was_copied_in.
call fcn.0040101c
mov esi, eax
call fcn.004040cc
pop ecx
push 4
push 0
lea eax, [esp + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
lea eax, [esp + 0x38]
push eax
je 0x40223a
push str.Deleting_the_old_file_path_on_the_next_reboot:__ls.
call fcn.0040101c
mov esi, eax
call fcn.004040cc
jmp 0x40224b
push str.Call_to_delete_the_old_file_path_failed:__ls.
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
pop ecx
push edi
call fcn.0040573a
mov esi, dword [esp + 0x14]
pop ecx
jmp 0x401ee9
cmp dword [ebp + 8], 0
je 0x40208a
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.SHLWAPI.dll_PathQuoteSpacesW]
xor eax, eax
push eax
push eax
push eax
push eax
push eax
lea eax, [esp + 0x4c]
push eax
push 1
push 3
push 0x10
push edi
push str.Mozilla_Maintenance_Service
push esi
push dword [esp + 0x48]
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov edi, eax
test edi, edi
jne 0x4022b5
call ebx
push eax
push str.Could_not_create_Windows_service._This_error_should_never_happen_since_a_service_install_should_only_be_called_when_elevated.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
jmp 0x402050
push edi
call fcn.00402418
pop ecx
test eax, eax
jne 0x4022d6
call ebx
push eax
push str.Could_not_set_security_ACE_on_service_handle__the_service_will_not_be_able_to_be_started_from_unelevated_processes._This_error_should_never_happen.____d_
call fcn.0040101c
mov esi, eax
call fcn.004040f1
pop ecx
pop ecx
push edi
call fcn.004017fa
pop ecx
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40208a