Function at 0x412fc8
Capabilities:
Check if file exists
Get common file path
Get file attributes
Move file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x550
mov byte [ebp - 0x550], 0
cmp dword [ebp + 8], 0
je 0x41302b
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [ebp - 0x34c], eax
cmp dword [ebp - 0x34c], 0xffffffff
je 0x41302b
mov ecx, dword [ebp - 0x34c]
and ecx, 0x10
test ecx, ecx
je 0x41302b
mov edx, dword [ebp + 8]
push edx
lea eax, [ebp - 0x550]
push eax
call fcn.004202d0
add esp, 8
push 0x533f10
lea ecx, [ebp - 0x550]
push ecx
call fcn.004202e0
add esp, 8
movsx edx, byte [ebp - 0x550]
test edx, edx
jne 0x41305c
push 0x200
lea eax, [ebp - 0x550]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x533f14
lea ecx, [ebp - 0x550]
push ecx
call fcn.004202e0
add esp, 8
push 0x533f20
lea edx, [ebp - 0x550]
push edx
call fcn.004202e0
add esp, 8
push 0x533f28
lea eax, [ebp - 0x550]
push eax
call fcn.004202e0
add esp, 8
lea ecx, [ebp - 0x550]
push ecx
call fcn.00408b00
add esp, 4
test eax, eax
jne 0x413109
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x413109
push 0x200
push 0x5c2c60
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x533f30
push 0x5c2c60
call fcn.004202e0
add esp, 8
push 0x533f3c
push 0x5c2c60
call fcn.004202e0
add esp, 8
push 0x533f44
push 0x5c2c60
call fcn.004202e0
add esp, 8
push 0x5c2c60
lea edx, [ebp - 0x550]
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileA]
lea eax, [ebp - 0x550]
push eax
call fcn.00408b00
add esp, 4
cmp dword [ebp + 0xc], 0
je 0x4131cb
mov ecx, dword [ebp + 0xc]
push ecx
lea edx, [ebp - 0x208]
push edx
call fcn.004202d0
add esp, 8
push 0x533f4c
lea eax, [ebp - 0x208]
push eax
call fcn.004202e0
add esp, 8
push 0x533f50
lea ecx, [ebp - 0x208]
push ecx
call fcn.004202e0
add esp, 8
push 0x533f58
lea edx, [ebp - 0x208]
push edx
call fcn.004202e0
add esp, 8
lea eax, [ebp - 0x348]
push eax
lea ecx, [ebp - 0x208]
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xffffffff
je 0x4131cb
push 0
lea edx, [ebp - 0x550]
push edx
lea eax, [ebp - 0x208]
push eax
call fcn.00408b26
add esp, 0xc
test eax, eax
jne 0x4131ba
push 0x4000c
call fcn.00406ccc
add esp, 4
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
or eax, 0xffffffff
jmp 0x413277
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_FindClose]
xor eax, eax
jmp 0x413277
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x550]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x5c2a24], eax
cmp dword [0x5c2a24], 0xffffffff
jne 0x41320a
push 0x40003
call fcn.00406ccc
add esp, 4
or eax, 0xffffffff
jmp 0x413277
push 0
lea ecx, [ebp - 4]
push ecx
push 0xba00
push 0x4b4c54
mov edx, dword [0x5c2a24]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x350], eax
cmp dword [ebp - 0x350], 0
jne 0x413248
push 0x40004
call fcn.00406ccc
add esp, 4
or eax, 0xffffffff
jmp 0x413277
mov eax, dword [0x5c2a24]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x350], eax
cmp dword [ebp - 0x350], 0
jne 0x413275
push 0x40005
call fcn.00406ccc
add esp, 4
or eax, 0xffffffff
jmp 0x413277
xor eax, eax
mov esp, ebp
pop ebp
ret