Function at 0x10021ea0
Capabilities:
Check if file exists
Get common file path
Read .ini file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x824
mov eax, dword [0x101c6080]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov esi, ecx
push 0x206
push eax
mov word [ebp - 0x414], ax
lea eax, [ebp - 0x412]
push eax
call fcn.1013f3c0
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x20c], ax
lea eax, [ebp - 0x20a]
push eax
call fcn.1013f3c0
add esp, 0x18
lea eax, [ebp - 0x414]
push 0
push 0x2b
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea edi, [ebp - 0x414]
add edi, 0xfffffffe
lea ecx, [ecx]
mov ax, word [edi + 2]
lea edi, [edi + 2]
test ax, ax
jne 0x10021f10
mov eax, dword [0x1016f2a8]
lea edx, [ebp - 0x414]
mov dword [edi], eax
add edx, 0xfffffffe
lea esp, [esp]
mov cx, word [edx + 2]
lea edx, [edx + 2]
test cx, cx
jne 0x10021f30
mov ebx, dword [str.WnPicture]
lea edi, [ebp - 0x414]
mov ecx, dword [0x1016f3ac]
add edi, 0xfffffffe
mov dword [edx], ebx
mov dword [edx + 4], ecx
mov ecx, dword [0x1016f3b0]
mov dword [edx + 8], ecx
mov ecx, dword [0x1016f3b4]
mov dword [edx + 0xc], ecx
mov ecx, dword [0x1016f3b8]
mov dword [edx + 0x10], ecx
mov cx, word [edi + 2]
lea edi, [edi + 2]
test cx, cx
jne 0x10021f71
lea ecx, [ebp - 0x414]
mov dword [edi], eax
add ecx, 0xfffffffe
jmp 0x10021f90
mov ax, word [ecx + 2]
lea ecx, [ecx + 2]
test ax, ax
jne 0x10021f90
mov eax, dword [0x1016f3ac]
mov dword [ecx], ebx
mov dword [ecx + 4], eax
mov eax, dword [0x1016f3b0]
mov dword [ecx + 8], eax
mov eax, dword [0x1016f3b4]
mov dword [ecx + 0xc], eax
mov eax, dword [0x1016f3b8]
mov dword [ecx + 0x10], eax
lea ecx, [ebp - 0x414]
add ecx, 0xfffffffe
jmp 0x10021fd0
mov ax, word [ecx + 2]
lea ecx, [ecx + 2]
test ax, ax
jne 0x10021fd0
mov eax, dword [str..ini]
mov ebx, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov dword [ecx], eax
mov eax, dword [0x1016f3c0]
mov dword [ecx + 4], eax
mov ax, word [0x1016f3c4]
mov word [ecx + 8], ax
lea eax, [ebp - 0x414]
push eax
push 0x104
lea eax, [ebp - 0x20c]
push eax
push 0x1016edd8
push str.CfgRootPath
push str.Globals
call ebx
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 2]
jmp 0x10022030
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10022030
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
sub ecx, edx
sar ecx, 1
test ecx, ecx
jle 0x100220a4
lea eax, [ebp - 0x20c]
push eax
call edi
test eax, eax
je 0x100220a4
cmp word [ebp - 0x20c], 0
jne 0x10022064
xor ecx, ecx
jmp 0x1002207f
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 2]
lea ecx, [ecx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10022070
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [ebp - 0x20c]
push eax
lea ecx, [esi + 0x34]
call fcn.10022a80
pop edi
mov byte [esi + 0x18], 1
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1013ef23
mov esp, ebp
pop ebp
ret
push 0x104
lea eax, [ebp - 0x824]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x824]
push 0x5c
push eax
call fcn.1014090b
xor ecx, ecx
push 0x206
mov word [eax + 2], cx
xor eax, eax
push eax
mov word [ebp - 0x61c], ax
lea eax, [ebp - 0x61a]
push eax
call fcn.1013f3c0
push 0x1016ed70
lea eax, [ebp - 0x824]
push eax
lea eax, [ebp - 0x61c]
push 0x1016f3f0
push eax
call fcn.10022c30
add esp, 0x24
lea eax, [ebp - 0x61c]
push eax
push 0x104
lea eax, [ebp - 0x20c]
push eax
push 0x1016edd8
push str.CfgRootPath
push str.AppInfo
call ebx
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10022134
sub ecx, edx
sar ecx, 1
test ecx, ecx
jle 0x10022180
lea eax, [ebp - 0x20c]
push eax
call edi
test eax, eax
je 0x10022180
cmp word [ebp - 0x20c], 0
je 0x10022060
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 2]
jmp 0x10022170
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10022170
jmp 0x1002207b
cmp dword [esi + 0xa8], 8
lea eax, [esi + 0x94]
jb 0x10022191
mov eax, dword [eax]
push 0x1016ed70
push eax
lea eax, [ebp - 0x61c]
push 0x1016f3f0
push eax
call fcn.10022c30
add esp, 0x10
lea eax, [ebp - 0x61c]
push eax
push 0x104
lea eax, [ebp - 0x20c]
push eax
push 0x1016edd8
push str.CfgRootPath
push str.AppInfo
call ebx
lea ecx, [ebp - 0x20c]
lea edx, [ecx + 2]
jmp 0x100221e0
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100221e0
sub ecx, edx
sar ecx, 1
test ecx, ecx
jle 0x10022214
lea eax, [ebp - 0x20c]
push eax
call edi
test eax, eax
je 0x10022214
lea eax, [ebp - 0x20c]
push eax
lea ecx, [esi + 0x34]
call fcn.10020870
jmp 0x1002208f
push str.CBaseConfigure::InitSoftCfgRootPath__.....not_find_error
call fcn.10022d10
mov ecx, dword [ebp - 4]
add esp, 4
mov byte [esi + 0x18], 0
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.1013ef23
mov esp, ebp
pop ebp
ret