Function at 0x405680
Capabilities:
Check if file exists
Move file
Query service status
Start service
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [0x41c268]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
push edi
mov eax, ecx
push esi
mov dword [ebp - 0x10], eax
call fcn.00405570
test al, al
je 0x405af8
mov eax, dword [0x414c1c]
mov dword [ebp - 0xc], eax
mov ax, word [0x414c20]
mov word [ebp - 8], ax
lea eax, [ebp - 0xc]
push eax
push esi
mov dword [edi], 0
call fcn.00404cd0
mov edi, eax
add esp, 8
test edi, edi
je 0x40571d
mov esi, dword [sym.imp.USER32.dll_CharNextW]
mov edi, edi
push str.Update
push edi
call fcn.00407a70
add esp, 8
test eax, eax
je 0x40573d
cmp word [edi], 0
je 0x40571d
lea eax, [ebp - 0xc]
jmp 0x405700
movzx ecx, word [eax]
test cx, cx
je 0x405714
cmp word [edi], cx
je 0x405732
push eax
call esi
test eax, eax
jne 0x405700
push edi
call esi
mov edi, eax
test edi, edi
jne 0x4056f2
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004087da
mov esp, ebp
pop ebp
ret 8
push edi
call esi
mov edi, eax
test edi, edi
jne 0x4056e0
jmp 0x40571d
mov eax, dword [0x41c230]
mov ecx, 0x41c230
call dword [eax + 0xc]
lea esi, [eax + 0x10]
lea ebx, [edi + 0xe]
mov eax, dword [esi - 8]
mov edi, 1
mov ecx, edi
sub ecx, dword [esi - 4]
sub eax, 0x104
or ecx, eax
mov dword [ebp - 0x38], esi
jge 0x405779
push 0x104
lea ecx, [ebp - 0x38]
call fcn.00402ff0
mov esi, dword [ebp - 0x38]
cmp dword [esi - 8], 0x104
jl 0x405b0d
push 0x104
xor eax, eax
push esi
mov dword [esi - 0xc], 0x104
push eax
mov word [esi + 0x208], ax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push dword [esi - 8]
push esi
test eax, eax
jne 0x4057da
call fcn.0040851b
add esp, 8
test eax, eax
js 0x405b0d
cmp eax, dword [esi - 8]
jg 0x405b0d
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
lea ecx, [ebp - 0x38]
call fcn.004023b0
mov esi, dword [ebp - 0x38]
jmp 0x4057fc
call fcn.0040851b
add esp, 8
test eax, eax
js 0x405b0d
cmp eax, dword [esi - 8]
jg 0x405b0d
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
or ecx, 0xffffffff
test eax, eax
je 0x405ae1
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405ade
push ebx
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x38], 0
call fcn.00401080
mov ecx, dword [ebp - 0x38]
mov eax, dword [ecx - 8]
sub edi, dword [ecx - 4]
sub eax, 0x104
or edi, eax
jge 0x40584f
push 0x104
lea ecx, [ebp - 0x38]
call fcn.00402ff0
mov ecx, dword [ebp - 0x38]
cmp dword [ecx - 8], 0x104
jl 0x405b17
mov dword [ecx - 0xc], 0x104
mov eax, dword [ebp - 0x38]
push str..bak
xor edx, edx
push ecx
mov word [eax + 0x208], dx
call dword [sym.imp.SHLWAPI.dll_PathRenameExtensionW]
push 0xffffffffffffffff
lea ecx, [ebp - 0x38]
test eax, eax
je 0x40588b
call fcn.004033d0
jmp 0x405898
call fcn.004033d0
lea ecx, [ebp - 0x38]
call fcn.004023b0
mov eax, dword [ebp - 0x38]
cmp dword [eax - 0xc], 0
je 0x405aac
push 0
push 0
push 0x2001f
push 0
push 0
push str.SOFTWAREClassesAppID
push 0x80000002
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
call fcn.004021b0
test eax, eax
jne 0x405a75
push eax
push eax
push 0x2001f
push eax
push eax
push 0x414ba0
push dword [ebp - 0x48]
lea ecx, [ebp - 0x54]
call fcn.004021b0
test eax, eax
jne 0x405a23
mov eax, dword [ebp - 0x10]
push 1
add eax, 0x2c
push eax
push str.LocalService
lea ecx, [ebp - 0x54]
call fcn.00406f10
mov edi, dword [sym.imp.KERNEL32.dll_MoveFileExW]
push 9
push dword [ebp - 0x38]
push ebx
call edi
test eax, eax
je 0x405a19
push 9
push ebx
push esi
call edi
test eax, eax
je 0x4059fa
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
test eax, eax
je 0x4059ed
mov ecx, dword [ebp - 0x10]
push 0x30
add ecx, 0x2c
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebx, eax
test ebx, ebx
je 0x4059e0
lea eax, [ebp - 0x34]
push eax
push 1
push ebx
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x4059d3
xor edi, edi
cmp dword [ebp - 0x30], 1
je 0x4059c3
mov eax, edi
inc edi
cmp eax, 0x14
jae 0x4059c3
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x10]
push eax
push 0x24
lea eax, [ebp - 0x34]
push eax
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
cmp dword [ebp - 0x30], 1
jne 0x405997
push 0
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
jmp 0x405a8a
push ecx
mov ecx, esp
push str.Failed_to_send_service_stop_signal__unable_to_restart_service
jmp 0x405a7d
push ecx
mov ecx, esp
push str.Failed_to_open_service_in_Service_Control_Manager__unable_to_restart_service
jmp 0x405a7d
push ecx
mov ecx, esp
push str.Failed_to_open_Service_Control_Manager__unable_to_restart_service
jmp 0x405a7d
push ecx
mov ecx, esp
push str.Updating_service_executable_failed__trying_to_revert_to_backup
call fcn.00401080
call fcn.00404920
add esp, 4
push 9
push ebx
push dword [ebp - 0x38]
call edi
jmp 0x405a8a
push ecx
mov ecx, esp
push str.Copying_to_backup_file_failed
jmp 0x405a7d
push str.Failed_to_open_HKLMSoftwareClassesAppID
lea ecx, [ebp - 0x10]
mov dword [ebp - 0x10], 0
call fcn.00401080
push 0x414ba0
lea eax, [ebp - 0x10]
push str._s_subkey
push eax
call fcn.004016c0
mov eax, dword [ebp - 0x10]
add esp, 8
add eax, 0xfffffff0
mov edi, esp
push eax
call fcn.00402070
add eax, 0x10
add esp, 4
mov dword [edi], eax
call fcn.00404920
add esp, 4
lea ecx, [ebp - 0x10]
call fcn.00401370
jmp 0x405a8a
push ecx
mov ecx, esp
push str.Failed_to_open_HKLMSoftwareClassesAppID_subkey
call fcn.00401080
call fcn.00404920
add esp, 4
lea ecx, [ebp - 0x54]
call fcn.004020e0
lea ecx, [ebp - 0x48]
call fcn.004020e0
lea ecx, [ebp - 0x54]
call fcn.00401390
lea ecx, [ebp - 0x48]
call fcn.00401390
jmp 0x405ac1
push ecx
mov ecx, esp
push str.Backup_path_is_empty__cannot_create_backup_file
call fcn.00401080
call fcn.00404920
add esp, 4
mov edx, dword [ebp - 0x38]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x405ade
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
or ecx, 0xffffffff
add esi, 0xfffffff0
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x405af8
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor al, al
pop ebx
call fcn.004087da
mov esp, ebp
pop ebp
ret 8
push 0x80070057
call fcn.004018b0
push 0x80070057
call fcn.004018b0
int3