Function at 0x4125c3
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 0x412626
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 0x412626
mov ecx, dword [ebp - 0x34c]
and ecx, 0x10
test ecx, ecx
je 0x412626
mov edx, dword [ebp + 8]
push edx
lea eax, [ebp - 0x550]
push eax
call fcn.0041e930
add esp, 8
push 0x522898
lea ecx, [ebp - 0x550]
push ecx
call fcn.0041e940
add esp, 8
movsx edx, byte [ebp - 0x550]
test edx, edx
jne 0x412657
push 0x200
lea eax, [ebp - 0x550]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x52289c
lea ecx, [ebp - 0x550]
push ecx
call fcn.0041e940
add esp, 8
push 0x5228a8
lea edx, [ebp - 0x550]
push edx
call fcn.0041e940
add esp, 8
push 0x5228b0
lea eax, [ebp - 0x550]
push eax
call fcn.0041e940
add esp, 8
lea ecx, [ebp - 0x550]
push ecx
call fcn.00408ac1
add esp, 4
test eax, eax
jne 0x412704
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x412704
push 0x200
push 0x5abf80
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x5228b8
push 0x5abf80
call fcn.0041e940
add esp, 8
push 0x5228c4
push 0x5abf80
call fcn.0041e940
add esp, 8
push 0x5228cc
push 0x5abf80
call fcn.0041e940
add esp, 8
push 0x5abf80
lea edx, [ebp - 0x550]
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileA]
lea eax, [ebp - 0x550]
push eax
call fcn.00408ac1
add esp, 4
cmp dword [ebp + 0xc], 0
je 0x4127c6
mov ecx, dword [ebp + 0xc]
push ecx
lea edx, [ebp - 0x208]
push edx
call fcn.0041e930
add esp, 8
push 0x5228d4
lea eax, [ebp - 0x208]
push eax
call fcn.0041e940
add esp, 8
push 0x5228d8
lea ecx, [ebp - 0x208]
push ecx
call fcn.0041e940
add esp, 8
push 0x5228e0
lea edx, [ebp - 0x208]
push edx
call fcn.0041e940
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 0x4127c6
push 0
lea edx, [ebp - 0x550]
push edx
lea eax, [ebp - 0x208]
push eax
call fcn.00408ae7
add esp, 0xc
test eax, eax
jne 0x4127b5
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 0x412872
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.KERNEL32.dll_FindClose]
xor eax, eax
jmp 0x412872
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 [0x5abd44], eax
cmp dword [0x5abd44], 0xffffffff
jne 0x412805
push 0x40003
call fcn.00406ccc
add esp, 4
or eax, 0xffffffff
jmp 0x412872
push 0
lea ecx, [ebp - 4]
push ecx
push 0xba00
push 0x4a589c
mov edx, dword [0x5abd44]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x350], eax
cmp dword [ebp - 0x350], 0
jne 0x412843
push 0x40004
call fcn.00406ccc
add esp, 4
or eax, 0xffffffff
jmp 0x412872
mov eax, dword [0x5abd44]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x350], eax
cmp dword [ebp - 0x350], 0
jne 0x412870
push 0x40005
call fcn.00406ccc
add esp, 4
or eax, 0xffffffff
jmp 0x412872
xor eax, eax
mov esp, ebp
pop ebp
ret