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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5ed4c8
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 0x4e7076
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x4e7094
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 0x4e709e
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 0x4e6b1a
mov eax, dword [ebx]
cmp dword [eax - 0xc], edi
jl 0x4e6b1a
push 0x604a70
push eax
call fcn.0058d0d6
add esp, 8
test eax, eax
je 0x4e6b1a
sub eax, dword [ebx]
sar eax, 1
cmp eax, 1
jne 0x4e6b1a
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 0x4e6b1a
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
or ebx, 0xffffffff
cmp dword [esi - 0xc], 0
jne 0x4e6d00
cmp dword [ebp + 0xc], 0
jne 0x4e6cfc
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 0x4e6b64
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 0x4e6c75
sub eax, edi
sar eax, 1
cmp eax, 0xffffffff
je 0x4e6c75
xor ebx, ebx
add eax, 1
cmovns ebx, eax
cmp ebx, dword [edi - 0xc]
jl 0x4e6bd0
add edi, 0xfffffff0
push edi
call fcn.004bfdc0
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x640], edi
jmp 0x4e6c41
mov eax, dword [ebp - 0x638]
mov ecx, dword [eax - 0x10]
test ecx, ecx
je 0x4e6be8
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x4e6bfe
call fcn.004b4040
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
test ecx, ecx
je 0x4e70a8
mov eax, dword [ecx]
push 2
push ebx
call dword [eax]
test eax, eax
je 0x4e70b2
lea edi, [eax + 0x10]
mov dword [ebp - 0x640], edi
test ebx, ebx
js 0x4e70c1
cmp ebx, dword [edi - 8]
jg 0x4e70c1
push ebx
push dword [ebp - 0x638]
xor eax, eax
mov dword [edi - 0xc], ebx
push ebx
push edi
mov word [edi + ebx*2], ax
call fcn.004b35d0
add esp, 0x10
lea eax, [ebp - 0x640]
mov byte [ebp - 4], 2
push eax
lea ecx, [ebp - 0x638]
call fcn.004bfcd0
or ebx, 0xffffffff
mov byte [ebp - 4], 1
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x4e6c75
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 0x4e6cfc
lea eax, [ebp - 0x638]
push eax
call fcn.004e6590
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 0x4e6cda
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 0x4e6cfc
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 0x4e6e89
lea ecx, [ebp - 0x638]
call fcn.004bd3a0
mov eax, dword [0x66ba50]
test al, 1
jne 0x4e6d51
or eax, 1
mov dword [0x66ba50], eax
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x4e70b7
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
push 0x5f7a00
mov dword [0x66ba4c], eax
call fcn.0050f1be
add esp, 4
mov eax, dword [0x66ba4c]
cmp dword [eax - 0xc], 0
jne 0x4e6db6
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 word [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4e6d90
sub ecx, edx
lea eax, [ebp - 0x428]
sar ecx, 1
push ecx
push eax
mov ecx, 0x66ba4c
call fcn.004c0470
mov eax, dword [0x66ba4c]
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 0x4e6dfc
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 0x4e6e83
lea eax, [ebp - 0x638]
push eax
call fcn.004e6590
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 0x4e6e61
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 0x4e6e83
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 0x4e7008
lea ecx, [ebp - 0x638]
call fcn.004bd3a0
mov eax, dword [0x66ba58]
test al, 1
jne 0x4e6ed8
or eax, 1
mov dword [0x66ba58], eax
call fcn.004b4040
mov ecx, eax
test ecx, ecx
je 0x4e70cb
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
push 0x5f7a20
mov dword [0x66ba54], eax
call fcn.0050f1be
add esp, 4
mov eax, dword [0x66ba54]
cmp dword [eax - 0xc], 0
jne 0x4e6f37
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 0x4e6f11
sub ecx, edx
lea eax, [ebp - 0x634]
sar ecx, 1
push ecx
push eax
mov ecx, 0x66ba54
call fcn.004c0470
mov eax, dword [0x66ba54]
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 0x4e6f7d
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 0x4e7008
lea eax, [ebp - 0x638]
push eax
call fcn.004e6590
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 0x4e6fe2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x63c]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push esi
call edi
test eax, eax
jne 0x4e700e
lea ecx, [ebp - 0x63c]
call fcn.004bd3a0
mov esi, dword [ebp - 0x63c]
jmp 0x4e700e
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp dword [esi - 0xc], 0
mov ebx, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
je 0x4e702a
push esi
call edi
test eax, eax
je 0x4e702a
push esi
call ebx
mov edi, eax
test edi, edi
jne 0x4e7036
mov eax, dword [ebp - 0x644]
push dword [eax]
call ebx
mov edi, eax
or ebx, 0xffffffff
mov byte [ebp - 4], 0
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4e7054
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 0x4e7076
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
call fcn.004b5400
push 0x80004005
call fcn.004b3510
push 0x80070057
call fcn.004b3510
push 0x80004005
call fcn.004b3510
int3