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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x24c
mov eax, dword [0x421050]
xor eax, esp
mov dword [esp + 0x248], 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 0x4024da
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_open_service_manager.____d_
jmp 0x4024fb
push 0x105
lea eax, [esp + 0x44]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x40250e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_obtain_module_filename_when_attempting_to_install_service.____d_
call fcn.00401000
push eax
call fcn.00404e6e
add esp, 0xc
jmp 0x402a03
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 0x4025c9
cmp eax, 0x424
je 0x402547
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_open_service.____d_
jmp 0x402617
cmp dword [esp + 0x10], ebx
je 0x4025c1
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 0x402595
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 0x402617
mov ecx, esi
call fcn.00402c61
test eax, eax
jne 0x4025ba
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.00401000
push eax
call fcn.00404e6e
add esp, 0xc
mov ecx, esi
call fcn.00402162
xor ebx, ebx
inc ebx
jmp 0x4029f8
mov ecx, esi
call fcn.00402c61
test eax, eax
jne 0x4025ee
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.00401000
push eax
call fcn.00404e6e
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 0x40262a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
je 0x40262a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_determine_buffer_size_for_query_service_config.____d_
call fcn.00401000
push eax
call fcn.00404e6e
add esp, 0xc
jmp 0x4029f8
push dword [esp + 0x1c]
call fcn.004057c4
pop ecx
mov edi, eax
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x20]
mov dword [esp + 0x28], edi
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x40266b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_open_service_but_could_not_query_service_config.____d_
call fcn.00401000
push eax
call fcn.00404e6e
jmp 0x4029e6
cmp dword [0x4231c8], ebx
jne 0x4026d9
mov edx, dword [edi + 0xc]
lea eax, [esp + 0x18]
push eax
mov ecx, esi
call fcn.00402315
pop ecx
test eax, eax
jne 0x4026a3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Could_not_fix_service_path._This_should_never_happen.____d_
call fcn.00401000
push eax
call fcn.00404e6e
jmp 0x40280e
cmp dword [esp + 0x18], ebx
je 0x4026d9
mov ebx, dword [esp + 0x10]
push ebx
push str.Restarting_install_action:__d
mov dword [0x4231c8], 1
call fcn.00401000
push eax
call fcn.00404e43
add esp, 0xc
mov ecx, ebx
call fcn.00402492
mov ebx, eax
jmp 0x4029e9
push dword [edi + 0xc]
call dword [sym.imp.SHLWAPI.dll_PathUnquoteSpacesW]
mov ecx, dword [edi + 0xc]
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x14]
push eax
lea edx, [esp + 0x20]
call fcn.004020a6
add esp, 0xc
mov dword [esp + 0x24], eax
lea eax, [esp + 0x30]
lea edx, [esp + 0x2c]
lea ecx, [esp + 0x40]
push eax
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x44]
push eax
call fcn.004020a6
add esp, 0xc
test eax, eax
jne 0x40273e
push str.Could_not_obtain_version_number_from_new_path
call fcn.00401000
push eax
call fcn.00404e6e
pop ecx
pop ecx
jmp 0x4029e9
push 2
pop eax
cmp dword [esp + 0x10], eax
je 0x402791
cmp dword [esp + 0x24], ebx
je 0x402791
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x14], eax
jb 0x402791
jne 0x40277b
mov eax, dword [esp + 0x3c]
cmp dword [esp + 0xc], eax
jb 0x402791
jne 0x40277b
mov eax, dword [esp + 0x34]
cmp dword [esp + 0x18], eax
jb 0x402791
jne 0x40277b
mov eax, dword [esp + 0x28]
cmp eax, dword [esp + 0x30]
jb 0x402791
push 4
push ebx
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
xor ebx, ebx
inc ebx
jmp 0x4029e9
mov ecx, esi
call fcn.00402162
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, ebx
call fcn.00402a25
test eax, eax
je 0x4029e9
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 + 0x20]
mov dword [esp + 0x10], eax
jne 0x4027f1
cmp word [ecx], bx
je 0x4027ed
mov di, word [ecx + 2]
cmp di, word [edx + 2]
mov word [esp + 0xc], di
mov edi, dword [esp + 0x20]
jne 0x4027f1
add ecx, 4
add edx, 4
cmp word [esp + 0xc], bx
jne 0x4027b5
mov ecx, ebx
jmp 0x4027f5
sbb ecx, ecx
or ecx, eax
lea eax, [esp + 0x40]
test ecx, ecx
jne 0x402816
push eax
push str.File_is_already_in_the_correct_location__no_action_needed_for_upgrade.__The_path_is:___ls_
call fcn.00401000
push eax
call fcn.00404e43
add esp, 0xc
jmp 0x402789
push ebx
push dword [edi + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x402997
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.00401000
push eax
call fcn.00404e6e
mov ecx, dword [edi + 0xc]
add esp, 0xc
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x402849
sub ecx, edx
sar ecx, 1
mov dword [esp + 0x14], ecx
cmp ecx, 3
jbe 0x402981
lea eax, [ecx + 1]
xor ecx, ecx
push 2
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004057c4
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.0040bf90
add esp, 0xc
push dword [esp + 0x14]
push dword [edi + 0xc]
push dword [esp + 0x14]
call fcn.0040517b
mov eax, dword [esp + 0x20]
add esp, 0xc
mov ecx, dword [esp + 0xc]
add eax, 0xfffffffd
push 3
lea eax, [ecx + eax*2]
push 0x41d63c
push eax
call fcn.0040517b
add esp, 0xc
push 9
push dword [esp + 0x10]
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
je 0x402951
push ebx
push dword [edi + 0xc]
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x402904
push str.The_new_service_binary_could_not_be_copied_in._The_service_will_not_be_upgraded.
call fcn.00401000
push eax
call fcn.00404e6e
mov dword [esp + 0x18], ebx
jmp 0x402914
push str.The_new_service_binary_was_copied_in_by_first_moving_the_old_one_out_of_the_way.
call fcn.00401000
push eax
call fcn.00404e43
pop ecx
pop ecx
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x40293d
push dword [esp + 0xc]
push str.The_old_temp_service_path_was_deleted:__ls.
call fcn.00401000
push eax
call fcn.00404e43
add esp, 0xc
jmp 0x402976
push str.The_old_temp_service_path_was_not_deleted.
call fcn.00401000
push eax
call fcn.00404e6e
pop ecx
pop ecx
jmp 0x402976
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.00401000
push eax
call fcn.00404e6e
add esp, 0x14
mov dword [esp + 0x10], ebx
push dword [esp + 0xc]
call fcn.00405799
jmp 0x4029a8
push str.Service_binary_path_was_less_than_3__service_will_not_be_updated.__This_should_never_happen.
call fcn.00401000
push eax
call fcn.00404e6e
mov dword [esp + 0x18], ebx
jmp 0x4029a7
push str.The_new_service_binary_was_copied_in.
call fcn.00401000
push eax
call fcn.00404e43
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 0x4029d2
push str.Deleting_the_old_file_path_on_the_next_reboot:__ls.
call fcn.00401000
push eax
call fcn.00404e43
jmp 0x4029e2
push str.Call_to_delete_the_old_file_path_failed:__ls.
call fcn.00401000
push eax
call fcn.00404e6e
mov ebx, dword [esp + 0x1c]
add esp, 0xc
test edi, edi
je 0x4029f4
push edi
call fcn.00405799
pop ecx
mov edi, dword [esp + 0x38]
test esi, esi
je 0x402a03
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x402a0e
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [esp + 0x254]
mov eax, ebx
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040502c
mov esp, ebp
pop ebp
ret