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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x442ce8
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x1674
call fcn.004321f0
mov eax, dword [0x457600]
xor eax, esp
mov dword [esp + 0x1670], eax
push ebx
push esi
push edi
mov eax, dword [0x457600]
xor eax, esp
push eax
lea eax, [esp + 0x1688]
mov dword fs:[0], eax
xor eax, eax
push 0x206
mov esi, ecx
push eax
lea ecx, [esp + 0x86e]
push ecx
mov word [esp + 0x870], ax
call fcn.0042fb00
add esp, 0xc
lea ebx, [esp + 0x864]
call fcn.004011d0
mov edx, ebx
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x402307
xor al, al
jmp 0x4028b9
push 0x206
xor ebx, ebx
lea ecx, [esp + 0xa72]
xor eax, eax
push ebx
push ecx
mov word [esp + 0xa78], ax
call fcn.0042fb00
add esp, 0xc
lea edx, [esp + 0x864]
push edx
push 0x104
lea eax, [esp + 0xa74]
push eax
push 0x44aec4
push str.PlatformConfigFile
push str.set_platform
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea eax, [esp + 0xa6c]
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x402360
sub eax, edx
sar eax, 1
je 0x402300
lea ecx, [esp + 0xa6c]
push ecx
lea ecx, [esp + 0x1c]
call fcn.00406b70
mov dword [esp + 0x1690], ebx
call fcn.0041160a
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x4023a3
push 0x80004005
call fcn.004069f0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x24], eax
lea edi, [esp + 0x18]
mov byte [esp + 0x1690], 1
call fcn.004051c0
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx - 0xc]
cmp eax, ebx
jl 0x402440
push str._GAMEDIR_
push ecx
call fcn.0042df98
mov ecx, dword [esp + 0x20]
add esp, 8
cmp eax, ebx
je 0x402440
sub eax, ecx
sar eax, 1
cmp eax, 0xffffffff
je 0x402440
add eax, 9
push eax
lea ecx, [esp + 0x18]
push ecx
mov ecx, edi
call fcn.00405220
mov byte [esp + 0x1690], 2
mov edx, dword [eax]
push edx
add esi, 4
push esi
lea eax, [esp + 0x2c]
push str._s_s
push eax
call fcn.00406360
mov byte [esp + 0x16a0], 1
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
add esp, 0x10
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x4024f5
cmp dword [ecx - 0xc], ebx
jl 0x402501
push str._APPDATA_
push ecx
call fcn.0042df98
add esp, 8
cmp eax, ebx
je 0x402501
sub eax, dword [esp + 0x18]
sar eax, 1
mov esi, eax
cmp esi, 0xffffffff
je 0x402501
push 0x206
lea edx, [esp + 0x662]
xor ecx, ecx
push ebx
push edx
mov word [esp + 0x668], cx
call fcn.0042fb00
add esp, 0xc
push ebx
push 0x1a
lea eax, [esp + 0x664]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
add esi, 9
push esi
lea ecx, [esp + 0x18]
push ecx
lea ecx, [esp + 0x20]
call fcn.00405220
mov byte [esp + 0x1690], 3
mov edx, dword [eax]
push edx
lea eax, [esp + 0x660]
push eax
lea ecx, [esp + 0x2c]
push str._s_s
push ecx
call fcn.00406360
mov byte [esp + 0x16a0], 1
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
add esp, 0x10
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x402501
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x2c]
push ecx
call fcn.00405340
push 0x206
lea eax, [esp + 0xc7a]
xor edx, edx
push ebx
mov byte [esp + 0x1698], 4
push eax
mov word [esp + 0xc80], dx
call fcn.0042fb00
add esp, 0xc
mov dword [esp + 0x28], 1
mov ecx, dword [esp + 0x28]
push ecx
push str.platform_Game_d
lea edx, [esp + 0xc7c]
call fcn.00405e60
push 0x7fe
lea eax, [esp + 0xe8a]
xor edx, edx
push ebx
push eax
mov word [esp + 0xe90], dx
call fcn.0042fb00
add esp, 0x14
push 0x206
lea edx, [esp + 0x662]
xor ecx, ecx
push ebx
push edx
mov word [esp + 0x668], cx
call fcn.0042fb00
add esp, 0xc
lea eax, [esp + 0x864]
push eax
push 0x400
lea ecx, [esp + 0xe84]
push ecx
lea edx, [esp + 0xc80]
push edx
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileSectionW]
lea eax, [esp + 0xe7c]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4025c0
sub eax, edx
sar eax, 1
je 0x40280d
lea edi, [esp + 0xe7c]
lea esp, [esp]
call fcn.0041160a
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
je 0x402399
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
mov byte [esp + 0x1690], 5
cmp edi, ebx
jne 0x402614
xor eax, eax
jmp 0x40262f
mov eax, edi
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x402620
sub eax, edx
sar eax, 1
push eax
push edi
lea ecx, [esp + 0x1c]
call fcn.00406a40
mov esi, dword [esp + 0x14]
mov eax, dword [esi - 0xc]
cmp eax, ebx
je 0x4027d5
lea edi, [edi + eax*2 + 2]
call fcn.0041160a
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
je 0x402399
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x1c], eax
mov byte [esp + 0x1690], 6
call fcn.0041160a
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
je 0x402399
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x20], eax
push 0x3d
push ebx
push esi
lea ecx, [esp + 0x28]
push ecx
mov byte [esp + 0x16a0], 7
call fcn.0041158d
push 0x3d
push 1
push esi
lea edx, [esp + 0x2c]
push edx
call fcn.0041158d
mov eax, dword [esp + 0x1c]
push str.AppName
push eax
call fcn.0042dea5
add esp, 8
cmp eax, ebx
jne 0x402773
mov ecx, dword [esp + 0x20]
push ecx
lea edx, [esp + 0x660]
push 0x104
push edx
call fcn.0042d97f
add esp, 0xc
mov byte [esp + 0x1690], 6
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40271e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x1690], 5
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402746
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
mov byte [esp + 0x1690], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4025e0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x4025e0
lea ecx, [esp + 0x65c]
push ecx
lea edx, [esp + 0x48]
push 0x104
push edx
call fcn.0042d97f
mov eax, dword [esp + 0x28]
add esp, 0xc
push eax
lea ecx, [esp + 0x250]
push 0x104
push ecx
call fcn.0042d97f
mov edx, dword [esp + 0x2c]
add esp, 0xc
push edx
lea eax, [esp + 0x458]
push 0x104
push eax
call fcn.0042d97f
add esp, 0xc
lea ecx, [esp + 0x44]
push ecx
lea edx, [esp + 0x30]
push edx
call fcn.004053a0
jmp 0x4026f6
lea eax, [esi - 0x10]
mov byte [esp + 0x1690], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4027f9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x28]
inc eax
cmp eax, 0xc7
mov dword [esp + 0x28], eax
jl 0x40253b
mov ecx, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
sub ecx, esi
mov eax, 0xa80a80a9
imul ecx
add edx, ecx
sar edx, 0xa
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
je 0x40283f
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x2c]
push edx
push eax
call fcn.004028e0
mov esi, dword [esp + 0x38]
cmp esi, ebx
je 0x40284c
push esi
call fcn.00411132
add esp, 4
mov ecx, dword [esp + 0x2c]
push ecx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], ebx
call fcn.00411132
mov byte [esp + 0x1694], bl
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
add esp, 4
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40288c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x1690], 0xffffffff
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4028b7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, 1
mov ecx, dword [esp + 0x1688]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1670]
xor ecx, esp
call fcn.0042d791
mov esp, ebp
pop ebp
ret