Function at 0x408171
Capabilities:
Create process on windows
Get common file path
Terminate process
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x313a4
call fcn.004097b0
push ebx
xor ebx, ebx
cmp byte [0x42af0c], bl
push esi
push edi
je 0x40858c
mov esi, 0x30d40
lea eax, [ebp - 0x313a4]
push esi
push eax
push 0x42af0c
call fcn.00408fbc
add esp, 0xc
cmp eax, ebx
jl 0x40855e
cmp eax, 0x34
jb 0x40855e
mov ecx, dword [ebp - 0x313a4]
cmp ecx, dword [str.SIGN]
je 0x408205
push ecx
lea eax, [ebp - 0x200]
push dword [0x42b10c]
push str.Update_to__d:_Invalid_signature__08x_on_package
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push ebx
push str.update
call fcn.00408977
add esp, 0x1c
push str.Invalid_signature_on_package.
call fcn.004018e3
jmp 0x408430
mov edi, dword [ebp - 0x31378]
mov edx, dword [ebp - 0x31374]
lea ecx, [edi + edx + 0x34]
cmp eax, ecx
jge 0x40824e
push eax
lea eax, [ebp - 0x200]
push dword [0x42b10c]
push str.Update_to__d:_Package_truncated__len__d_.
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push ebx
push str.update
call fcn.00408977
add esp, 0x1c
push str.Package_truncated.
jmp 0x4081fb
xor eax, eax
mov cl, byte [ebp + eax - 0x31398]
cmp cl, bl
je 0x408270
cmp cl, 0x5c
je 0x40826d
cmp cl, 0x2f
je 0x40826d
inc eax
cmp eax, 0x20
jl 0x408250
jmp 0x408270
push 0x20
pop eax
cmp eax, 0x20
jl 0x4082ac
push dword [0x42b10c]
lea eax, [ebp - 0x200]
push str.Update_to__d:_Invalid_exe_name.
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push ebx
push str.update
call fcn.00408977
add esp, 0x18
push str.Invalid_exe_name.
jmp 0x4081fb
mov eax, dword [0x42b10c]
cmp dword [ebp - 0x313a0], eax
je 0x408305
push eax
lea eax, [ebp - 0x200]
push dword [ebp - 0x313a0]
push str.Update_to__d:_Package_contains_earlier_version__d.
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push ebx
push str.update
call fcn.00408977
add esp, 0x1c
push dword [0x42b10c]
push dword [ebp - 0x313a0]
push str.Package_not_the_latest_build__package__d_vs_reported_latest__d_.
call fcn.004018e3
add esp, 0xc
jmp 0x40858c
cmp edi, 0x64
ja 0x40852b
cmp edx, esi
ja 0x40852b
lea eax, [ebp - 0x31370]
push edi
push eax
lea eax, [ebp - 0x264]
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [ebp - 0x31378]
push eax
lea esi, [ebp + eax - 0x31370]
lea eax, [ebp - 0x264]
push eax
push dword [ebp - 0x31374]
push esi
call fcn.0040918f
add esp, 0x1c
test al, al
jne 0x408389
push dword [0x42b10c]
lea eax, [ebp - 0x200]
push str.Update_to__d:_Verify_failed.
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push ebx
push str.update
call fcn.00408977
add esp, 0x18
push str.Verify_failed____update_aborted.
jmp 0x4081fb
lea eax, [ebp - 0x664]
push eax
push 0x200
call dword [sym.imp.KERNEL32.DLL_GetTempPathA]
test eax, eax
je 0x40858c
lea eax, [ebp - 0x664]
push eax
lea eax, [ebp - 0x464]
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x31398]
push eax
lea eax, [ebp - 0x464]
push eax
call sub.MSVCRT.dll_strcat
lea eax, [ebp - 0x464]
push 0x4270a0
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
add esp, 0x18
cmp edi, ebx
jne 0x408436
call fcn.00408f8a
push eax
lea eax, [ebp - 0x464]
push eax
lea eax, [ebp - 0x200]
push dword [0x42b10c]
push str.Update_to__d:_Could_not_open__s_for_writing.___s_
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push ebx
push str.update
call fcn.00408977
add esp, 0x20
lea eax, [ebp - 0x464]
push eax
push str.Could_not_open__s_for_writing.
call fcn.004018e3
pop ecx
pop ecx
jmp 0x40858c
push edi
push dword [ebp - 0x31374]
push 1
push esi
call dword [sym.imp.MSVCRT.dll_fwrite]
mov esi, eax
add esp, 0x10
cmp esi, dword [ebp - 0x31374]
je 0x408499
call fcn.00408f8a
push eax
lea eax, [ebp - 0x200]
push dword [ebp - 0x31374]
push esi
push dword [0x42b10c]
push str.Update_to__d:_Only_wrote__d_of__d_bytes.___s_
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push ebx
push str.update
call fcn.00408977
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x28
jmp 0x40858c
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
lea eax, [ebp - 0x664]
push eax
call sub.MSVCRT.dll_strlen
pop ecx
mov byte [ebp + eax - 0x665], bl
pop ecx
lea eax, [ebp - 0x464]
push eax
push str.Wrote__s____executing.
call fcn.004018e3
pop ecx
lea eax, [ebp - 0x200]
pop ecx
push dword [0x42b10c]
push str.Update_to__d:_Success.
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push 1
push str.update
call fcn.00408977
add esp, 0x18
cmp dword [0x42b2a4], ebx
mov eax, str._no_ads
jne 0x408508
mov eax, 0x42a938
lea ecx, [ebp - 0x664]
push ebx
push ecx
push eax
lea eax, [ebp - 0x464]
push eax
push str.open
push ebx
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
push ebx
call dword [sym.imp.MSVCRT.dll_exit]
push edx
push eax
lea eax, [ebp - 0x200]
push str.Update_to__d:_File_too_large.
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push ebx
push str.update
call fcn.00408977
add esp, 0x1c
push str.Invalid_package_format_or_file_too_large.
jmp 0x4081fb
push eax
lea eax, [ebp - 0x200]
push dword [0x42b10c]
push str.Update_to__d:_Package_truncated__len__d_.
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [ebp - 0x200]
push eax
push ebx
push str.update
call fcn.00408977
add esp, 0x1c
pop edi
pop esi
pop ebx
leave
ret