Function at 0x589950
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5b0409
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x614040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x2c], 0
mov dword [ebp - 4], 0
push dword [ebp + 8]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
or edi, 0xffffffff
lea ebx, [edi + 2]
test eax, eax
je 0x589d00
mov eax, dword [ebp + 8]
cmp dword [eax - 0xc], 0xfc
jle 0x589b49
mov eax, dword [0x61fa68]
test eax, eax
je 0x5899c6
push 0x50020
push dword [0x61feb8]
call eax
push dword [ebp + 8]
cmp eax, 0xff1
setne byte [ebp - 0x20]
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push 0x5e7bb0
lea ecx, [ebp - 0x14]
mov esi, eax
call fcn.00402f60
lea edx, [ebp - 0x14]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x10]
call fcn.0058b300
mov byte [ebp - 4], 3
mov ecx, edi
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x589a16
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0x20]
lea edx, [ebp - 0x10]
lea ecx, [ebp - 0x20]
call fcn.0058ab50
add esp, 4
push eax
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 4
call fcn.004032d0
mov byte [ebp - 4], 3
mov ecx, edi
mov edx, dword [ebp - 0x20]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x589a54
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x10]
mov edx, ebx
mov ecx, dword [eax - 8]
sub edx, dword [eax - 4]
sub ecx, 0x104
or ecx, edx
jge 0x589a79
push 0x104
lea ecx, [ebp - 0x10]
call fcn.00402c20
mov eax, dword [ebp - 0x10]
push esi
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp + 8]
lea edx, [ecx - 0x10]
lea esi, [eax - 0x10]
cmp edx, esi
je 0x589ade
cmp dword [esi + 0xc], 0
lea ebx, [esi + 0xc]
jl 0x589aca
mov eax, dword [edx]
cmp eax, dword [esi]
jne 0x589aca
push edx
call fcn.00403660
add esp, 4
mov dword [ebp - 0x20], eax
mov ecx, edi
lock xadd dword [ebx], ecx
dec ecx
test ecx, ecx
jg 0x589ac2
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x20]
add eax, 0x10
mov dword [ebp + 8], eax
jmp 0x589ad9
push dword [ecx - 0xc]
push ecx
lea ecx, [ebp + 8]
call fcn.004035a0
mov eax, dword [ebp + 8]
mov ebx, 1
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x589b29
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
push eax
call fcn.00403660
mov esi, dword [ebp - 0x1c]
add eax, 0x10
mov byte [ebp - 4], 0
add esp, 4
mov edx, dword [ebp - 0x10]
mov ecx, edi
add edx, 0xfffffff0
mov dword [esi], eax
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x589d80
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x589d80
mov byte [ebp - 4], 0
mov ecx, edi
mov edx, dword [ebp - 0x10]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x589b49
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp + 8]
call dword [sym.imp.SHLWAPI.dll_PathFindExtensionW]
push eax
lea ecx, [ebp - 0x18]
call fcn.00402f60
mov byte [ebp - 4], 5
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
push eax
call fcn.00403660
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x14], edi
mov byte [ebp - 4], 6
mov ecx, ebx
mov eax, dword [edi - 8]
sub ecx, dword [edi - 4]
sub eax, 0x104
or eax, ecx
jge 0x589b99
push 0x104
lea ecx, [ebp - 0x14]
call fcn.00402c20
mov edi, dword [ebp - 0x14]
push edi
call dword [sym.imp.SHLWAPI.dll_PathRemoveExtensionW]
push dword [edi - 8]
push edi
call fcn.00528e42
add esp, 8
test eax, eax
js 0x589d34
cmp eax, dword [edi - 8]
jg 0x589d34
xor ecx, ecx
mov dword [edi - 0xc], eax
mov word [edi + eax*2], cx
xor ebx, ebx
call fcn.00414eab
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
je 0x589d2a
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
push ebx
push edi
lea eax, [ebp - 0x10]
mov byte [ebp - 4], 7
push str._s__d_
push eax
call fcn.00402d50
mov eax, dword [ebp - 0x18]
lea ecx, [ebp - 0x10]
add esp, 0x10
push dword [eax - 0xc]
push eax
call fcn.00403430
mov esi, dword [ebp - 0x10]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x589c46
add esi, 0xfffffff0
mov byte [ebp - 4], 6
or ecx, 0xffffffff
lea eax, [esi + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x589c3b
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
inc ebx
cmp ebx, 0xf4240
jl 0x589bc8
jmp 0x589cc0
mov ecx, dword [ebp + 8]
lea ebx, [esi - 0x10]
add ecx, 0xfffffff0
mov dword [ebp - 0x24], ecx
cmp ebx, ecx
je 0x589ca5
cmp dword [ecx + 0xc], 0
lea eax, [ecx + 0xc]
mov dword [ebp - 0x20], eax
jl 0x589c99
mov eax, dword [ebx]
cmp eax, dword [ecx]
jne 0x589c99
push ebx
call fcn.00403660
mov edx, dword [ebp - 0x20]
add esp, 4
mov dword [ebp - 0x28], eax
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x589c91
mov esi, dword [ebp - 0x24]
push esi
mov ecx, dword [esi]
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x28]
add eax, 0x10
mov dword [ebp + 8], eax
jmp 0x589ca5
push dword [esi - 0xc]
lea ecx, [ebp + 8]
push esi
call fcn.004035a0
mov byte [ebp - 4], 6
lea eax, [ebx + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x589cc0
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
call dword [eax + 4]
lea edx, [edi - 0x10]
mov byte [ebp - 4], 5
or edi, 0xffffffff
lea eax, [edx + 0xc]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x589ce0
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov ecx, edi
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x589d00
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp + 8]
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi - 4], 0
mov ecx, eax
lea eax, [esi - 4]
jl 0x589d3e
cmp ecx, dword [esi - 0x10]
jne 0x589d3e
lea ebx, [esi - 0x10]
mov ecx, 1
lock xadd dword [eax], ecx
inc ecx
jmp 0x589d78
push 0x80004005
call fcn.00402740
push 0x80070057
call fcn.00402740
mov eax, dword [ecx]
push 2
push dword [esi - 0xc]
call dword [eax]
mov ebx, eax
test ebx, ebx
jne 0x589d52
call fcn.00402c80
mov eax, dword [esi - 0xc]
mov dword [ebx + 4], eax
mov ecx, dword [esi - 0xc]
lea eax, [ecx*2 + 2]
push eax
lea eax, [ecx*2 + 2]
push esi
push eax
lea eax, [ebx + 0x10]
push eax
call fcn.00528cf5
add esp, 0x10
mov esi, dword [ebp - 0x1c]
lea eax, [ebx + 0x10]
mov dword [esi], eax
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], edi
dec edi
test edi, edi
jg 0x589da1
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret