Function at 0x40a830
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4d0747
mov eax, dword fs:[0]
push eax
sub esp, 0xcc
mov eax, dword [0x508274]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov dword [ebp - 0x40], edi
mov dword [ebp - 4], 0
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x3c], 0
call fcn.0040a6b0
push 0
lea ecx, [ebp - 0x28]
push ecx
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x74]
cmp dword [eax + 0x14], 8
mov dword [ebp - 4], 1
jb 0x40a896
mov eax, dword [eax]
push eax
mov ecx, edi
call fcn.00406f60
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x3c], 1
mov byte [ebp - 4], 0
cmp edx, 8
jb 0x40a8e3
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40a8d9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40aada
push edx
push ecx
call fcn.00472ed3
add esp, 8
xor eax, eax
mov dword [ebp - 0x18], 0
mov word [ebp - 0x28], ax
lea eax, [ebp - 0x38]
push eax
mov dword [ebp - 0x14], 7
call fcn.004166a0
add esp, 4
mov ecx, dword [eax]
mov dword [ebp - 4], 2
mov eax, dword [ecx]
mov eax, dword [eax + 4]
call eax
mov esi, dword [ebp - 0x34]
or ebx, 0xffffffff
mov byte [ebp - 0x29], al
mov byte [ebp - 4], 0
test esi, esi
je 0x40a943
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x40a943
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x40a943
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
cmp byte [ebp - 0x29], 0
je 0x40a9d7
lea eax, [ebp - 0x38]
push eax
call fcn.004166a0
add esp, 4
mov edi, dword [eax]
lea ecx, [ebp - 0xd8]
mov dword [ebp - 4], 3
call fcn.00407490
mov esi, eax
push str.GetAppdataConfigPath:
push esi
mov byte [ebp - 4], 4
call fcn.00408a40
mov eax, dword [ebp - 0x30]
mov edx, 0x4dddd0
mov eax, dword [eax]
test eax, eax
cmovne edx, eax
push edx
push esi
call fcn.00406240
mov eax, dword [edi]
add esp, 0x10
mov ecx, edi
push esi
call dword [eax + 8]
lea ecx, [ebp - 0xd8]
call fcn.00408b90
mov esi, dword [ebp - 0x34]
mov byte [ebp - 4], 0
test esi, esi
je 0x40a9d4
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x40a9d4
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x40a9d4
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov edi, dword [ebp - 0x30]
cmp dword [ebp + 0xc], 0
je 0x40aaba
push dword [edi]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40aaba
lea eax, [ebp - 0x38]
push eax
call fcn.004166a0
add esp, 4
mov ecx, dword [eax]
mov dword [ebp - 4], 5
mov eax, dword [ecx]
mov eax, dword [eax + 4]
call eax
mov esi, dword [ebp - 0x34]
mov cl, al
mov byte [ebp - 0x29], cl
mov byte [ebp - 4], 0
test esi, esi
je 0x40aa3e
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x40aa3e
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lock xadd dword [esi + 8], ebx
dec ebx
jne 0x40aa3b
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov cl, byte [ebp - 0x29]
test cl, cl
je 0x40aa94
lea eax, [ebp - 0x38]
push eax
call fcn.004166a0
add esp, 4
mov edi, dword [eax]
lea ecx, [ebp - 0xd8]
mov dword [ebp - 4], 6
call fcn.00407490
mov esi, eax
push str.Create_Appdata_Config_file
push esi
mov byte [ebp - 4], 7
call fcn.00408a40
mov eax, dword [edi]
add esp, 8
mov ecx, edi
push esi
call dword [eax + 8]
lea ecx, [ebp - 0xd8]
call fcn.00408b90
lea ecx, [ebp - 0x38]
call fcn.004080f0
mov edi, dword [ebp - 0x30]
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push dword [edi]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x40aaba
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00473600
mov esp, ebp
pop ebp
ret 8
call fcn.004868f6
int3