Function at 0x40be40
Capabilities:
Check if file exists
Create process on windows
Read .ini file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x52df75
mov eax, dword fs:[0]
push eax
sub esp, 0x22c
mov eax, dword [0x58e188]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
lea eax, [ebp + 8]
push str.open
push eax
mov dword [ebp - 4], 2
call fcn.00402630
mov edi, dword [sym.imp.USER32.dll_MessageBoxW]
add esp, 8
test al, al
je 0x40c1f8
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x216]
push edx
mov word [ebp - 0x218], cx
call fcn.00515860
mov eax, dword [ebp + 0xc]
add esp, 8
add eax, 0xfffffff0
mov dword [ebp - 0x220], esp
mov esi, esp
push eax
call fcn.00402000
add eax, 0x10
mov dword [esi], eax
lea eax, [ebp - 0x228]
add esp, 4
push eax
call fcn.00406240
mov eax, dword [ebp + 0x10]
add esp, 4
add eax, 0xfffffff0
mov dword [ebp - 0x220], esp
mov esi, esp
push eax
mov byte [ebp - 4], 3
call fcn.00402000
lea ecx, [ebp - 0x22c]
add esp, 4
add eax, 0x10
push ecx
mov dword [esi], eax
call fcn.00406240
mov edx, dword [ebp - 0x228]
push edx
lea eax, [ebp - 0x218]
push 0x104
push eax
mov byte [ebp - 4], 4
call fcn.00515a14
add esp, 0x14
cmp word [ebp - 0x216], 0x3a
jne 0x40bf40
lea ecx, [ebp - 0x218]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
jmp 0x40bf98
push ecx
mov ecx, esp
mov dword [ebp - 0x220], esp
push str._GamePath_
call fcn.00402730
lea edx, [ebp - 0x21c]
push edx
call fcn.00406240
mov eax, dword [eax]
push eax
lea eax, [ebp - 0x218]
push 0x104
push eax
call fcn.00515a14
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
add esp, 0x14
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40bf98
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea ecx, [ebp - 0x218]
push ecx
call esi
test eax, eax
je 0x40bfd4
mov eax, dword [ebp - 0x22c]
mov ecx, dword [ebp - 0x228]
push 1
lea edx, [ebp - 0x218]
push edx
push eax
push ecx
push 0x53ead0
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
jmp 0x40c093
push 0x1024
push 0x53f48c
push 0x53f4b0
push 0
call edi
cmp eax, 1
jne 0x40c093
push str.RunGame2.exe
lea ecx, [ebp - 0x21c]
call fcn.00402730
lea edx, [ebp - 0x21c]
push edx
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x220]
push ecx
mov byte [ebp - 4], 5
call fcn.00406e80
mov eax, dword [eax]
add esp, 0xc
push eax
call esi
mov esi, eax
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40c04a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
je 0x40c06d
mov edx, dword [ebp - 0x21c]
push 5
lea ecx, [ebp - 0x218]
push ecx
push 0
push edx
push 0x53ead0
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
mov eax, dword [ebp - 0x21c]
add eax, 0xfffffff0
mov byte [ebp - 4], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c093
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push str.none
lea ecx, [ebp - 0x224]
call fcn.00402730
lea ecx, [ebp - 0x224]
push ecx
push ecx
mov ecx, esp
mov dword [ebp - 0x230], esp
push str.State
mov byte [ebp - 4], 6
call fcn.00402730
mov eax, dword [0x58f980]
push ecx
add eax, 0xfffffff0
mov dword [ebp - 0x234], esp
mov esi, esp
push eax
mov byte [ebp - 4], 7
call fcn.00402000
add eax, 0x10
mov dword [esi], eax
add esp, 4
mov byte [ebp - 4], 6
call fcn.00407510
lea edx, [ebp - 0x224]
push 0x53e19c
push edx
call fcn.00402630
add esp, 0x14
test al, al
je 0x40c15e
push ecx
mov ecx, esp
mov dword [ebp - 0x234], esp
push str.SendMessage
call fcn.00402730
push ecx
mov ecx, esp
mov dword [ebp - 0x230], esp
push str.State
mov byte [ebp - 4], 8
call fcn.00402730
mov eax, dword [0x58f980]
push ecx
add eax, 0xfffffff0
mov dword [ebp - 0x238], esp
mov esi, esp
push eax
mov byte [ebp - 4], 9
call fcn.00402000
add eax, 0x10
mov dword [esi], eax
add esp, 4
mov byte [ebp - 4], 6
call fcn.00405fa0
add esp, 0xc
mov eax, dword [0x58f9b0]
push eax
push 0
push str.isAutoExit
push 0x53ebf4
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
cmp eax, 1
jne 0x40c186
mov ecx, dword [0x58f97c]
call fcn.00401e70
mov eax, dword [ebp - 0x224]
add eax, 0xfffffff0
mov byte [ebp - 4], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c1ac
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x22c]
add eax, 0xfffffff0
mov byte [ebp - 4], 3
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c1d2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x228]
add eax, 0xfffffff0
mov byte [ebp - 4], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c1f8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [ebp + 8]
push str.message
push ecx
call fcn.00402630
add esp, 8
test al, al
je 0x40c21e
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
push 0x1024
push edx
push eax
push 0
call edi
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov byte [ebp - 4], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c241
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c264
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp + 0x10]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c28a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00514c0e
mov esp, ebp
pop ebp
ret