Function at 0x409460
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 0x40948b
mov eax, 3
jmp 0x409651
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 0x4094c4
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x38]
call fcn.00409330
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x4094c4
mov eax, dword [ebp - 0xc]
jmp 0x409651
mov dword [ebp - 8], 0
mov edx, dword [ebp + 0x14]
movzx eax, byte [edx]
test eax, eax
je 0x409622
cmp dword [ebp - 4], 0
je 0x409622
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.004091e0
test eax, eax
jne 0x409512
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 0x409603
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 0x40954e
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
push ecx
call fcn.00407662
add esp, 4
xor eax, eax
jmp 0x409651
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 fcn.00407678
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.004063a0
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
call fcn.004063f0
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
call fcn.004063f0
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 0x40e4ec
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 fcn.00407662
add esp, 4
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
push ecx
call fcn.0040780e
add esp, 4
jmp 0x409620
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 0x40e4fc
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov dword [ebp - 8], eax
jmp 0x40963f
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 0x40e50c
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
jne 0x40964e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret 0x10