Function at 0x406240
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42176a
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
push ebx
push esi
push edi
mov eax, dword [0x4360c0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x14], ecx
mov eax, dword [0x4397e4]
cmp dword [eax - 0xc], 0
je 0x406281
mov eax, dword [0x4397cc]
cmp dword [eax - 0xc], 0
jne 0x406286
call fcn.00404960
lea ecx, [ebp - 0x54]
call fcn.004029e0
lea ecx, [ebp - 0x54]
mov dword [ebp - 4], 0
call fcn.00406650
or esi, 0xffffffff
test eax, eax
jne 0x4062ab
xor ebx, ebx
jmp 0x4065d8
mov eax, dword [0x436e84]
mov ecx, 0x436e84
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
mov byte [ebp - 4], 1
mov eax, dword [0x436e84]
mov ecx, 0x436e84
call dword [eax + 0xc]
lea edi, [eax + 0x10]
mov dword [ebp - 0x34], edi
mov byte [ebp - 4], 2
mov ebx, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x40]
test ebx, ebx
je 0x4062fb
cmp ebx, ecx
je 0x4062fb
mov eax, dword [ebx + 0x10]
cmp eax, ecx
je 0x4062fd
mov edi, edi
mov ebx, eax
mov eax, dword [ebx + 0x10]
cmp eax, ecx
jne 0x4062f0
jmp 0x4062fd
xor ebx, ebx
test ebx, ebx
je 0x406595
mov edx, ebx
mov dword [ebp - 0x28], edx
test ebx, ebx
jne 0x406312
xor ebx, ebx
jmp 0x406350
mov eax, dword [ebx + 0x14]
cmp eax, ecx
je 0x406331
mov ebx, eax
test ebx, ebx
je 0x40630e
mov eax, dword [ebx + 0x10]
cmp eax, ecx
je 0x406350
mov ebx, eax
mov eax, dword [ebx + 0x10]
cmp eax, ecx
jne 0x406326
jmp 0x406350
mov eax, dword [ebx + 0x18]
cmp eax, ecx
je 0x40634c
cmp ebx, dword [eax + 0x14]
jne 0x406348
mov ebx, eax
mov eax, dword [eax + 0x18]
cmp eax, ecx
jne 0x406338
jmp 0x40634c
cmp eax, ecx
jne 0x40634e
xor eax, eax
mov ebx, eax
push edx
lea eax, [ebp - 0x24]
push 0x4397e4
push eax
call fcn.00407340
add esp, 0xc
push str..qpyd
push eax
lea eax, [ebp - 0x20]
push eax
mov byte [ebp - 4], 3
call fcn.00407400
add esp, 0xc
mov byte [ebp - 4], 4
mov edx, dword [eax]
lea ecx, [esi - 0x10]
lea eax, [edx - 0x10]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], ecx
cmp eax, ecx
je 0x4063dc
cmp dword [ecx + 0xc], 0
lea esi, [ecx + 0xc]
jl 0x4063cd
mov eax, dword [eax]
cmp eax, dword [ecx]
jne 0x4063cd
push dword [ebp - 0x18]
call fcn.00407780
add esp, 4
mov dword [ebp - 0x18], eax
or ecx, 0xffffffff
lock xadd dword [esi], ecx
dec ecx
test ecx, ecx
jg 0x4063c5
mov esi, dword [ebp - 0x1c]
push esi
mov ecx, dword [esi]
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x18]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
jmp 0x4063dc
push dword [edx - 0xc]
lea ecx, [ebp - 0x10]
push edx
call fcn.00402320
mov esi, dword [ebp - 0x10]
mov byte [ebp - 4], 3
mov edx, dword [ebp - 0x20]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4063fd
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x24]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40641e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x406460
mov ecx, dword [ebp - 0x14]
mov eax, dword [ecx + 4]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x28], eax
cmp eax, dword [ecx + 8]
jb 0x40644c
inc eax
push eax
call fcn.004083e0
test al, al
je 0x40658b
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x1c]
mov eax, dword [ecx]
lea eax, [eax + edx*4]
mov dword [ebp - 0x1c], eax
mov byte [ebp - 4], 5
jmp 0x406569
push dword [ebp - 0x28]
lea eax, [ebp - 0x30]
push 0x4397cc
push eax
call fcn.00407340
add esp, 0xc
push str..qpyd
push eax
lea eax, [ebp - 0x2c]
push eax
mov byte [ebp - 4], 6
call fcn.00407400
add esp, 0xc
mov byte [ebp - 4], 7
mov edx, dword [eax]
lea ecx, [esi - 0x10]
lea eax, [edx - 0x10]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x1c], ecx
cmp eax, ecx
je 0x4064ee
cmp dword [ecx + 0xc], 0
lea esi, [ecx + 0xc]
jl 0x4064df
mov eax, dword [eax]
cmp eax, dword [ecx]
jne 0x4064df
push dword [ebp - 0x28]
call fcn.00407780
add esp, 4
mov dword [ebp - 0x28], eax
or ecx, 0xffffffff
lock xadd dword [esi], ecx
dec ecx
test ecx, ecx
jg 0x4064d7
mov esi, dword [ebp - 0x1c]
push esi
mov ecx, dword [esi]
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x28]
lea esi, [eax + 0x10]
mov dword [ebp - 0x10], esi
jmp 0x4064ee
push dword [edx - 0xc]
lea ecx, [ebp - 0x10]
push edx
call fcn.00402320
mov esi, dword [ebp - 0x10]
mov byte [ebp - 4], 6
mov edx, dword [ebp - 0x2c]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40650f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x30]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x406530
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40657f
mov ecx, dword [ebp - 0x14]
mov eax, dword [ecx + 4]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x1c], eax
cmp eax, dword [ecx + 8]
jb 0x40655a
inc eax
push eax
call fcn.004083e0
test al, al
je 0x40658b
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x28]
mov eax, dword [ecx]
lea eax, [eax + edx*4]
mov dword [ebp - 0x28], eax
mov byte [ebp - 4], 8
test eax, eax
je 0x406578
push esi
mov ecx, eax
call fcn.00407070
mov ecx, dword [ebp - 0x14]
mov byte [ebp - 4], 2
inc dword [ecx + 4]
test ebx, ebx
je 0x406595
mov ecx, dword [ebp - 0x40]
jmp 0x406305
push 0x8007000e
call fcn.00401e80
add edi, 0xfffffff0
mov ebx, 1
mov byte [ebp - 4], bl
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4065b7
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [esi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4065d5
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
or esi, 0xffffffff
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x38]
add edx, 0xfffffff0
mov ecx, esi
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4065fb
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x3c]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x406615
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebp - 0x54]
call fcn.00407b40
mov ecx, dword [ebp - 0x40]
test ecx, ecx
je 0x40662d
push ecx
call fcn.00413ac1
add esp, 4
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret