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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34c
mov eax, dword [0x421050]
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 + 0x38], edi
test edi, edi
jne 0x401ecd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_open_service_manager.____d_
jmp 0x401eee
push 0x105
lea eax, [esp + 0x44]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x401f01
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
push eax
call fcn.00404bd5
add esp, 0xc
jmp 0x402465
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 0x401fbc
cmp eax, 0x424
je 0x401f3a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_open_service.____d_
jmp 0x40200a
cmp dword [esp + 0x10], ebx
je 0x401fb4
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 0x401f88
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 0x40200a
mov ecx, esi
call fcn.004026c3
test eax, eax
jne 0x401fad
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.0040101c
push eax
call fcn.00404bd5
add esp, 0xc
mov ecx, esi
call fcn.00401b53
xor ebx, ebx
inc ebx
jmp 0x40245a
mov ecx, esi
call fcn.004026c3
test eax, eax
jne 0x401fe1
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.0040101c
push eax
call fcn.00404bd5
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 0x40201d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
je 0x40201d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_determine_buffer_size_for_query_service_config.____d_
call fcn.0040101c
push eax
call fcn.00404bd5
add esp, 0xc
jmp 0x40245a
push dword [esp + 0x1c]
call fcn.00405529
pop ecx
mov edi, eax
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x20]
mov dword [esp + 0x38], edi
cmp byte [edi + 0x56], dl
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x40205e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_open_service_but_could_not_query_service_config.____d_
call fcn.0040101c
push eax
call fcn.00404bd5
jmp 0x402448
cmp dword [0x4235d4], ebx
jne 0x4020cc
mov edx, dword [edi + 0xc]
lea eax, [esp + 0x18]
push eax
mov ecx, esi
call fcn.00401d06
pop ecx
test eax, eax
jne 0x402096
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_fix_service_path._This_should_never_happen.____d_
call fcn.0040101c
push eax
call fcn.00404bd5
jmp 0x402201
cmp dword [esp + 0x18], ebx
je 0x4020cc
mov ebx, dword [esp + 0x10]
push ebx
push str.Restarting_install_action:__d
mov dword [0x4235d4], 1
call fcn.0040101c
push eax
call fcn.00404baa
add esp, 0xc
mov ecx, ebx
call fcn.00401e85
mov ebx, eax
jmp 0x40244b
push dword [edi + 0xc]
call dword [sym.imp.SHLWAPI.dll_PathUnquoteSpacesW]
mov ecx, dword [edi + 0xc]
lea eax, [esp + 0x3c]
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x14]
push eax
lea edx, [esp + 0x20]
call fcn.00401a97
add esp, 0xc
mov dword [esp + 0x34], eax
lea eax, [esp + 0x2c]
lea edx, [esp + 0x18]
lea ecx, [esp + 0x40]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.00401a97
add esp, 0xc
test eax, eax
jne 0x402131
push str.Could_not_obtain_version_number_from_new_path
call fcn.0040101c
push eax
call fcn.00404bd5
pop ecx
pop ecx
jmp 0x40244b
push 2
pop eax
cmp dword [esp + 0x10], eax
je 0x402184
cmp dword [esp + 0x34], ebx
je 0x402184
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x14], eax
jb 0x402184
jne 0x40216e
mov eax, dword [esp + 0x28]
cmp dword [esp + 0xc], eax
jb 0x402184
jne 0x40216e
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x24], eax
jb 0x402184
jne 0x40216e
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x3c], eax
jb 0x402184
push 4
push ebx
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
xor ebx, ebx
inc ebx
jmp 0x40244b
mov ecx, esi
call fcn.00401b53
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, ebx
call fcn.00402487
test eax, eax
je 0x40244b
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 + 0x30]
mov dword [esp + 0x10], eax
jne 0x4021e4
cmp word [ecx], bx
je 0x4021e0
mov di, word [ecx + 2]
cmp di, word [edx + 2]
mov word [esp + 0xc], di
mov edi, dword [esp + 0x30]
jne 0x4021e4
add ecx, 4
add edx, 4
cmp word [esp + 0xc], bx
jne 0x4021a8
mov ecx, ebx
jmp 0x4021e8
sbb ecx, ecx
or ecx, eax
lea eax, [esp + 0x40]
test ecx, ecx
jne 0x402209
push eax
push str.File_is_already_in_the_correct_location__no_action_needed_for_upgrade.__The_path_is:___ls_
call fcn.0040101c
push eax
call fcn.00404baa
add esp, 0xc
jmp 0x40217c
push ebx
push dword [edi + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x40238d
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.0040101c
push eax
call fcn.00404bd5
mov ecx, dword [edi + 0xc]
add esp, 0xc
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x40223c
sub ecx, edx
sar ecx, 1
mov dword [esp + 0x14], ecx
cmp ecx, 3
jbe 0x402377
lea eax, [ecx + 1]
xor ecx, ecx
push 2
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00405529
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.0040bc00
add esp, 0xc
push dword [esp + 0x14]
push dword [edi + 0xc]
push dword [esp + 0x14]
call fcn.00404da0
mov eax, dword [esp + 0x20]
add esp, 0xc
mov ecx, dword [esp + 0xc]
add eax, 0xfffffffd
push 3
lea eax, [ecx + eax*2]
push 0x41d31c
push eax
call fcn.00404da0
add esp, 0xc
push 9
push dword [esp + 0x10]
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x402344
push ebx
push dword [edi + 0xc]
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x4022f7
push str.The_new_service_binary_could_not_be_copied_in._The_service_will_not_be_upgraded.
call fcn.0040101c
push eax
call fcn.00404bd5
mov dword [esp + 0x18], ebx
jmp 0x402307
push str.The_new_service_binary_was_copied_in_by_first_moving_the_old_one_out_of_the_way.
call fcn.0040101c
push eax
call fcn.00404baa
pop ecx
pop ecx
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x402330
push dword [esp + 0xc]
push str.The_old_temp_service_path_was_deleted:__ls.
call fcn.0040101c
push eax
call fcn.00404baa
add esp, 0xc
jmp 0x402369
push str.The_old_temp_service_path_was_not_deleted.
call fcn.0040101c
push eax
call fcn.00404bd5
pop ecx
pop ecx
jmp 0x402369
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.0040101c
push eax
call fcn.00404bd5
add esp, 0x14
mov dword [esp + 0x10], ebx
push dword [esp + 0xc]
call fcn.004054fe
jmp 0x40240a
push str.Service_binary_path_was_less_than_3__service_will_not_be_updated.__This_should_never_happen.
call fcn.0040101c
push eax
call fcn.00404bd5
mov dword [esp + 0x18], ebx
jmp 0x402409
xor eax, eax
push 0xfe
mov word [esp + 0x254], ax
lea eax, [esp + 0x256]
push ebx
push eax
call fcn.0040bc00
add esp, 0xc
lea eax, [esp + 0x250]
push dword [esp + 0x2c]
push dword [esp + 0x24]
push dword [esp + 0x30]
push dword [esp + 0x24]
push str._d._d._d._d
push 0x80
push eax
call fcn.00401000
add esp, 0x1c
lea ecx, [esp + 0x250]
call fcn.00401a25
test eax, eax
jne 0x4023f9
push str.The_uninstaller_version_string_could_not_be_updated.
call fcn.0040101c
push eax
call fcn.00404baa
pop ecx
pop ecx
push str.The_new_service_binary_was_copied_in.
call fcn.0040101c
push eax
call fcn.00404baa
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 0x402434
push str.Deleting_the_old_file_path_on_the_next_reboot:__ls.
call fcn.0040101c
push eax
call fcn.00404baa
jmp 0x402444
push str.Call_to_delete_the_old_file_path_failed:__ls.
call fcn.0040101c
push eax
call fcn.00404bd5
mov ebx, dword [esp + 0x1c]
add esp, 0xc
test edi, edi
je 0x402456
push edi
call fcn.004054fe
pop ecx
mov edi, dword [esp + 0x38]
test esi, esi
je 0x402465
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x402470
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.00404d91
mov esp, ebp
pop ebp
ret