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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34c
mov eax, dword [0x429010]
xor eax, esp
mov dword [esp + 0x348], eax
push ebx
push esi
push edi
push 0xf003f
xor ebx, ebx
mov dword [esp + 0x18], ecx
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
mov dword [esp + 0x2c], edi
test edi, edi
jne 0x401f8f
mov esi, str.Could_not_open_service_manager.____d_
jmp 0x401fa9
push 0x105
lea eax, [esp + 0x44]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x401fcb
mov esi, str.Could_not_obtain_module_filename_when_attempting_to_install_service.____d_
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
call fcn.00401034
push dword [esp + 0x10]
push esi
push eax
call fcn.004049e5
add esp, 0xc
jmp 0x402541
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 0x402086
cmp eax, 0x424
je 0x402004
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_open_service.____d_
jmp 0x4020d4
cmp dword [esp + 0x14], ebx
je 0x40207e
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 0x402052
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 0x4020d4
mov ecx, esi
call fcn.0040279f
test eax, eax
jne 0x402077
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.004049e5
add esp, 0xc
mov ecx, esi
call fcn.00401c01
xor ebx, ebx
inc ebx
jmp 0x402536
mov ecx, esi
call fcn.0040279f
test eax, eax
jne 0x4020ab
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.004049e5
add esp, 0xc
lea eax, [esp + 0x20]
push eax
push ebx
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x4020e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
je 0x4020e7
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.004049e5
add esp, 0xc
jmp 0x402536
push dword [esp + 0x20]
call fcn.00405902
pop ecx
lea ecx, [esp + 0x20]
mov dword [esp + 0x18], eax
push ecx
push dword [esp + 0x24]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x402114
mov dword [esp + 0x14], str.Could_open_service_but_could_not_query_service_config.____d_
jmp 0x40213f
cmp dword [0x42a948], ebx
jne 0x402197
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x1c]
push eax
mov ecx, esi
mov edx, dword [edx + 0xc]
call fcn.00401dbb
pop ecx
test eax, eax
jne 0x402161
xor ebx, ebx
mov dword [esp + 0x14], str.Could_not_fix_service_path._This_should_never_happen.____d_
inc ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
call fcn.00401034
push dword [esp + 0x10]
push dword [esp + 0x18]
push eax
call fcn.004049e5
jmp 0x402529
cmp dword [esp + 0x1c], ebx
je 0x402197
mov ebx, dword [esp + 0x14]
push ebx
push str.Restarting_install_action:__d
mov dword [0x42a948], 1
call fcn.00401034
push eax
call fcn.004049ad
add esp, 0xc
mov ecx, ebx
call fcn.00401f4e
mov ebx, eax
jmp 0x40252c
mov eax, dword [esp + 0x18]
push dword [eax + 0xc]
call dword [sym.imp.SHLWAPI.dll_PathUnquoteSpacesW]
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x14]
push eax
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x1c]
mov ecx, dword [eax + 0xc]
call fcn.00401b51
add esp, 0xc
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x30]
lea edx, [esp + 0x1c]
lea ecx, [esp + 0x40]
push eax
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x40]
push eax
call fcn.00401b51
add esp, 0xc
test eax, eax
jne 0x402204
push str.Could_not_obtain_version_number_from_new_path
call fcn.00401034
push eax
call fcn.004049e5
pop ecx
pop ecx
jmp 0x40252c
push 2
pop eax
cmp dword [esp + 0x14], eax
je 0x402257
cmp dword [esp + 0x3c], ebx
je 0x402257
mov eax, dword [esp + 0x1c]
cmp dword [esp + 0x10], eax
jb 0x402257
jne 0x402241
mov eax, dword [esp + 0x38]
cmp dword [esp + 0xc], eax
jb 0x402257
jne 0x402241
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x28], eax
jb 0x402257
jne 0x402241
mov eax, dword [esp + 0x30]
cmp dword [esp + 0x24], eax
jb 0x402257
push 4
push ebx
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
xor ebx, ebx
inc ebx
jmp 0x40252c
mov ecx, esi
call fcn.00401c01
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, ebx
call fcn.00402563
test eax, eax
je 0x40252c
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x40]
mov eax, dword [eax + 0xc]
mov edx, eax
mov dword [esp + 0x24], eax
mov di, word [ecx]
xor eax, eax
inc eax
cmp di, word [edx]
mov edi, dword [esp + 0x2c]
mov dword [esp + 0x14], eax
jne 0x4022c1
cmp word [ecx], bx
je 0x4022bd
mov di, word [ecx + 2]
cmp di, word [edx + 2]
mov word [esp + 0xc], di
mov edi, dword [esp + 0x2c]
jne 0x4022c1
add ecx, 4
add edx, 4
cmp word [esp + 0xc], bx
jne 0x402285
mov ecx, ebx
jmp 0x4022c5
sbb ecx, ecx
or ecx, eax
lea eax, [esp + 0x40]
test ecx, ecx
jne 0x4022e6
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.004049ad
add esp, 0xc
jmp 0x40224f
push ebx
push dword [esp + 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x40247b
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.004049e5
mov eax, dword [esp + 0x24]
add esp, 0xc
mov ecx, dword [eax + 0xc]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x40231e
sub ecx, edx
sar ecx, 1
mov dword [esp + 0x10], ecx
cmp ecx, 3
jbe 0x402465
lea eax, [ecx + 1]
xor ecx, ecx
push 2
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00405902
pop ecx
mov ecx, dword [esp + 0x10]
mov dword [esp + 0xc], eax
lea ecx, [ecx*2 + 2]
push ecx
push ebx
push eax
call fcn.00406960
mov eax, dword [esp + 0x24]
add esp, 0xc
push dword [esp + 0x10]
push dword [eax + 0xc]
push dword [esp + 0x14]
call fcn.00407e9a
mov ecx, dword [esp + 0x18]
add esp, 0xc
mov eax, dword [esp + 0x10]
add ecx, 0xfffffffa
push 3
lea eax, [ecx + eax*2]
push 0x42453c
push eax
call fcn.00407e9a
mov eax, dword [esp + 0x24]
add esp, 0xc
push 9
push dword [esp + 0x10]
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x40242e
mov eax, dword [esp + 0x18]
push ebx
push dword [eax + 0xc]
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
mov ebx, eax
call fcn.00401034
test ebx, ebx
jne 0x4023e7
push str.The_new_service_binary_could_not_be_copied_in._The_service_will_not_be_upgraded.
push eax
call fcn.004049e5
and dword [esp + 0x1c], esi
jmp 0x4023f2
push str.The_new_service_binary_was_copied_in_by_first_moving_the_old_one_out_of_the_way.
push eax
call fcn.004049ad
pop ecx
pop ecx
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ebx, eax
call fcn.00401034
test ebx, ebx
je 0x40241d
push dword [esp + 0xc]
push str.The_old_temp_service_path_was_deleted:__ls.
push eax
call fcn.004049ad
add esp, 0xc
jmp 0x40242a
push str.The_old_temp_service_path_was_not_deleted.
push eax
call fcn.004049e5
pop ecx
pop ecx
xor ebx, ebx
jmp 0x402457
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [esp + 0x1c]
push dword [esp + 0x10]
push dword [eax + 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.004049e5
add esp, 0x14
mov dword [esp + 0x14], ebx
push dword [esp + 0xc]
call fcn.00405932
jmp 0x4024ee
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.004049e5
mov dword [esp + 0x1c], ebx
jmp 0x4024ed
push 0x100
lea eax, [esp + 0x254]
push ebx
push eax
call fcn.00406960
add esp, 0xc
lea eax, [esp + 0x250]
push dword [esp + 0x30]
push dword [esp + 0x38]
push dword [esp + 0x40]
push dword [esp + 0x28]
push str._d._d._d._d
push 0x80
push eax
call fcn.00401006
add esp, 0x1c
lea ecx, [esp + 0x250]
call fcn.00401adf
test eax, eax
jne 0x4024dd
push str.The_uninstaller_version_string_could_not_be_updated.
call fcn.00401034
push eax
call fcn.004049ad
pop ecx
pop ecx
push str.The_new_service_binary_was_copied_in.
call fcn.00401034
push eax
call fcn.004049ad
pop ecx
pop ecx
push 4
push ebx
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov ebx, eax
call fcn.00401034
lea ecx, [esp + 0x40]
push ecx
test ebx, ebx
je 0x40251a
push str.Deleting_the_old_file_path_on_the_next_reboot:__ls.
push eax
call fcn.004049ad
jmp 0x402525
push str.Call_to_delete_the_old_file_path_failed:__ls.
push eax
call fcn.004049e5
mov ebx, dword [esp + 0x20]
add esp, 0xc
push dword [esp + 0x18]
call fcn.00405932
pop ecx
test esi, esi
je 0x402541
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x40254c
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.004053fc
mov esp, ebp
pop ebp
ret