Function at 0x40a050
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 0x38]
add eax, 4
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
jne 0x40a07b
mov eax, 3
jmp 0x40a241
mov dword [ebp - 4], 1
mov ecx, dword [ebp - 0x38]
add ecx, 4
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40a0b4
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x38]
call fcn.00409d20
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x40a0b4
mov eax, dword [ebp - 0xc]
jmp 0x40a241
mov dword [ebp - 8], 0
mov edx, dword [ebp + 0x14]
movzx eax, byte [edx]
test eax, eax
je 0x40a212
cmp dword [ebp - 4], 0
je 0x40a212
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
lea ecx, [ebp - 0x14]
push ecx
mov edx, dword [ebp + 8]
push edx
mov ecx, dword [ebp - 0x38]
call fcn.00409ad0
test eax, eax
jne 0x40a102
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x40a1f3
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp - 0x14]
push edx
call fcn.00401000
add esp, 8
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x40a13e
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
push ecx
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
add esp, 4
xor eax, eax
jmp 0x40a241
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x10]
add eax, dword [ebp - 0x24]
lea ecx, [eax + eax + 2]
mov dword [ebp - 0x1c], ecx
xor ecx, ecx
mov eax, dword [ebp - 0x1c]
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.MSVCR90.dll_void____cdecl_operator_new___unsigned_int_
add esp, 4
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
call fcn.00406370
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
call fcn.004063c0
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
call fcn.004063c0
mov ecx, dword [ebp - 0x38]
add ecx, 4
push ecx
mov edx, dword [ebp - 0x20]
push edx
mov eax, dword [ebp + 8]
push eax
push 0x40f600
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
push edx
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
push ecx
call sub.MSVCR90.dll_void___cdecl_operator_delete___void__
add esp, 4
jmp 0x40a210
mov edx, dword [ebp - 0x38]
add edx, 4
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
push 0x40f610
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov dword [ebp - 8], eax
jmp 0x40a22f
mov edx, dword [ebp - 0x38]
add edx, 4
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
push 0x40f620
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x40a23e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret 0x10