Function at 0x408500
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4196cd
mov eax, dword fs:[0]
push eax
sub esp, 0x288
mov eax, dword [0x421030]
xor eax, esp
mov dword [esp + 0x280], eax
push ebx
push esi
push edi
mov eax, dword [0x421030]
xor eax, esp
push eax
lea eax, [esp + 0x298]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
mov dword [esp + 0x34], eax
mov eax, dword [edi]
cmp dword [eax - 0xc], 0
mov esi, edx
mov ebx, ecx
mov dword [esp + 0x20], esi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x24], 0
je 0x4088ad
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4088ad
mov eax, dword [edi]
push 0x5c
push eax
call fcn.0040abd6
add esp, 8
test eax, eax
jne 0x40858f
or eax, 0xffffffff
jmp 0x408593
sub eax, dword [edi]
sar eax, 1
lea ecx, [eax + 1]
lea esi, [esp + 0x14]
mov edx, edi
call fcn.004029c0
mov dword [esp + 0x2a0], 0
mov esi, dword [esp + 0x14]
push 0x2e
push esi
call fcn.0040abd6
add esp, 8
test eax, eax
jne 0x4085c4
or eax, 0xffffffff
jmp 0x4085c8
sub eax, esi
sar eax, 1
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x14]
call fcn.00401b70
lea edi, [esp + 0x14]
mov byte [esp + 0x2a0], 1
call fcn.00401b10
mov byte [esp + 0x2a0], 0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40860e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebx, dword [ebx + 0x30]
lea ecx, [esp + 0x18]
push ecx
call fcn.00406280
mov byte [esp + 0x2a0], 2
mov edx, dword [esp + 0x18]
mov eax, dword [edx - 0xc]
xor esi, esi
cmp eax, esi
jle 0x40864e
lea ecx, [eax - 1]
cmp ecx, esi
jl 0x40869d
cmp ecx, eax
jg 0x40869d
movzx eax, word [edx + ecx*2]
cmp ax, 0x5c
je 0x40864e
lea edi, [esp + 0x18]
call fcn.004023a0
lea eax, [esp + 0x18]
mov edi, eax
call fcn.00401b10
lea edx, [esp + 0x10]
push edx
mov ecx, 0x41bd08
call fcn.00401fd0
mov byte [esp + 0x2a0], 3
mov dword [esp + 0x1c], esi
cmp esi, 0x64
jge 0x4087b4
test esi, esi
je 0x4086a7
mov eax, dword [esp + 0x14]
push esi
push eax
push str._s_d.skn
lea edi, [esp + 0x1c]
call fcn.00403c40
add esp, 0xc
jmp 0x408731
push 0x80070057
call fcn.00401f50
lea ecx, [esp + 0x30]
push ecx
mov ecx, str..skn
call fcn.00401fd0
push eax
lea edx, [esp + 0x3c]
push edx
lea ebx, [esp + 0x1c]
mov byte [esp + 0x2a8], 4
call fcn.00401be0
add esp, 8
lea edi, [esp + 0x10]
mov byte [esp + 0x2a0], 5
call fcn.00401b10
mov byte [esp + 0x2a0], 4
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408709
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x2a0], 3
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408731
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x2c]
push edx
lea ebx, [esp + 0x20]
call fcn.00401be0
add esp, 8
lea edi, [esp + 0x10]
mov byte [esp + 0x2a0], 6
call fcn.00401b10
mov byte [esp + 0x2a0], 3
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408780
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x3c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
je 0x40879e
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
jmp 0x4087a6
mov dword [esp + 0x1c], 1
add esi, 1
cmp dword [esp + 0x1c], 0
je 0x408674
mov ecx, dword [esp + 0x10]
cmp dword [ecx - 0xc], 0
je 0x40881d
mov eax, dword [esp + 0x2c]
mov eax, dword [eax]
push ecx
push eax
call fcn.00401130
add esp, 8
test eax, eax
je 0x408811
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x3c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
je 0x408805
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
mov edi, dword [esp + 0x34]
lea eax, [esp + 0x10]
call fcn.00401b10
mov dword [esp + 0x24], 1
jmp 0x408830
push 0x41d830
mov ebx, 7
jmp 0x408827
push 0x41d840
mov ebx, 0xe
jmp 0x408827
push 0x41d860
mov ebx, 9
mov eax, dword [esp + 0x24]
call fcn.00401eb0
mov byte [esp + 0x2a0], 2
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408858
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x2a0], 0
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x408880
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x2a0], 0xffffffff
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4088be
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x4088be
push str.gb0R
mov ebx, 0xe
mov eax, esi
call fcn.00401eb0
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x298]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x280]
xor ecx, esp
call fcn.0040a953
mov esp, ebp
pop ebp
ret 8