Function at 0x401f1f
Capabilities:
Copy file
Create service
Delete file
Move file

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34c
mov eax, dword [0x427014]
xor eax, esp
mov dword [esp + 0x348], eax
push ebx
push esi
push edi
push 0xf003f
xor ebx, ebx
mov dword [esp + 0x14], ecx
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
mov dword [esp + 0x3c], edi
test edi, edi
jne 0x401f67
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_open_service_manager.____d_
jmp 0x401f88
push 0x105
lea eax, [esp + 0x44]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x401f9b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_obtain_module_filename_when_attempting_to_install_service.____d_
call fcn.00401034
push eax
call fcn.004049ba
add esp, 0xc
jmp 0x4024f5
push 0xf01ff
push str.MozillaMaintenance
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
test esi, esi
jne 0x402056
cmp eax, 0x424
je 0x401fd4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_open_service.____d_
jmp 0x4020a4
cmp dword [esp + 0x10], ebx
je 0x40204e
lea eax, [esp + 0x40]
push eax
call dword [sym.imp.SHLWAPI.dll_PathQuoteSpacesW]
push ebx
push ebx
push ebx
push ebx
push ebx
lea eax, [esp + 0x54]
push eax
push 1
push 3
push 0x10
push 0xf01ff
push str.Mozilla_Maintenance_Service
push str.MozillaMaintenance
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov esi, eax
test esi, esi
jne 0x402022
call dword [sym.imp.KERNEL32.dll_GetLastError]
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_
jmp 0x4020a4
mov ecx, esi
call fcn.00402753
test eax, eax
jne 0x402047
call dword [sym.imp.KERNEL32.dll_GetLastError]
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.00401034
push eax
call fcn.004049ba
add esp, 0xc
mov ecx, esi
call fcn.00401be4
xor ebx, ebx
inc ebx
jmp 0x4024ea
mov ecx, esi
call fcn.00402753
test eax, eax
jne 0x40207b
call dword [sym.imp.KERNEL32.dll_GetLastError]
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.00401034
push eax
call fcn.004049ba
add esp, 0xc
lea eax, [esp + 0x1c]
push eax
push ebx
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x4020b7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
je 0x4020b7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_determine_buffer_size_for_query_service_config.____d_
call fcn.00401034
push eax
call fcn.004049ba
add esp, 0xc
jmp 0x4024ea
push dword [esp + 0x1c]
call fcn.00405861
pop ecx
mov edi, eax
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x20]
mov dword [esp + 0x2c], edi
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x4020f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_open_service_but_could_not_query_service_config.____d_
call fcn.00401034
push eax
call fcn.004049ba
jmp 0x4024d8
cmp dword [0x428958], ebx
jne 0x402166
mov edx, dword [edi + 0xc]
lea eax, [esp + 0x18]
push eax
mov ecx, esi
call fcn.00401d9e
pop ecx
test eax, eax
jne 0x402130
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_fix_service_path._This_should_never_happen.____d_
call fcn.00401034
push eax
call fcn.004049ba
jmp 0x40229b
cmp dword [esp + 0x18], ebx
je 0x402166
mov ebx, dword [esp + 0x10]
push ebx
push str.Restarting_install_action:__d
mov dword [0x428958], 1
call fcn.00401034
push eax
call fcn.00404982
add esp, 0xc
mov ecx, ebx
call fcn.00401f1f
mov ebx, eax
jmp 0x4024db
push dword [edi + 0xc]
call dword [sym.imp.SHLWAPI.dll_PathUnquoteSpacesW]
mov ecx, dword [edi + 0xc]
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x14]
push eax
lea edx, [esp + 0x20]
call fcn.00401b2f
add esp, 0xc
mov dword [esp + 0x34], eax
lea eax, [esp + 0x28]
lea edx, [esp + 0x18]
lea ecx, [esp + 0x40]
push eax
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x38]
push eax
call fcn.00401b2f
add esp, 0xc
test eax, eax
jne 0x4021cb
push str.Could_not_obtain_version_number_from_new_path
call fcn.00401034
push eax
call fcn.004049ba
pop ecx
pop ecx
jmp 0x4024db
push 2
pop eax
cmp dword [esp + 0x10], eax
je 0x40221e
cmp dword [esp + 0x34], ebx
je 0x40221e
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x14], eax
jb 0x40221e
jne 0x402208
mov eax, dword [esp + 0x30]
cmp dword [esp + 0xc], eax
jb 0x40221e
jne 0x402208
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x20], eax
jb 0x40221e
jne 0x402208
mov eax, dword [esp + 0x28]
cmp dword [esp + 0x38], eax
jb 0x40221e
push 4
push ebx
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
xor ebx, ebx
inc ebx
jmp 0x4024db
mov ecx, esi
call fcn.00401be4
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, ebx
call fcn.00402517
test eax, eax
je 0x4024db
mov edx, dword [edi + 0xc]
lea ecx, [esp + 0x40]
mov di, word [ecx]
xor eax, eax
inc eax
cmp di, word [edx]
mov edi, dword [esp + 0x24]
mov dword [esp + 0x10], eax
jne 0x40227e
cmp word [ecx], bx
je 0x40227a
mov di, word [ecx + 2]
cmp di, word [edx + 2]
mov word [esp + 0xc], di
mov edi, dword [esp + 0x24]
jne 0x40227e
add ecx, 4
add edx, 4
cmp word [esp + 0xc], bx
jne 0x402242
mov ecx, ebx
jmp 0x402282
sbb ecx, ecx
or ecx, eax
lea eax, [esp + 0x40]
test ecx, ecx
jne 0x4022a3
push eax
push str.File_is_already_in_the_correct_location__no_action_needed_for_upgrade.__The_path_is:___ls_
call fcn.00401034
push eax
call fcn.00404982
add esp, 0xc
jmp 0x402216
push ebx
push dword [edi + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x402427
call dword [sym.imp.KERNEL32.dll_GetLastError]
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.00401034
push eax
call fcn.004049ba
mov ecx, dword [edi + 0xc]
add esp, 0xc
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x4022d6
sub ecx, edx
sar ecx, 1
mov dword [esp + 0x14], ecx
cmp ecx, 3
jbe 0x402411
lea eax, [ecx + 1]
xor ecx, ecx
push 2
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00405861
pop ecx
mov ecx, dword [esp + 0x14]
mov dword [esp + 0xc], eax
lea ecx, [ecx*2 + 2]
push ecx
push ebx
push eax
call fcn.00406850
add esp, 0xc
push dword [esp + 0x14]
push dword [edi + 0xc]
push dword [esp + 0x14]
call fcn.00407187
mov ecx, dword [esp + 0x18]
add esp, 0xc
mov eax, dword [esp + 0x14]
add ecx, 0xfffffffa
push 3
lea eax, [ecx + eax*2]
push 0x4234ac
push eax
call fcn.00407187
add esp, 0xc
push 9
push dword [esp + 0x10]
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x4023de
push ebx
push dword [edi + 0xc]
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x402391
push str.The_new_service_binary_could_not_be_copied_in._The_service_will_not_be_upgraded.
call fcn.00401034
push eax
call fcn.004049ba
mov dword [esp + 0x18], ebx
jmp 0x4023a1
push str.The_new_service_binary_was_copied_in_by_first_moving_the_old_one_out_of_the_way.
call fcn.00401034
push eax
call fcn.00404982
pop ecx
pop ecx
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x4023ca
push dword [esp + 0xc]
push str.The_old_temp_service_path_was_deleted:__ls.
call fcn.00401034
push eax
call fcn.00404982
add esp, 0xc
jmp 0x402403
push str.The_old_temp_service_path_was_not_deleted.
call fcn.00401034
push eax
call fcn.004049ba
pop ecx
pop ecx
jmp 0x402403
call dword [sym.imp.KERNEL32.dll_GetLastError]
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.00401034
push eax
call fcn.004049ba
add esp, 0x14
mov dword [esp + 0x10], ebx
push dword [esp + 0xc]
call fcn.00405894
jmp 0x40249a
push str.Service_binary_path_was_less_than_3__service_will_not_be_updated.__This_should_never_happen.
call fcn.00401034
push eax
call fcn.004049ba
mov dword [esp + 0x18], ebx
jmp 0x402499
push 0x100
lea eax, [esp + 0x254]
push ebx
push eax
call fcn.00406850
add esp, 0xc
lea eax, [esp + 0x250]
push dword [esp + 0x28]
push dword [esp + 0x30]
push dword [esp + 0x38]
push dword [esp + 0x24]
push str._d._d._d._d
push 0x80
push eax
call fcn.00401006
add esp, 0x1c
lea ecx, [esp + 0x250]
call fcn.00401abd
test eax, eax
jne 0x402489
push str.The_uninstaller_version_string_could_not_be_updated.
call fcn.00401034
push eax
call fcn.00404982
pop ecx
pop ecx
push str.The_new_service_binary_was_copied_in.
call fcn.00401034
push eax
call fcn.00404982
pop ecx
pop ecx
push 4
push ebx
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
lea eax, [esp + 0x40]
push eax
je 0x4024c4
push str.Deleting_the_old_file_path_on_the_next_reboot:__ls.
call fcn.00401034
push eax
call fcn.00404982
jmp 0x4024d4
push str.Call_to_delete_the_old_file_path_failed:__ls.
call fcn.00401034
push eax
call fcn.004049ba
mov ebx, dword [esp + 0x1c]
add esp, 0xc
test edi, edi
je 0x4024e6
push edi
call fcn.00405894
pop ecx
mov edi, dword [esp + 0x3c]
test esi, esi
je 0x4024f5
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x402500
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [esp + 0x354]
mov eax, ebx
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004053c9
mov esp, ebp
pop ebp
ret