Function at 0x406870
Capabilities:
Check if file exists
Get common file path
Get file attributes
Move file
Read .ini file

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x8ccc
call fcn.00407a80
push edi
mov dword [ebp - 0x9c], 0
mov dword [ebp - 0x98], 0x94
lea eax, [ebp - 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
cmp dword [ebp + 8], 0
jne 0x4068b0
mov eax, dword [ebp - 0x9c]
jmp 0x406be0
mov ecx, dword [ebp - 0x88]
mov dword [ebp - 0x8cac], ecx
cmp dword [ebp - 0x8cac], 1
je 0x4068ee
cmp dword [ebp - 0x8cac], 2
je 0x4068d3
jmp 0x406bd6
push 5
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
mov dword [ebp - 0x9c], eax
jmp 0x406bda
push 0x400
push 0
lea ecx, [ebp - 0xca0]
push ecx
call fcn.00407070
add esp, 0xc
push 0x400
push 0
lea edx, [ebp - 0x4a0]
push edx
call fcn.00407070
add esp, 0xc
push 0x400
push 0
lea eax, [ebp - 0x8a0]
push eax
call fcn.00407070
add esp, 0xc
cmp dword [ebp + 0xc], 0
je 0x406978
push 0x400
lea ecx, [ebp - 0x4a0]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
cmp eax, 1
jae 0x406956
jmp 0x406bda
push 0x400
lea eax, [ebp - 0x8a0]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
cmp eax, 1
jae 0x406976
jmp 0x406bda
jmp 0x4069ad
push 0x400
lea edx, [ebp - 0x4a0]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetShortPathNameA]
cmp eax, 1
jae 0x406998
jmp 0x406bda
push 0x413d00
lea ecx, [ebp - 0x8a0]
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 8
push 0x400
lea edx, [ebp - 0xca0]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
test eax, eax
je 0x406bd4
lea eax, [ebp - 0xca0]
mov dword [ebp - 0x8cb0], eax
mov ecx, dword [ebp - 0x8cb0]
add ecx, 1
mov dword [ebp - 0x8cb4], ecx
mov edx, dword [ebp - 0x8cb0]
mov al, byte [edx]
mov byte [ebp - 0x8cb5], al
add dword [ebp - 0x8cb0], 1
cmp byte [ebp - 0x8cb5], 0
jne 0x4069e2
mov ecx, dword [ebp - 0x8cb0]
sub ecx, dword [ebp - 0x8cb4]
mov dword [ebp - 0x8cbc], ecx
mov edx, dword [ebp - 0x8cbc]
movsx eax, byte [ebp + edx - 0xca1]
cmp eax, 0x5c
je 0x406a63
lea ecx, [ebp - 0xca0]
add ecx, 0xffffffff
mov dword [ebp - 0x8cc0], ecx
mov edx, dword [ebp - 0x8cc0]
mov al, byte [edx + 1]
mov byte [ebp - 0x8cc1], al
add dword [ebp - 0x8cc0], 1
cmp byte [ebp - 0x8cc1], 0
jne 0x406a34
mov edi, dword [ebp - 0x8cc0]
mov cx, word [0x413cfc]
mov word [edi], cx
lea edx, [ebp - 0xca0]
add edx, 0xffffffff
mov dword [ebp - 0x8cc8], edx
mov eax, dword [ebp - 0x8cc8]
mov cl, byte [eax + 1]
mov byte [ebp - 0x8cc9], cl
add dword [ebp - 0x8cc8], 1
cmp byte [ebp - 0x8cc9], 0
jne 0x406a72
mov edi, dword [ebp - 0x8cc8]
mov edx, dword [str.WinInit.ini]
mov dword [edi], edx
mov eax, dword [0x413cf4]
mov dword [edi + 4], eax
mov ecx, dword [0x413cf8]
mov dword [edi + 8], ecx
lea edx, [ebp - 0xca0]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x406b07
push 0
push 0x80
push 4
push 0
push 0
push 0x40000000
lea eax, [ebp - 0xca0]
push eax
call dword [0x417138]
mov dword [ebp - 0xca4], eax
cmp dword [ebp - 0xca4], 0xffffffff
je 0x406b07
mov ecx, dword [ebp - 0xca4]
push ecx
call dword [0x41713c]
mov dword [ebp - 0xca4], 0
lea edx, [ebp - 0xca0]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x406bd4
lea eax, [ebp - 0x8ca8]
mov dword [ebp - 0xca8], eax
push 0x8000
push 0
lea ecx, [ebp - 0x8ca8]
push ecx
call fcn.00407070
add esp, 0xc
lea edx, [ebp - 0xca0]
push edx
push 0x7fff
lea eax, [ebp - 0x8ca8]
push eax
push str.Rename
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileSectionA]
mov ecx, dword [ebp - 0xca8]
movsx edx, byte [ecx]
test edx, edx
je 0x406b8a
mov eax, dword [ebp - 0xca8]
movsx ecx, byte [eax]
mov edx, dword [ebp - 0xca8]
add edx, 1
mov dword [ebp - 0xca8], edx
test ecx, ecx
je 0x406b88
jmp 0x406b6a
jmp 0x406b5d
lea eax, [ebp - 0x4a0]
push eax
lea ecx, [ebp - 0x8a0]
push ecx
push str._s___s
mov edx, dword [ebp - 0xca8]
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0xca0]
push eax
lea ecx, [ebp - 0x8ca8]
push ecx
push str.Rename
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileSectionA]
test eax, eax
je 0x406bd4
mov dword [ebp - 0x9c], 1
jmp 0x406bda
xor eax, eax
jmp 0x406be0
mov eax, dword [ebp - 0x9c]
pop edi
mov esp, ebp
pop ebp
ret