Function at 0x4059d0
Capabilities:
Check if file exists
Read .ini file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43ae1e
mov eax, dword fs:[0]
push eax
mov eax, 0x1028
call fcn.004398f0
mov eax, dword [0x44e018]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1034], edi
xor ebx, ebx
mov dword [ebp - 4], ebx
mov eax, 7
xor ecx, ecx
mov dword [edi + 0x14], eax
mov dword [edi + 0x10], ebx
mov word [edi], cx
mov byte [ebp - 4], 1
mov dword [ebp - 0x1018], eax
push ebx
lea eax, [ebp + 8]
xor edx, edx
push eax
or eax, 0xffffffff
lea ecx, [ebp - 0x102c]
mov dword [ebp - 0x101c], ebx
mov word [ebp - 0x102c], dx
call fcn.00405500
mov byte [ebp - 4], 2
cmp byte [ebp + 0x24], bl
je 0x405bc3
cmp dword [ebp - 0x1018], 8
mov eax, dword [ebp - 0x102c]
jae 0x405a6a
lea eax, [ebp - 0x102c]
push eax
push 0x400
lea ecx, [ebp - 0x1010]
push ecx
push 0x4401a0
push str.ExtProfilePath
push str.Advanced
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea edx, [ebp - 0x1010]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405acc
lea eax, [ebp - 0x1010]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x405aa6
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x1010]
lea esi, [ebp - 0x102c]
call fcn.00404c70
jmp 0x405bc3
mov ebx, dword [ebp - 0x1018]
mov eax, dword [ebp - 0x102c]
cmp ebx, 8
jae 0x405ae3
lea eax, [ebp - 0x102c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405ae6
sub eax, edx
sar eax, 1
mov esi, eax
mov eax, dword [ebp - 0x102c]
cmp ebx, 8
jae 0x405b08
lea eax, [ebp - 0x102c]
push eax
lea eax, [ebp - 0x810]
push 0x400
push eax
call dword [sym.imp.MSVCR100.dll_wcscpy_s]
lea eax, [esi - 1]
add esp, 0xc
test eax, eax
jle 0x405b4b
mov ecx, 0x5c
lea ebx, [ebx]
cmp word [ebp + eax*2 - 0x810], cx
je 0x405b41
dec eax
test eax, eax
jg 0x405b30
jmp 0x405b4b
xor ecx, ecx
mov word [ebp + eax*2 - 0x810], cx
mov esi, dword [sym.imp.MSVCR100.dll_wcscat_s]
push 0x440568
lea edx, [ebp - 0x810]
push 0x400
push edx
call esi
add esp, 0xc
lea eax, [ebp - 0x1010]
push eax
lea ecx, [ebp - 0x810]
push 0x400
push ecx
call esi
add esp, 0xc
lea edx, [ebp - 0x810]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405bc1
lea eax, [ebp - 0x810]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405ba0
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x810]
lea esi, [ebp - 0x102c]
call fcn.00404c70
xor ebx, ebx
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x1030], esp
xor eax, eax
mov dword [ecx + 0x14], 7
mov dword [ecx + 0x10], ebx
push ebx
lea edx, [ebp - 0x102c]
mov word [ecx], ax
push edx
or eax, 0xffffffff
call fcn.00405500
push edi
call fcn.00405c70
mov esi, dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
mov ebx, 8
cmp dword [ebp - 0x1018], ebx
jb 0x405c12
mov eax, dword [ebp - 0x102c]
push eax
call esi
add esp, 4
cmp dword [ebp + 0x1c], ebx
jb 0x405c20
mov ecx, dword [ebp + 8]
push ecx
call esi
add esp, 4
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00438de6
mov esp, ebp
pop ebp
ret 0x20