Function at 0x40f418
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x440
push esi
mov esi, dword [ebx + 0x69c]
xor eax, eax
push edi
push eax
push eax
mov dword [ebp - 4], eax
call fcn.00402ee8
mov esi, dword [ebx + 0x11c8]
push str._SaveProfile
call fcn.00405dbc
mov esi, dword [ebx + 0x11c8]
push str._LoadProfile
mov edi, eax
call fcn.00405dbc
test edi, edi
mov dword [ebp - 0xc], eax
mov esi, 0x208
jl 0x40f53b
mov eax, dword [ebx + 0x11c8]
lea ecx, [edi + 1]
call fcn.00405dac
xor edi, edi
push esi
mov dword [ebp - 4], eax
lea eax, [ebp - 0x22e]
push edi
push eax
mov word [ebp - 0x230], di
call sub.msvcrt.dll_memset
add esp, 0xc
push 0x5c
push dword [ebp - 4]
call sub.msvcrt.dll_wcschr
test eax, eax
pop ecx
pop ecx
jne 0x40f511
push esi
lea eax, [ebp - 0x43e]
push edi
push eax
mov word [ebp - 0x440], di
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0x440]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push dword [ebp - 4]
call sub.msvcrt.dll_wcslen
mov edi, eax
pop ecx
lea eax, [ebp - 0x440]
push eax
call sub.msvcrt.dll_wcslen
lea eax, [edi + eax + 1]
cmp eax, 0x104
pop ecx
jae 0x40f507
push dword [ebp - 4]
lea eax, [ebp - 0x440]
push eax
lea eax, [ebp - 0x230]
call fcn.00404e39
pop ecx
jmp 0x40f524
and word [ebp - 0x230], 0
jmp 0x40f525
push dword [ebp - 4]
mov eax, 0x104
lea edi, [ebp - 0x230]
call fcn.00404c14
pop ecx
push 0
lea eax, [ebp - 0x230]
push eax
push ebx
call fcn.0040ab3e
mov dword [ebp - 4], 1
mov eax, dword [ebp - 0xc]
test eax, eax
jl 0x40f60f
lea ecx, [eax + 1]
mov eax, dword [ebx + 0x11c8]
call fcn.00405dac
and word [ebp - 0x230], 0
push esi
mov edi, eax
lea eax, [ebp - 0x22e]
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
push 0x5c
push edi
call sub.msvcrt.dll_wcschr
test eax, eax
pop ecx
pop ecx
jne 0x40f5e9
and word [ebp - 0x440], ax
push esi
push eax
lea eax, [ebp - 0x43e]
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0x440]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push edi
call sub.msvcrt.dll_wcslen
mov esi, eax
pop ecx
lea eax, [ebp - 0x440]
push eax
call sub.msvcrt.dll_wcslen
lea eax, [esi + eax + 1]
cmp eax, 0x104
pop ecx
jae 0x40f5df
lea eax, [ebp - 0x440]
push edi
push eax
lea eax, [ebp - 0x230]
call fcn.00404e39
pop ecx
jmp 0x40f5fa
and word [ebp - 0x230], 0
jmp 0x40f5fb
push edi
mov eax, 0x104
lea edi, [ebp - 0x230]
call fcn.00404c14
pop ecx
lea eax, [ebp - 0x230]
push eax
push ebx
call fcn.0040ae5f
mov dword [ebp - 4], 1
mov esi, dword [ebx + 0x11c8]
push str._WaitForItem
call fcn.00405dbc
mov esi, eax
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
test esi, esi
jl 0x40f6c1
mov eax, dword [ebx + 0x11c8]
lea ecx, [esi + 1]
call fcn.00405dac
push eax
call sub.msvcrt.dll__wtoi
pop ecx
mov dword [ebp - 8], eax
push ebx
call fcn.0040ddbe
test eax, eax
je 0x40f664
mov eax, dword [ebx + 0x69c]
cmp dword [eax + 0x44c], 0
jg 0x40f6cb
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
cmp dword [ebp - 8], 0
je 0x40f64b
mov edx, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
xor eax, eax
or eax, edx
mov edx, dword [ebp - 0x18]
xor esi, esi
mov dword [ebp - 0xc], eax
or ecx, esi
mov esi, dword [ebp - 0x1c]
xor eax, eax
xor edi, edi
or eax, esi
mov esi, dword [ebp - 0xc]
or edx, edi
push edi
sub eax, esi
push 0x989680
sbb edx, ecx
push edx
push eax
call fcn.00415500
xor ecx, ecx
cmp edx, ecx
jl 0x40f64b
jg 0x40f6cb
cmp eax, dword [ebp - 8]
jbe 0x40f64b
jmp 0x40f6cb
push ebx
call fcn.0040ddbe
test eax, eax
je 0x40f6d2
mov dword [ebp - 4], 1
mov eax, dword [ebx + 0x11c8]
xor edi, edi
mov dword [ebx + 0x208], edi
mov eax, dword [eax + 0x30]
dec eax
mov dword [ebp - 8], edi
mov dword [ebp - 0xc], edi
js 0x40f78c
mov eax, dword [ebx + 0x11c8]
mov ecx, edi
call fcn.00405dac
mov esi, eax
push esi
push str._stext
call sub.msvcrt.dll__wcsicmp
test eax, eax
pop ecx
pop ecx
jne 0x40f713
inc eax
jmp 0x40f71c
call fcn.0040dd0f
test eax, eax
jbe 0x40f725
mov dword [ebp - 8], eax
lea eax, [edi + 1]
mov dword [ebp - 0xc], eax
mov eax, dword [ebx + 0x11c8]
mov eax, dword [eax + 0x30]
inc edi
dec eax
cmp edi, eax
jle 0x40f6f0
cmp dword [ebp - 8], 0
jbe 0x40f78c
push 0
push ebx
call fcn.0040c668
mov eax, ebx
call fcn.0040c638
mov eax, ebx
call fcn.0040b282
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebx + 0x11c8]
call fcn.00405dac
mov ecx, dword [ebx + 0x698]
push dword [ebp - 8]
mov edx, dword [ebx + 0x69c]
mov ecx, dword [ecx + 0x98]
mov dword [edx + 0x318], ecx
push eax
mov eax, dword [ebx + 0x69c]
call fcn.0040927a
mov dword [ebp - 4], 1
cmp dword [ebp - 4], 0
je 0x40f799
mov eax, ebx
call fcn.0040ca39
mov eax, dword [ebp - 4]
pop edi
pop esi
leave
ret