Function at 0x40fc53
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 0x40fcb6
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 0x40fcb6
mov ecx, dword [ebp - 0x34c]
and ecx, 0x10
test ecx, ecx
je 0x40fcb6
mov edx, dword [ebp + 8]
push edx
lea eax, [ebp - 0x550]
push eax
call fcn.0041bfa0
add esp, 8
push 0x51ea40
lea ecx, [ebp - 0x550]
push ecx
call fcn.0041bfb0
add esp, 8
movsx edx, byte [ebp - 0x550]
test edx, edx
jne 0x40fce7
push 0x200
lea eax, [ebp - 0x550]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x51ea44
lea ecx, [ebp - 0x550]
push ecx
call fcn.0041bfb0
add esp, 8
push 0x51ea50
lea edx, [ebp - 0x550]
push edx
call fcn.0041bfb0
add esp, 8
push 0x51ea58
lea eax, [ebp - 0x550]
push eax
call fcn.0041bfb0
add esp, 8
lea ecx, [ebp - 0x550]
push ecx
call fcn.00406151
add esp, 4
test eax, eax
jne 0x40fd94
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x40fd94
push 0x200
push 0x5a2880
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x51ea60
push 0x5a2880
call fcn.0041bfb0
add esp, 8
push 0x51ea6c
push 0x5a2880
call fcn.0041bfb0
add esp, 8
push 0x51ea74
push 0x5a2880
call fcn.0041bfb0
add esp, 8
push 0x5a2880
lea edx, [ebp - 0x550]
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileA]
lea eax, [ebp - 0x550]
push eax
call fcn.00406151
add esp, 4
cmp dword [ebp + 0xc], 0
je 0x40fe56
mov ecx, dword [ebp + 0xc]
push ecx
lea edx, [ebp - 0x208]
push edx
call fcn.0041bfa0
add esp, 8
push 0x51ea7c
lea eax, [ebp - 0x208]
push eax
call fcn.0041bfb0
add esp, 8
push 0x51ea80
lea ecx, [ebp - 0x208]
push ecx
call fcn.0041bfb0
add esp, 8
push 0x51ea88
lea edx, [ebp - 0x208]
push edx
call fcn.0041bfb0
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 0x40fe56
push 0
lea edx, [ebp - 0x550]
push edx
lea eax, [ebp - 0x208]
push eax
call fcn.00406177
add esp, 0xc
test eax, eax
jne 0x40fe45
push 0x4000c
call fcn.0040435c
add esp, 4
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
or eax, 0xffffffff
jmp 0x40ff02
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_FindClose]
xor eax, eax
jmp 0x40ff02
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 [0x5a2644], eax
cmp dword [0x5a2644], 0xffffffff
jne 0x40fe95
push 0x40003
call fcn.0040435c
add esp, 4
or eax, 0xffffffff
jmp 0x40ff02
push 0
lea ecx, [ebp - 4]
push ecx
push 0xba00
push 0x4a1a44
mov edx, dword [0x5a2644]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x350], eax
cmp dword [ebp - 0x350], 0
jne 0x40fed3
push 0x40004
call fcn.0040435c
add esp, 4
or eax, 0xffffffff
jmp 0x40ff02
mov eax, dword [0x5a2644]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x350], eax
cmp dword [ebp - 0x350], 0
jne 0x40ff00
push 0x40005
call fcn.0040435c
add esp, 4
or eax, 0xffffffff
jmp 0x40ff02
xor eax, eax
mov esp, ebp
pop ebp
ret