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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4e057e
mov eax, dword fs:[0]
push eax
sub esp, 0x264
mov eax, dword [0x520404]
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 eax, dword [0x528084]
test eax, eax
jne 0x4917de
push 0x4e9488
push 0x2c
call fcn.004a7f94
add esp, 8
mov dword [ebp - 0x264], eax
mov dword [ebp - 4], 0
test eax, eax
je 0x4917d0
mov ecx, eax
call fcn.00484580
jmp 0x4917d2
xor eax, eax
mov dword [ebp - 4], 0xffffffff
mov dword [0x528084], eax
push str.initInstPath
push str.App___SetupHelper
push eax
call fcn.00484be0
push 0x208
push 0
push 0x5282f8
call fcn.004ac800
add esp, 0x18
call fcn.004782d0
mov ecx, eax
test ecx, ecx
je 0x491e43
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x244], eax
push str.SoftwareMicrosoftWindowsCurrentVersionApp_Paths360GameAssistant.exe
lea ecx, [ebp - 0x244]
mov dword [ebp - 4], 1
call fcn.00477ee0
test al, al
jne 0x49184c
push 0x48
push str.SoftwareMicrosoftWindowsCurrentVersionApp_Paths360GameAssistant.exe
lea ecx, [ebp - 0x244]
call fcn.00478540
mov dword [ebp - 4], 2
call fcn.004782d0
mov ecx, eax
test ecx, ecx
je 0x491e4d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x240], eax
mov byte [ebp - 4], 3
call fcn.004782d0
mov ecx, eax
test ecx, ecx
je 0x491e57
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x234], eax
push str.Path
lea ecx, [ebp - 0x234]
mov byte [ebp - 4], 4
call fcn.00477ee0
test al, al
jne 0x4918bb
push 4
push str.Path
lea ecx, [ebp - 0x234]
call fcn.00478540
push SysReAllocString
lea eax, [ebp - 0x240]
mov byte [ebp - 4], 5
push eax
lea eax, [ebp - 0x234]
push eax
lea eax, [ebp - 0x244]
push eax
call fcn.0048ff10
mov edx, dword [ebp - 0x234]
or ebx, 0xffffffff
add esp, 0x10
mov byte [ebp - 4], 3
add edx, 0xfffffff0
mov eax, ebx
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x491905
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0x240]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x491932
push dword [ebp - 0x240]
push 0x104
push 0x5282f8
call fcn.004b8555
add esp, 0xc
jmp 0x491de2
push 0x4e7a94
lea eax, [ebp - 0x230]
mov ecx, 0x528774
push eax
call fcn.00497370
cmp dword [ebp - 0x220], 0
je 0x49197e
cmp dword [ebp - 0x21c], 8
lea eax, [ebp - 0x230]
jb 0x491966
mov eax, dword [ebp - 0x230]
push eax
push 0x104
push 0x5282f8
call fcn.004b8555
add esp, 0xc
jmp 0x491d71
mov dword [ebp - 0x250], 0
mov dword [ebp - 0x24c], 0
mov dword [ebp - 0x248], 0
push 0x14
mov byte [ebp - 4], 7
mov dword [ebp - 0x23c], 0
mov dword [ebp - 0x238], 0
call fcn.004a7d07
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], 8
push eax
call fcn.0048bff0
mov eax, dword [ebp - 0x250]
add esp, 8
mov ecx, dword [ebp - 0x24c]
mov dword [ebp - 0x25c], eax
mov dword [ebp - 0x264], ecx
cmp eax, ecx
je 0x491c19
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 0x491a23
cmp ecx, dword [esi]
jne 0x491a23
lock inc dword [eax]
jmp 0x491a7a
mov eax, dword [ecx]
lea ebx, [esi + 4]
push 2
push dword [ebx]
call dword [eax]
mov esi, eax
test esi, esi
je 0x491e70
mov ecx, dword [ebx]
lea eax, [esi + 0x10]
mov dword [esi + 4], ecx
mov ecx, dword [ebx]
inc ecx
add ecx, ecx
je 0x491a77
test eax, eax
je 0x491a67
push ecx
test edi, edi
je 0x491a5c
push edi
push eax
call fcn.004ac280
add esp, 0xc
jmp 0x491a77
push 0
push eax
call fcn.004ac800
add esp, 0xc
call fcn.004b4a32
mov dword [eax], 0x16
call fcn.004af44f
or ebx, 0xffffffff
lea eax, [esi + 0x10]
mov dword [ebp - 0x234], eax
lea eax, [ebp - 0x234]
mov byte [ebp - 4], 9
push eax
call fcn.0048c890
add esp, 4
test eax, eax
je 0x491bdd
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 0x491b2f
mov eax, dword [ebp - 0x234]
mov dword [ebp - 0x268], edi
test eax, eax
je 0x491e43
mov edx, dword [edi + 0x10]
mov ecx, eax
mov si, word [edx]
cmp si, word [ecx]
jne 0x491afb
test si, si
je 0x491af7
mov si, word [edx + 2]
cmp si, word [ecx + 2]
jne 0x491afb
add edx, 4
add ecx, 4
test si, si
jne 0x491ad5
xor ecx, ecx
jmp 0x491b00
sbb ecx, ecx
or ecx, 1
shr ecx, 0x1f
test cl, cl
je 0x491b14
mov edi, dword [edi + 8]
xor ebx, ebx
mov ecx, dword [ebp - 0x254]
jmp 0x491b23
mov ecx, edi
mov ebx, 1
mov edi, dword [edi]
mov dword [ebp - 0x254], ecx
cmp byte [edi + 0xd], 0
je 0x491ac2
mov edi, dword [ebp - 0x268]
cmp byte [ecx + 0xd], 0
jne 0x491b5f
lea eax, [ecx + 0x10]
push eax
lea eax, [ebp - 0x234]
push eax
lea ecx, [ebp - 0x23c]
call fcn.00482710
test al, al
je 0x491bda
mov eax, dword [ebp - 0x23c]
mov dword [ebp - 0x258], eax
cmp dword [ebp - 0x238], 0xccccccc
je 0x491e6b
lea eax, [ebp - 0x23c]
mov dword [ebp - 0x270], eax
push 0x14
mov byte [ebp - 4], 0xa
mov dword [ebp - 0x26c], 0
call fcn.004a7d07
mov esi, eax
add esp, 4
mov dword [ebp - 0x26c], esi
lea eax, [ebp - 0x234]
mov byte [ebp - 4], 0xb
lea ecx, [esi + 0x10]
push eax
call fcn.0047aca0
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.00407e80
or ebx, 0xffffffff
mov edx, dword [ebp - 0x234]
mov eax, ebx
mov byte [ebp - 4], 8
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x491bfe
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 - 0x264]
jne 0x491a02
lea eax, [ebp - 0x23c]
push eax
lea eax, [ebp - 0x260]
push eax
call fcn.0048c3b0
push 0x208
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 0xc
push 0
push eax
call fcn.004ac800
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 0x491c76
js 0x491e61
mov ax, word [eax]
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x218]
push eax
push 0x104
push 0x5282f8
call fcn.004b8555
mov edx, dword [ebp - 0x260]
add esp, 0xc
mov byte [ebp - 4], 8
add edx, 0xfffffff0
mov eax, ebx
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x491cb0
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.00477990
push 0x14
push dword [ebp - 0x23c]
call fcn.004a7d37
mov esi, dword [ebp - 0x250]
add esp, 8
mov byte [ebp - 4], 6
test esi, esi
je 0x491d71
mov edi, dword [ebp - 0x24c]
cmp esi, edi
je 0x491d19
mov edx, dword [esi]
mov eax, ebx
sub edx, 0x10
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x491d0c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 4
cmp esi, edi
jne 0x491cf3
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 0x491d49
mov esi, dword [esi - 4]
add ecx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x491e75
push ecx
push esi
call fcn.004a7d37
add esp, 8
mov dword [ebp - 0x250], 0
mov dword [ebp - 0x24c], 0
mov dword [ebp - 0x248], 0
push str.GameAssistant
push 0x5282f8
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov edx, dword [ebp - 0x21c]
mov byte [ebp - 4], 3
cmp edx, 8
jb 0x491dc5
mov ecx, dword [ebp - 0x230]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x491dbb
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x491e7a
push edx
push ecx
call fcn.004a7d37
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 - 0x240]
mov eax, ebx
mov byte [ebp - 4], 2
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x491e03
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x244]
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x491e25
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.004a7f4e
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00477ec0
push 0x80004005
call fcn.00477ec0
push 0x80004005
call fcn.00477ec0
push 0x80070057
call fcn.00477ec0
call fcn.00408590
call fcn.00478690
call fcn.004af45f
call fcn.004af45f
int3