Function at 0x4bfe20
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5eae78
mov eax, dword fs:[0]
push eax
sub esp, 0x638
mov eax, dword [0x6670f4]
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 ebx, dword [ebp + 8]
xor edi, edi
mov dword [ebp - 0x644], ebx
mov eax, dword [ebx]
cmp dword [eax - 0xc], edi
je 0x4c0427
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x4c0445
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x638], eax
mov dword [ebp - 4], edi
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x4c044f
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x63c], esi
mov byte [ebp - 4], 1
cmp dword [esi - 0xc], edi
jne 0x4bfefa
mov eax, dword [ebx]
cmp dword [eax - 0xc], edi
jl 0x4bfefa
push 0x604a70
push eax
call fcn.0058d0d6
add esp, 8
test eax, eax
je 0x4bfefa
sub eax, dword [ebx]
sar eax, 1
cmp eax, 1
jne 0x4bfefa
push ebx
lea ecx, [ebp - 0x63c]
call fcn.004bfcd0
mov esi, dword [ebp - 0x63c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4bfefa
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
or ebx, 0xffffffff
cmp dword [esi - 0xc], 0
jne 0x4c00b2
cmp dword [ebp + 0xc], 0
jne 0x4c00ae
push 0x20c
lea eax, [ebp - 0x21c]
push 0
push eax
call fcn.0058c8f0
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]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4bff44
sub ecx, edx
lea eax, [ebp - 0x21c]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x638]
call fcn.004c0470
mov edi, dword [ebp - 0x638]
push 0x5c
push edi
call fcn.0058cb87
add esp, 8
test eax, eax
je 0x4c0027
sub eax, edi
sar eax, 1
cmp eax, 0xffffffff
je 0x4c0027
xor ecx, ecx
add eax, 1
cmovns ecx, eax
mov dword [ebp - 0x640], ecx
cmp ecx, dword [edi - 0xc]
jl 0x4bffb6
add edi, 0xfffffff0
push edi
call fcn.004bfdc0
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x640], edi
jmp 0x4bfff6
mov eax, dword [ebp - 0x638]
mov ecx, dword [eax - 0x10]
test ecx, ecx
je 0x4bffcc
mov eax, dword [ecx]
call dword [eax + 0x10]
test eax, eax
jne 0x4bffd8
call fcn.004b4040
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
push eax
push dword [ebp - 0x640]
lea ecx, [ebp - 0x640]
push dword [ebp - 0x638]
call fcn.004bfc50
mov edi, dword [ebp - 0x640]
lea eax, [ebp - 0x640]
mov byte [ebp - 4], 2
push eax
lea ecx, [ebp - 0x638]
call fcn.004bfcd0
mov byte [ebp - 4], 1
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x4c0027
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x638]
cmp dword [eax - 0xc], 0
je 0x4c00ae
lea eax, [ebp - 0x638]
push eax
call fcn.004bfd40
push dword [ebp - 0x644]
lea eax, [ebp - 0x638]
push eax
lea eax, [ebp - 0x640]
push eax
call fcn.004bc8d0
add esp, 0x10
push eax
lea ecx, [ebp - 0x63c]
mov byte [ebp - 4], 3
call fcn.004bfcd0
mov edx, dword [ebp - 0x640]
mov eax, ebx
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4c008c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x63c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4c00ae
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
cmp dword [esi - 0xc], 0
mov edi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
jne 0x4c0239
lea ecx, [ebp - 0x638]
call fcn.004bd3a0
mov eax, dword [0x66b0f0]
test al, 1
jne 0x4c0103
or eax, 1
mov dword [0x66b0f0], eax
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x4c0459
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
push 0x5f76f0
mov dword [0x66b0ec], eax
call fcn.0050f1be
add esp, 4
mov eax, dword [0x66b0ec]
cmp dword [eax - 0xc], 0
jne 0x4c0166
push 0x20c
lea eax, [ebp - 0x428]
push 0
push eax
call fcn.0058c8f0
add esp, 0xc
lea eax, [ebp - 0x428]
push 1
push 0x25
push eax
push 0
call edi
lea ecx, [ebp - 0x428]
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4c0140
sub ecx, edx
lea eax, [ebp - 0x428]
sar ecx, 1
push ecx
push eax
mov ecx, 0x66b0ec
call fcn.004c0470
mov eax, dword [0x66b0ec]
add eax, 0xfffffff0
push eax
call fcn.004bfdc0
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x640], edi
lea eax, [ebp - 0x640]
mov byte [ebp - 4], 4
push eax
lea ecx, [ebp - 0x638]
call fcn.004bfcd0
mov byte [ebp - 4], 1
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x4c01ac
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x638]
cmp dword [eax - 0xc], 0
je 0x4c0233
lea eax, [ebp - 0x638]
push eax
call fcn.004bfd40
push dword [ebp - 0x644]
lea eax, [ebp - 0x638]
push eax
lea eax, [ebp - 0x640]
push eax
call fcn.004bc8d0
add esp, 0x10
push eax
lea ecx, [ebp - 0x63c]
mov byte [ebp - 4], 5
call fcn.004bfcd0
mov edx, dword [ebp - 0x640]
mov eax, ebx
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4c0211
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x63c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4c0233
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
mov edi, dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
cmp dword [esi - 0xc], 0
jne 0x4c03bc
lea ecx, [ebp - 0x638]
call fcn.004bd3a0
mov eax, dword [0x66b0f8]
test al, 1
jne 0x4c0288
or eax, 1
mov dword [0x66b0f8], eax
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x4c0463
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
push 0x5f7710
mov dword [0x66b0f4], eax
call fcn.0050f1be
add esp, 4
mov eax, dword [0x66b0f4]
cmp dword [eax - 0xc], 0
jne 0x4c02e7
push 0x20c
lea eax, [ebp - 0x634]
push 0
push eax
call fcn.0058c8f0
add esp, 0xc
lea eax, [ebp - 0x634]
push 1
push 0x25
push eax
push 0
call edi
lea ecx, [ebp - 0x634]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4c02c1
sub ecx, edx
lea eax, [ebp - 0x634]
sar ecx, 1
push ecx
push eax
mov ecx, 0x66b0f4
call fcn.004c0470
mov eax, dword [0x66b0f4]
add eax, 0xfffffff0
push eax
call fcn.004bfdc0
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x640], edi
lea eax, [ebp - 0x640]
mov byte [ebp - 4], 6
push eax
lea ecx, [ebp - 0x638]
call fcn.004bfcd0
mov byte [ebp - 4], 1
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x4c032d
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x638]
cmp dword [eax - 0xc], 0
je 0x4c03b8
lea eax, [ebp - 0x638]
push eax
call fcn.004bfd40
push dword [ebp - 0x644]
lea eax, [ebp - 0x638]
push eax
lea eax, [ebp - 0x640]
push eax
call fcn.004bc8d0
add esp, 0x10
push eax
lea ecx, [ebp - 0x63c]
mov byte [ebp - 4], 7
call fcn.004bfcd0
mov edx, dword [ebp - 0x640]
mov eax, ebx
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4c0396
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x63c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4c03b8
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
cmp dword [esi - 0xc], 0
mov edi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
je 0x4c03de
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4c03de
push esi
call edi
mov edi, eax
test edi, edi
jne 0x4c03ea
mov edi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov eax, dword [ebp - 0x644]
push dword [eax]
call edi
mov edi, eax
mov byte [ebp - 4], 0
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4c0405
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x638]
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x4c0427
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.0050ed5c
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.004b3510
push 0x80004005
call fcn.004b3510
push 0x80004005
call fcn.004b3510
push 0x80004005
call fcn.004b3510
int3