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

Disassembly:
sub esp, 0x108
push esi
mov esi, dword [0x41ba70]
push 0
call fcn.004089cf
push eax
call fcn.004089a0
add esp, 8
test esi, esi
je 0x40585a
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteFileA]
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
jmp 0x405500
mov eax, dword [0x41ba3c]
test eax, eax
jne 0x40584d
mov eax, dword [0x41ba34]
test eax, eax
jne 0x405857
mov eax, dword [esi + 0x88]
cmp eax, dword [esp + 0x11c]
jne 0x405834
cmp eax, 5
jne 0x405538
push esi
jmp 0x405832
mov eax, dword [esi + 0x84]
mov dword [0x41ba1c], eax
mov eax, dword [0x41ba50]
xor edi, edi
test eax, eax
mov dword [0x41ba18], 0
jne 0x405682
cmp dword [esi + 0x88], 6
jne 0x405574
mov dword [esi + 0x88], 2
jmp 0x405834
lea ecx, [esp + 0x98]
push ecx
call fcn.004089ad
push eax
push 0x4142f8
push 0x4142f4
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea edx, [esp + 0x98]
push edx
call fcn.004051b0
add esp, 4
test eax, eax
je 0x4055e2
jmp 0x4055b0
lea eax, [esp + 0x98]
push eax
call fcn.004089ad
push eax
push 0x4142f8
push 0x4142f4
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
lea ecx, [esp + 0x98]
push ecx
call fcn.004051b0
add esp, 4
test eax, eax
jne 0x4055b0
mov eax, dword [esi + 0x8c]
test eax, eax
je 0x405600
mov edx, dword [0x41ba6c]
push 0x41b788
push edx
call fcn.00405080
add esp, 8
mov eax, dword [esi + 0x84]
mov edx, dword [0x41ba6c]
push 0x800
push eax
lea ecx, [esp + 0xa0]
push ecx
push esi
push edx
call fcn.00404c10
add esp, 0x14
test eax, eax
jne 0x405650
cmp dword [esi + 0x88], 4
jne 0x40563c
mov edi, 1
mov dword [0x41ba3c], edi
mov eax, dword [0x41ba34]
test eax, eax
jne 0x405650
mov edi, 1
mov dword [0x41ba38], edi
mov eax, dword [esi + 0x8c]
test eax, eax
je 0x40566d
mov eax, dword [0x41ba6c]
push 0x41b688
push eax
call fcn.00405080
add esp, 8
mov eax, dword [0x41ba34]
test eax, eax
jne 0x405857
test edi, edi
jne 0x405810
push str.UPDATE.EXE
push esi
call fcn.00411a79
add esp, 8
test eax, eax
je 0x40575c
mov eax, dword [0x41ba50]
test eax, eax
jne 0x40573a
push esi
call ebx
test eax, eax
jne 0x4056e0
call ebp
cmp eax, 2
je 0x4056e0
push eax
push esi
push str.WARNING:_Could_not_delete_file.
lea ecx, [esp + 0x24]
push str._s___s____lu_
push ecx
call fcn.00408948
lea edx, [esp + 0x2c]
push edx
call fcn.004060a0
add esp, 0x18
mov dword [0x41ba38], 0
push esi
lea eax, [esp + 0x9c]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
jne 0x405718
call ebp
push eax
push esi
push str.ERROR:_Could_not_move_file.
lea ecx, [esp + 0x24]
push str._s___s____lu_
push ecx
call fcn.00408948
lea edx, [esp + 0x2c]
push edx
call fcn.004060a0
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.00409c32
add esp, 8
push 0x41b888
push esi
call fcn.00411a79
add esp, 8
test eax, eax
jne 0x4057fc
or dword [0x41ba68], 0x28
jmp 0x4057fc
push str.update.new
call ebx
test eax, eax
jne 0x40579b
call ebp
cmp eax, 2
je 0x40579b
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.00408948
lea ecx, [esp + 0x2c]
push ecx
call fcn.004060a0
add esp, 0x18
mov dword [0x41ba38], 0
push str.UPDATE.NEW
lea edx, [esp + 0x9c]
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
jne 0x4057d6
call ebp
push eax
push str.ERROR:_Could_not_move_file.
lea eax, [esp + 0x20]
push str._s___lu_
push eax
call fcn.00408948
lea ecx, [esp + 0x28]
push ecx
call fcn.004060a0
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.00409c32
add esp, 8
cmp dword [esi + 0x88], 1
jne 0x405810
push 0
push esi
call fcn.00404a10
add esp, 8
mov al, byte [0x41ba64]
test al, al
je 0x40582a
mov edx, dword [esi + 0x84]
sub dword [0x41ba14], edx
call fcn.00406f10
lea eax, [esp + 0x98]
push eax
call ebx
mov esi, dword [esi + 0x90]
test esi, esi
jne 0x405500
pop edi
pop ebp
pop ebx
pop esi
add esp, 0x108
ret
mov dword [0x41ba38], 1
pop edi
pop ebp
pop ebx
pop esi
add esp, 0x108
ret