Function at 0x405480
Capabilities:
Check if file exists
Delete file
Get common file path
Move file

Disassembly:
sub esp, 0x188
push ebx
push ebp
push esi
mov esi, dword [0x419ef0]
push edi
push 0
call fcn.00408b63
push eax
call fcn.0040813e
add esp, 8
test esi, esi
je 0x405870
mov ebp, dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [0x419ebc]
test eax, eax
jne 0x405866
mov eax, dword [0x419eb4]
test eax, eax
jne 0x405870
mov eax, dword [esi + 0x88]
mov ecx, dword [esp + 0x19c]
cmp eax, ecx
jne 0x40584d
cmp eax, 5
jne 0x4054ee
push esi
jmp 0x405847
mov eax, dword [esi + 0x84]
xor edi, edi
mov dword [0x419e9c], eax
mov eax, dword [0x419ed0]
test eax, eax
mov dword [0x419e98], 0
jne 0x405626
cmp dword [esi + 0x88], 6
jne 0x40552a
mov dword [esi + 0x88], 2
jmp 0x40584d
lea ecx, [esp + 0x98]
push ecx
call fcn.0040814b
push eax
push 0x416008
push 0x415118
call ebp
lea edx, [esp + 0x98]
push edx
call fcn.00402cb0
add esp, 4
test eax, eax
je 0x405586
lea eax, [esp + 0x98]
push eax
call fcn.0040814b
push eax
push 0x416008
push 0x415118
call ebp
lea ecx, [esp + 0x98]
push ecx
call fcn.00402cb0
add esp, 4
test eax, eax
jne 0x405558
mov eax, dword [esi + 0x8c]
test eax, eax
je 0x4055a4
mov edx, dword [0x419448]
push 0x419c08
push edx
call fcn.00402b80
add esp, 8
mov eax, dword [esi + 0x84]
mov edx, dword [0x419448]
push 0x800
lea ecx, [esp + 0x9c]
push eax
push ecx
push esi
push edx
call fcn.00402730
add esp, 0x14
test eax, eax
jne 0x4055f4
cmp dword [esi + 0x88], 4
jne 0x4055e0
mov edi, 1
mov dword [0x419ebc], edi
mov eax, dword [0x419eb4]
test eax, eax
jne 0x4055f4
mov edi, 1
mov dword [0x419eb8], edi
mov eax, dword [esi + 0x8c]
test eax, eax
je 0x405611
mov eax, dword [0x419448]
push 0x419b08
push eax
call fcn.00402b80
add esp, 8
mov eax, dword [0x419eb4]
test eax, eax
jne 0x405870
test edi, edi
jne 0x40581d
push str.UPDATE.EXE
push esi
call fcn.0040fed0
add esp, 8
test eax, eax
je 0x405709
mov eax, dword [0x419ed0]
test eax, eax
jne 0x4056e2
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x405688
call ebx
cmp eax, 2
je 0x405688
push eax
push esi
push str.WARNING:_Could_not_delete_file.
lea ecx, [esp + 0x24]
push str._s___s____lu_
push ecx
call fcn.004080ec
lea edx, [esp + 0x2c]
push edx
call fcn.00405ef0
add esp, 0x18
mov dword [0x419eb8], 0
lea eax, [esp + 0x98]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
jne 0x4056c0
call ebx
push eax
push esi
push str.ERROR:_Could_not_move_file.
lea ecx, [esp + 0x24]
push str._s___s____lu_
push ecx
call fcn.004080ec
lea edx, [esp + 0x2c]
push edx
call fcn.00405ef0
add esp, 0x18
mov eax, dword [esi + 0x80]
lea edx, [esp + 0x10]
mov dword [esp + 0x10], eax
mov ecx, dword [esi + 0x80]
push edx
push esi
mov dword [esp + 0x1c], ecx
call fcn.004096c7
add esp, 8
push 0x419d08
push esi
call fcn.0040fed0
add esp, 8
test eax, eax
jne 0x4057ad
mov eax, dword [0x419ee8]
or al, 0x28
mov dword [0x419ee8], eax
jmp 0x4057ad
push str.update.new
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x40574c
call ebx
cmp eax, 2
je 0x40574c
push eax
push esi
push str.WARNING:_Could_not_delete_file.
lea eax, [esp + 0x24]
push str._s__Update.new____lu_
push eax
call fcn.004080ec
lea ecx, [esp + 0x2c]
push ecx
call fcn.00405ef0
add esp, 0x18
mov dword [0x419eb8], 0
lea edx, [esp + 0x98]
push str.UPDATE.NEW
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
jne 0x405787
call ebx
push eax
push str.ERROR:_Could_not_move_file.
lea eax, [esp + 0x20]
push str._s___lu_
push eax
call fcn.004080ec
lea ecx, [esp + 0x28]
push ecx
call fcn.00405ef0
add esp, 0x14
mov edx, dword [esi + 0x80]
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], edx
mov eax, dword [esi + 0x80]
push ecx
push str.update.new
mov dword [esp + 0x1c], eax
call fcn.004096c7
add esp, 8
cmp dword [esi + 0x88], 1
jne 0x40581d
lea edx, [esp + 0x118]
push edx
call fcn.0040814b
push eax
push 0x416008
push 0x415118
call ebp
lea eax, [esp + 0x118]
push eax
call fcn.00402cb0
add esp, 4
test eax, eax
je 0x405812
lea ecx, [esp + 0x118]
push ecx
call fcn.0040814b
push eax
push 0x416008
push 0x415118
call ebp
lea edx, [esp + 0x118]
push edx
call fcn.00402cb0
add esp, 4
test eax, eax
jne 0x4057e4
push 0
push esi
call fcn.00402540
add esp, 8
mov al, byte [0x419ee4]
test al, al
je 0x40583f
mov eax, dword [esi + 0x84]
mov ecx, dword [0x419e94]
sub ecx, eax
mov dword [0x419e94], ecx
call fcn.004077f0
lea ecx, [esp + 0x98]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov esi, dword [esi + 0x90]
test esi, esi
jne 0x4054b4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x188
ret
mov dword [0x419eb8], 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x188
ret