Function at 0x408580
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x413510
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push esi
push edi
mov eax, dword [0x41a018]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 4], 0
cmp dword [eax + 0x14], 0
je 0x408619
mov edx, dword [0x41a030]
mov eax, dword [edx + 0xc]
mov ecx, 0x41a030
call eax
add eax, 0x10
mov dword [ebp - 0x10], eax
mov bl, 1
mov byte [ebp - 4], bl
mov ecx, dword [ebp + 0xc]
push str.click_events.json
push ecx
push 0x416134
lea edi, [ebp - 0x10]
call fcn.0040af30
mov edi, dword [ebp - 0x10]
add esp, 0xc
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x408655
add edi, 0xfffffff0
mov byte [ebp - 4], al
lea edx, [edi + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x408619
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40863f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lea ecx, [ebp - 0x14]
push ecx
mov ecx, edi
call fcn.00408f80
mov byte [ebp - 4], 2
mov eax, dword [eax]
push eax
call fcn.004083f0
mov esi, eax
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
add esp, 4
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x408693
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor ebx, ebx
push 0xb4
mov dword [ebp - 0x20], ebx
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
cmp eax, ebx
je 0x40874c
mov dword [eax], eax
mov dword [ebp - 0x24], eax
mov dword [eax + 4], eax
lea ecx, [ebp - 0x24]
push ecx
mov ecx, esi
mov byte [ebp - 4], 3
call fcn.00407aa0
push esi
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
push ecx
mov edx, esp
mov dword [ebp - 0x14], esp
lea eax, [ebp - 0x24]
push eax
push edx
call fcn.004091e0
mov ecx, dword [ebp + 8]
push ecx
call fcn.00408780
lea ebx, [ebp - 0x24]
call fcn.004092a0
add edi, 0xfffffff0
mov byte [ebp - 4], 0
lea edx, [edi + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x40870d
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408733
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lea ecx, [ebp - 0x18]
push ecx
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x18], ebx
call dword [sym.imp.MSVCR100.dll_public:_void___thiscall_std::exception::constructor_char_const__const_const__]
push 0x416ea0
lea edx, [ebp - 0x30]
push edx
mov dword [ebp - 0x30], vtable.std::bad_alloc.0
call sub.MSVCR100.dll__CxxThrowException
int3