Function at 0x41af20
Capabilities:
Check if file exists
Copy file
Delete file
Move file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4d3d44
mov eax, dword fs:[0]
push eax
sub esp, 0x950
mov eax, dword [0x5254e0]
xor eax, ebp
mov dword [ebp - 0x18], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 8]
mov dword [ebp - 0x868], eax
mov eax, dword [eax + 8]
xor ebx, ebx
push ebx
mov edi, ecx
push eax
lea ecx, [ebp - 0x828]
call fcn.00414ac0
push 0x3e8
lea ecx, [ebp - 0x7ec]
push ecx
push ebx
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameW]
test eax, eax
je 0x41b2c2
xor eax, eax
mov word [ebp - 0x808], ax
lea eax, [ebp - 0x7ec]
mov dword [ebp - 0x7f4], 7
mov dword [ebp - 0x7f8], ebx
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x41afb0
sub eax, edx
sar eax, 1
push eax
lea ecx, [ebp - 0x7ec]
push ecx
lea ecx, [ebp - 0x808]
call fcn.0041ef70
push 5
push str..orig
lea esi, [ebp - 0x808]
mov byte [ebp - 4], 1
call fcn.0041d060
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x808]
mov esi, 8
mov byte [ebp - 0x861], bl
cmp dword [ebp - 0x7f4], esi
jae 0x41b00b
lea eax, [ebp - 0x808]
push eax
call dword [sym.imp.KERNEL32.DLL_DeleteFileW]
test eax, eax
jne 0x41b04e
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 2
je 0x41b04e
lea edx, [ebp - 0x868]
push edx
lea ecx, [ebp - 0x898]
mov dword [ebp - 0x868], str.Upgrade___DeleteFile_failed
call fcn.004a936f
push 0x515244
lea eax, [ebp - 0x898]
push eax
call fcn.004aba66
mov eax, dword [ebp - 0x808]
cmp dword [ebp - 0x7f4], esi
jae 0x41b062
lea eax, [ebp - 0x808]
push eax
lea ecx, [ebp - 0x7ec]
push ecx
call dword [sym.imp.KERNEL32.DLL_MoveFileW]
test eax, eax
jne 0x41b0a1
lea edx, [ebp - 0x868]
push edx
lea ecx, [ebp - 0x8a4]
mov dword [ebp - 0x868], str.Upgrade___MoveFile_failed
call fcn.004a936f
push 0x515244
lea eax, [ebp - 0x8a4]
push eax
call fcn.004aba66
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
lea ecx, [ebp - 0x7ec]
push ecx
mov byte [ebp - 0x861], 1
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov esi, eax
mov dword [ebp - 0x874], esi
mov byte [ebp - 4], 3
cmp esi, 0xffffffff
jne 0x41b102
lea edx, [ebp - 0x868]
push edx
lea ecx, [ebp - 0x880]
mov dword [ebp - 0x868], str.Upgrade___CreateFile_failed
call fcn.004a936f
push 0x515244
lea eax, [ebp - 0x880]
push eax
call fcn.004aba66
cmp dword [edi + 0x14], 0x10
mov ecx, dword [edi + 0x10]
jb 0x41b10f
mov eax, dword [edi]
jmp 0x41b111
mov eax, edi
push ebx
lea edx, [ebp - 0x86c]
push edx
push ecx
push eax
push esi
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x41b194
mov eax, dword [edi + 0x10]
cmp dword [ebp - 0x86c], eax
jne 0x41b194
push esi
call dword [sym.imp.KERNEL32.DLL_FlushFileBuffers]
test eax, eax
jne 0x41b169
lea eax, [ebp - 0x868]
push eax
lea ecx, [ebp - 0x8b0]
mov dword [ebp - 0x868], str.Upgrade___FlushFileBuffers_failed
call fcn.004a936f
push 0x515244
lea ecx, [ebp - 0x8b0]
push ecx
call fcn.004aba66
push esi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov edx, dword [ebp - 0x868]
lea ecx, [ebp - 0x808]
mov byte [edx + 0x274], 1
call fcn.00428ed0
lea eax, [ebp - 0x828]
push eax
jmp 0x41b2c9
lea ecx, [ebp - 0x868]
push ecx
lea ecx, [ebp - 0x88c]
mov dword [ebp - 0x868], str.Upgrade___WriteFile_failed
call fcn.004a936f
push 0x515244
lea edx, [ebp - 0x88c]
push edx
call fcn.004aba66
push 1
push 3
lea ecx, [ebp - 0x95c]
call fcn.0041cae0
push 0x4faa0c
push ecx
mov byte [ebp - 4], 5
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push ecx
push 0x4fc678
push ecx
mov ecx, dword [ebp - 0x870]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
call edx
push eax
lea eax, [ebp - 0x94c]
push eax
call fcn.0040b990
add esp, 0xc
push eax
call fcn.0040b990
add esp, 0xc
push eax
call fcn.0041c210
add esp, 4
push eax
call fcn.0040b990
add esp, 8
lea ecx, [ebp - 0x860]
push ecx
lea ecx, [ebp - 0x95c]
call fcn.0041cca0
mov byte [ebp - 4], 6
cmp dword [eax + 0x14], 0x10
jb 0x41b23e
mov eax, dword [eax]
push eax
lea ecx, [ebp - 0x844]
call fcn.00406870
lea edx, [ebp - 0x844]
push edx
xor ebx, ebx
push ebx
mov byte [ebp - 4], 7
call fcn.00432700
add esp, 8
lea ecx, [ebp - 0x844]
call fcn.00406910
lea ecx, [ebp - 0x860]
call fcn.00406910
cmp byte [ebp - 0x861], bl
je 0x41b2a2
cmp dword [ebp - 0x7f4], 8
mov eax, dword [ebp - 0x808]
jae 0x41b293
lea eax, [ebp - 0x808]
push ebx
lea ecx, [ebp - 0x7ec]
push ecx
push eax
call dword [sym.imp.KERNEL32.DLL_CopyFileW]
lea ecx, [ebp - 0x95c]
mov byte [ebp - 4], 4
call fcn.00414d00
mov eax, 0x41b2b7
ret
lea edx, [ebp - 0x828]
push edx
mov dword [ebp - 4], 0xffffffff
call fcn.00414bb0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x18]
xor ecx, ebp
call fcn.004a91d2
mov esp, ebp
pop ebp
ret 4