Function at 0x40f180
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x421f53
mov eax, dword fs:[0]
push eax
sub esp, 0x224
mov eax, dword [0x4360c0]
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 dword [ebp - 0x228], edx
push ecx
lea ecx, [ebp - 0x22c]
call fcn.00407070
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x22c]
xor edi, edi
or ebx, 0xffffffff
cmp dword [eax - 0xc], edi
je 0x40f65a
mov eax, dword [0x436e84]
mov ecx, 0x436e84
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x220], eax
mov byte [ebp - 4], 1
mov eax, dword [0x436e84]
mov ecx, 0x436e84
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x224], esi
mov byte [ebp - 4], 2
cmp dword [esi - 0xc], edi
jne 0x40f5ec
mov eax, dword [ebp - 0x22c]
cmp dword [eax - 0xc], edi
jl 0x40f276
push 0x433090
push eax
call fcn.00413fef
add esp, 8
test eax, eax
je 0x40f276
sub eax, dword [ebp - 0x22c]
sar eax, 1
cmp eax, 1
jne 0x40f276
lea eax, [ebp - 0x22c]
push eax
lea ecx, [ebp - 0x224]
call fcn.00407120
mov esi, dword [ebp - 0x224]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40f276
lea ecx, [ebp - 0x224]
call fcn.004023e0
mov esi, dword [ebp - 0x224]
cmp dword [esi - 0xc], 0
jne 0x40f5ec
cmp dword [ebp - 0x228], 0
jne 0x40f3e0
xor eax, eax
push 0x20a
push eax
mov word [ebp - 0x21c], ax
lea eax, [ebp - 0x21a]
push eax
call fcn.00414e20
add esp, 0xc
lea eax, [ebp - 0x21c]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [ebp - 0x21c]
lea edx, [ecx + 2]
jmp 0x40f2d0
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f2d0
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [ebp - 0x21c]
push eax
lea ecx, [ebp - 0x220]
call fcn.00402320
mov edi, dword [ebp - 0x220]
push 0x5c
push edi
call fcn.00413f49
add esp, 8
test eax, eax
je 0x40f357
sub eax, edi
sar eax, 1
cmp eax, 0xffffffff
je 0x40f357
inc eax
push eax
lea eax, [ebp - 0x228]
push eax
lea ecx, [ebp - 0x220]
call fcn.0040f6a0
push eax
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 3
call fcn.00407120
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x228]
add edx, 0xfffffff0
mov ecx, ebx
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f357
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x220]
cmp dword [eax - 0xc], 0
je 0x40f3e0
lea ecx, [ebp - 0x220]
call fcn.0040ef60
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x228]
push eax
call fcn.00407340
add esp, 0xc
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 4
call fcn.00407120
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x228]
add edx, 0xfffffff0
mov ecx, ebx
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f3be
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x224]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40f3e0
lea ecx, [ebp - 0x224]
call fcn.004023e0
mov esi, dword [ebp - 0x224]
cmp dword [esi - 0xc], 0
jne 0x40f5ec
lea ecx, [ebp - 0x220]
call fcn.004023e0
lea ecx, [ebp - 0x228]
call fcn.0040efa0
push eax
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 5
call fcn.00407120
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x228]
add edx, 0xfffffff0
mov ecx, ebx
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f433
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0x220]
mov eax, dword [edi - 0xc]
test eax, eax
je 0x40f4df
jle 0x40f46d
lea ecx, [eax - 1]
test ecx, ecx
js 0x40f5e2
cmp ecx, eax
jg 0x40f5e2
cmp word [edi + ecx*2], 0x5c
je 0x40f46d
push 0x5c
lea ecx, [ebp - 0x220]
call fcn.00402140
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x228]
push eax
call fcn.00407340
add esp, 0xc
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 6
call fcn.00407120
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x228]
add edx, 0xfffffff0
mov ecx, ebx
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f4bd
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x224]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40f4df
lea ecx, [ebp - 0x224]
call fcn.004023e0
mov esi, dword [ebp - 0x224]
cmp dword [esi - 0xc], 0
jne 0x40f5ec
lea ecx, [ebp - 0x220]
call fcn.004023e0
lea ecx, [ebp - 0x228]
call fcn.0040f090
push eax
lea ecx, [ebp - 0x220]
mov byte [ebp - 4], 7
call fcn.00407120
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x228]
add edx, 0xfffffff0
mov ecx, ebx
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f532
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp - 0x220]
mov eax, dword [edi - 0xc]
test eax, eax
je 0x40f5ec
jle 0x40f56c
lea ecx, [eax - 1]
test ecx, ecx
js 0x40f5e2
cmp ecx, eax
jg 0x40f5e2
cmp word [edi + ecx*2], 0x5c
je 0x40f56c
push 0x5c
lea ecx, [ebp - 0x220]
call fcn.00402140
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x230]
push eax
call fcn.00407340
add esp, 0xc
push eax
lea ecx, [ebp - 0x224]
mov byte [ebp - 4], 8
call fcn.00407120
mov byte [ebp - 4], 2
mov edx, dword [ebp - 0x230]
add edx, 0xfffffff0
mov ecx, ebx
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f5bc
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x224]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push esi
call edi
test eax, eax
jne 0x40f5f2
lea ecx, [ebp - 0x224]
call fcn.004023e0
mov esi, dword [ebp - 0x224]
jmp 0x40f5f2
push 0x80070057
call fcn.00401e80
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp dword [esi - 0xc], 0
je 0x40f60c
push esi
call edi
test eax, eax
je 0x40f60c
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x40f61a
push dword [ebp - 0x22c]
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
add esi, 0xfffffff0
mov byte [ebp - 4], 1
lea eax, [esi + 0xc]
mov ecx, ebx
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f637
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x220]
add edx, 0xfffffff0
mov ecx, ebx
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f65a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x22c]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x40f67e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
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.00413156
mov esp, ebp
pop ebp
ret