Function at 0x405820
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x46ce00
mov eax, dword fs:[0]
push eax
sub esp, 0x80
mov eax, dword [0x4860f0]
xor eax, esp
mov dword [esp + 0x78], eax
push ebx
push esi
push edi
mov eax, dword [0x4860f0]
xor eax, esp
push eax
lea eax, [esp + 0x90]
mov dword fs:[0], eax
lea esi, [esp + 0x18]
call fcn.0040cda0
push eax
lea eax, [esp + 0x14]
push eax
mov ebx, str.Config_
mov dword [esp + 0xa0], 0
call fcn.00405cd0
add esp, 8
mov byte [esp + 0x98], 2
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
or esi, 0xffffffff
lea ecx, [eax + 0xc]
mov edx, esi
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4058ae
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405980
push str.Config.xml
lea ecx, [esp + 0x14]
push ecx
mov eax, 0xa
call fcn.00405e40
lea edx, [esp + 0x1c]
push edx
call fcn.00406030
mov byte [esp + 0x98], 3
test byte [esp + 0x74], 0x30
jne 0x405919
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x38]
push eax
push ecx
lea edx, [esp + 0x7c]
lea ecx, [esp + 0x24]
call fcn.00411e70
add esp, 8
test al, al
je 0x405919
lea ebx, [esp + 0x1c]
call fcn.00412c50
test al, al
jne 0x405956
lea edx, [esp + 0x1c]
push edx
mov byte [esp + 0x9c], 2
call fcn.00411c50
mov dword [esp + 0x98], esi
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], esi
dec esi
test esi, esi
jg 0x4059a4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x405a6a
push ecx
mov eax, esp
lea edi, [esp + 0x20]
mov dword [esp + 0x18], esp
mov dword [eax], str.GameHallSetting
call fcn.00412290
test al, al
jne 0x4059ab
mov ecx, edi
push ecx
mov byte [esp + 0x9c], 2
call fcn.00411c50
mov dword [esp + 0x98], esi
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
lock xadd dword [edx], esi
dec esi
test esi, esi
jg 0x4059a4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x405a6a
push ecx
mov eax, esp
mov dword [eax], str.OpenLastGame
lea eax, [esp + 0x20]
mov dword [esp + 0x18], esp
call fcn.00412340
test al, al
jne 0x4059db
push 0x4000
push str.OpenLastGame
lea ecx, [esp + 0x24]
push ecx
xor ecx, ecx
call fcn.00414340
lea eax, [esp + 0x1c]
call fcn.00412b60
push 0
push ecx
mov eax, esp
lea esi, [esp + 0x24]
mov dword [esp + 0x1c], esp
mov dword [eax], str.enable
call fcn.00405fb0
mov eax, esi
call fcn.00412ba0
test byte [esp + 0x74], 0x30
je 0x405a0e
xor al, al
jmp 0x405a28
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x1c]
push edx
push eax
lea edx, [esp + 0x7c]
lea ecx, [esp + 0x40]
call fcn.004120b0
add esp, 8
lea ecx, [esp + 0x1c]
push ecx
movzx esi, al
mov byte [esp + 0x9c], 2
call fcn.00411c50
mov dword [esp + 0x98], 0xffffffff
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x405a68
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [esp + 0x90]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x78]
xor ecx, esp
call fcn.004567fb
mov esp, ebp
pop ebp
ret