Function at 0x489190
Capabilities:
Check if file exists
Get common file path
Get program files directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4dc189
mov eax, dword fs:[0]
push eax
sub esp, 0x264
mov eax, dword [0x51a3c4]
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
push 0x208
push 0
push 0x5223c8
call fcn.004a8e20
add esp, 0xc
call fcn.004762a0
mov ecx, eax
test ecx, ecx
je 0x489831
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x240], eax
mov eax, str.SoftwareMicrosoftWindowsCurrentVersionApp_Paths_
mov dword [ebp - 4], 0
lea ecx, [ebp - 0x240]
test eax, 0xffff0000
jne 0x489213
movzx eax, ax
push eax
call fcn.0047df50
jmp 0x48921f
push 0x34
push str.SoftwareMicrosoftWindowsCurrentVersionApp_Paths_
call fcn.00476770
push 0x4e098c
lea ecx, [ebp - 0x240]
mov dword [ebp - 4], 1
call fcn.00475c60
call fcn.004762a0
mov ecx, eax
test ecx, ecx
je 0x48983b
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x244], eax
mov byte [ebp - 4], 2
call fcn.004762a0
mov ecx, eax
test ecx, ecx
je 0x489845
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x234], eax
mov eax, str.Path
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x234]
test eax, 0xffff0000
jne 0x489295
movzx eax, ax
push eax
call fcn.0047df50
jmp 0x4892a1
push 4
push str.Path
call fcn.00476770
push 0x80000001
lea eax, [ebp - 0x244]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x234]
push eax
lea eax, [ebp - 0x240]
push eax
call fcn.00487910
mov edx, dword [ebp - 0x234]
or ebx, 0xffffffff
add esp, 0x10
mov byte [ebp - 4], 2
add edx, 0xfffffff0
mov eax, ebx
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4892eb
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0x244]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x489318
push dword [ebp - 0x244]
push 0x104
push 0x5223c8
call fcn.004b49a5
add esp, 0xc
jmp 0x4897d0
push 0x4e2088
lea eax, [ebp - 0x230]
mov ecx, 0x522640
push eax
call fcn.0048eeb0
cmp dword [ebp - 0x220], 0
je 0x489364
cmp dword [ebp - 0x21c], 8
lea eax, [ebp - 0x230]
jb 0x48934c
mov eax, dword [ebp - 0x230]
push eax
push 0x104
push 0x5223c8
call fcn.004b49a5
add esp, 0xc
jmp 0x48975f
mov dword [ebp - 0x250], 0
mov dword [ebp - 0x24c], 0
mov dword [ebp - 0x248], 0
push 0x14
mov byte [ebp - 4], 6
mov dword [ebp - 0x23c], 0
mov dword [ebp - 0x238], 0
call fcn.004a4277
mov dword [eax], eax
mov dword [eax + 4], eax
mov dword [eax + 8], eax
mov word [eax + 0xc], 0x101
mov dword [ebp - 0x23c], eax
lea eax, [ebp - 0x250]
mov byte [ebp - 4], 7
push eax
call fcn.00484080
mov eax, dword [ebp - 0x250]
add esp, 8
mov ecx, dword [ebp - 0x24c]
mov dword [ebp - 0x25c], eax
mov dword [ebp - 0x268], ecx
cmp eax, ecx
je 0x489607
mov edi, dword [eax]
mov ecx, dword [edi - 0x10]
lea esi, [edi - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi + 0xc], 0
mov ecx, eax
lea eax, [esi + 0xc]
jl 0x489409
cmp ecx, dword [esi]
jne 0x489409
lock inc dword [eax]
jmp 0x489460
mov eax, dword [ecx]
lea ebx, [esi + 4]
push 2
push dword [ebx]
call dword [eax]
mov esi, eax
test esi, esi
je 0x48985e
mov ecx, dword [ebx]
lea eax, [esi + 0x10]
mov dword [esi + 4], ecx
mov ecx, dword [ebx]
inc ecx
add ecx, ecx
je 0x48945d
test eax, eax
je 0x48944d
push ecx
test edi, edi
je 0x489442
push edi
push eax
call fcn.004a88a0
add esp, 0xc
jmp 0x48945d
push 0
push eax
call fcn.004a8e20
add esp, 0xc
call fcn.004b0efe
mov dword [eax], 0x16
call fcn.004aba6f
or ebx, 0xffffffff
lea eax, [esi + 0x10]
mov dword [ebp - 0x234], eax
lea eax, [ebp - 0x234]
mov byte [ebp - 4], 8
push eax
call fcn.00485110
add esp, 4
test eax, eax
je 0x4895cb
mov eax, dword [ebp - 0x23c]
xor ebx, ebx
mov ecx, eax
mov dword [ebp - 0x258], eax
mov dword [ebp - 0x254], ecx
mov edi, dword [eax + 4]
cmp byte [edi + 0xd], bl
jne 0x48951d
mov eax, dword [ebp - 0x234]
jmp 0x4894b0
mov dword [ebp - 0x264], edi
test eax, eax
je 0x489831
mov edx, dword [edi + 0x10]
mov ecx, eax
mov si, word [edx]
cmp si, word [ecx]
jne 0x4894e9
test si, si
je 0x4894e5
mov si, word [edx + 2]
cmp si, word [ecx + 2]
jne 0x4894e9
add edx, 4
add ecx, 4
test si, si
jne 0x4894c3
xor ecx, ecx
jmp 0x4894ee
sbb ecx, ecx
or ecx, 1
shr ecx, 0x1f
test cl, cl
je 0x489502
mov edi, dword [edi + 8]
xor ebx, ebx
mov ecx, dword [ebp - 0x254]
jmp 0x489511
mov ecx, edi
mov ebx, 1
mov edi, dword [edi]
mov dword [ebp - 0x254], ecx
cmp byte [edi + 0xd], 0
je 0x4894b0
mov edi, dword [ebp - 0x264]
cmp byte [ecx + 0xd], 0
jne 0x48954d
lea eax, [ecx + 0x10]
push eax
lea eax, [ebp - 0x234]
push eax
lea ecx, [ebp - 0x23c]
call fcn.0047f300
test al, al
je 0x4895c8
mov eax, dword [ebp - 0x23c]
mov dword [ebp - 0x258], eax
cmp dword [ebp - 0x238], 0xccccccc
je 0x489859
lea eax, [ebp - 0x23c]
mov dword [ebp - 0x270], eax
push 0x14
mov byte [ebp - 4], 9
mov dword [ebp - 0x26c], 0
call fcn.004a4277
mov esi, eax
add esp, 4
mov dword [ebp - 0x26c], esi
lea eax, [ebp - 0x234]
mov byte [ebp - 4], 0xa
lea ecx, [esi + 0x10]
push eax
call fcn.00477af0
mov eax, dword [ebp - 0x258]
lea ecx, [ebp - 0x23c]
push esi
mov dword [esi], eax
mov dword [esi + 4], eax
push ebx
mov dword [esi + 8], eax
push edi
mov word [esi + 0xc], 0
mov dword [ebp - 0x26c], 0
call fcn.00408240
or ebx, 0xffffffff
mov edx, dword [ebp - 0x234]
mov eax, ebx
mov byte [ebp - 4], 7
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4895ec
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x25c]
add eax, 4
mov dword [ebp - 0x25c], eax
cmp eax, dword [ebp - 0x268]
jne 0x4893e8
lea eax, [ebp - 0x23c]
push eax
lea eax, [ebp - 0x260]
push eax
call fcn.00484440
push 0x208
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 0xb
push 0
push eax
call fcn.004a8e20
add esp, 0x14
lea eax, [ebp - 0x218]
push 0
push 0x2a
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
mov eax, dword [ebp - 0x260]
mov ecx, dword [eax - 0xc]
test ecx, ecx
je 0x489664
js 0x48984f
mov ax, word [eax]
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x218]
push eax
push 0x104
push 0x5223c8
call fcn.004b49a5
mov edx, dword [ebp - 0x260]
add esp, 0xc
mov byte [ebp - 4], 7
add edx, 0xfffffff0
mov eax, ebx
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x48969e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x23c]
push dword [eax + 4]
lea eax, [ebp - 0x23c]
push eax
mov ecx, eax
call fcn.00475130
push 0x14
push dword [ebp - 0x23c]
call fcn.004a42a7
mov esi, dword [ebp - 0x250]
add esp, 8
mov byte [ebp - 4], 5
test esi, esi
je 0x48975f
mov edi, dword [ebp - 0x24c]
cmp esi, edi
je 0x489707
mov edx, dword [esi]
mov eax, ebx
sub edx, 0x10
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4896fa
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 4
cmp esi, edi
jne 0x4896e1
mov esi, dword [ebp - 0x250]
mov eax, dword [ebp - 0x248]
sub eax, esi
sar eax, 2
lea ecx, [eax*4]
mov eax, esi
cmp ecx, 0x1000
jb 0x489737
mov esi, dword [esi - 4]
add ecx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x489863
push ecx
push esi
call fcn.004a42a7
add esp, 8
mov dword [ebp - 0x250], 0
mov dword [ebp - 0x24c], 0
mov dword [ebp - 0x248], 0
push str.360GameAssistant
push 0x5223c8
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov edx, dword [ebp - 0x21c]
mov byte [ebp - 4], 2
cmp edx, 8
jb 0x4897b3
mov ecx, dword [ebp - 0x230]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4897a9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x489868
push edx
push ecx
call fcn.004a42a7
add esp, 8
xor eax, eax
mov dword [ebp - 0x220], 0
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
mov edx, dword [ebp - 0x244]
mov eax, ebx
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4897f1
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x240]
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x489813
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov al, 1
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.004a44be
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00475e90
push 0x80004005
call fcn.00475e90
push 0x80004005
call fcn.00475e90
push 0x80070057
call fcn.00475e90
call fcn.00408950
call fcn.004768c0
call fcn.004aba7f
call fcn.004aba7f
int3