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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53b495
mov eax, dword fs:[0]
push eax
sub esp, 0x238
mov eax, dword [0x59a0a0]
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, ecx
mov dword [ebp - 0x240], ebx
call fcn.00401980
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x506582
push 0x80004005
call fcn.00401b40
mov eax, dword [edx]
mov esi, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x506597
lock inc dword [edx + 0x14]
lea eax, [edx + 8]
jmp 0x50659b
mov ecx, edx
call esi
lea esi, [eax + 0x10]
mov dword [ebp - 0x23c], esi
push 0x208
lea eax, [ebp - 0x218]
mov dword [ebp - 4], 0
push 0
push eax
call fcn.0049e130
add esp, 0xc
lea eax, [ebp - 0x218]
push 1
push 0x1a
push eax
push dword [ebx + 4]
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x506625
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x23c]
push 0x565818
push eax
call fcn.004023f0
mov esi, dword [ebp - 0x23c]
add esp, 0xc
push esi
call ebx
test eax, eax
jne 0x506625
push ecx
mov edi, esp
lea ecx, [esi - 0x10]
mov dword [ebp - 0x238], edi
call fcn.004021e0
add eax, 0x10
mov dword [edi], eax
call fcn.004e1680
add esp, 4
push 0x565868
lea edx, [ebp - 0x23c]
lea ecx, [ebp - 0x234]
call fcn.00401d60
add esp, 4
mov byte [ebp - 4], 1
push dword [ebp - 0x234]
call ebx
test eax, eax
je 0x5066a1
mov ecx, dword [ebp - 0x234]
call fcn.004c6030
test eax, eax
je 0x5066a1
push ecx
mov ecx, esp
mov dword [ebp - 0x238], esp
push dword [0x59aba4]
call fcn.00401ff0
push ecx
mov byte [ebp - 4], 2
mov edi, esp
mov ecx, dword [ebp - 0x234]
mov dword [ebp - 0x244], edi
lea ecx, [ecx - 0x10]
call fcn.004021e0
add eax, 0x10
mov dword [edi], eax
mov byte [ebp - 4], 1
call fcn.004dcae0
add esp, 8
test eax, eax
jne 0x5066c5
mov ecx, dword [ebp - 0x240]
mov edx, 0x6e
push 0x56577c
push dword [ebp - 0x234]
mov ecx, dword [ecx + 0x3f0]
call fcn.004e1010
add esp, 8
xor eax, eax
mov dword [ebp - 0x21c], 7
mov word [ebp - 0x230], ax
mov eax, dword [ebp - 0x234]
mov dword [ebp - 0x220], 0
cmp word [eax], 0
jne 0x5066f2
xor edx, edx
jmp 0x506706
mov edx, eax
lea edi, [edx + 2]
mov cx, word [edx]
add edx, 2
test cx, cx
jne 0x5066f7
sub edx, edi
sar edx, 1
push edx
push eax
lea ecx, [ebp - 0x230]
call fcn.00405040
mov byte [ebp - 4], 3
call fcn.0044c609
sub esp, 8
lea ecx, [ebp - 0x230]
push ecx
mov ecx, eax
call fcn.0044c084
mov byte [ebp - 4], 1
mov ebx, eax
mov ecx, dword [ebp - 0x21c]
mov dword [ebp - 0x238], ebx
cmp ecx, 8
jb 0x506757
inc ecx
push ecx
push dword [ebp - 0x230]
lea ecx, [ebp - 0x230]
call fcn.00403010
push ebx
xor eax, eax
mov dword [ebp - 0x21c], 7
push str.GameDownload::CMainUI::InitDataReport
push str.__s__Result__d_
mov dword [ebp - 0x220], 0
mov word [ebp - 0x230], ax
call fcn.004e78a0
push eax
call fcn.004e76a0
mov byte [ebp - 4], 0
or edi, 0xffffffff
mov ecx, dword [ebp - 0x234]
add esp, 0x10
add ecx, 0xfffffff0
mov eax, edi
lock xadd dword [ecx + 0xc], eax
dec eax
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
test eax, eax
jg 0x5067de
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov ebx, dword [eax + 4]
mov dword [ebp - 0x240], ebx
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x5067d6
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call ebx
jmp 0x5067de
mov ecx, edx
call dword [ebp - 0x240]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], edi
dec edi
test edi, edi
jg 0x50680f
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x50680d
mov eax, dword [ecx + 4]
push 0
push dword [eax + 4]
call ebx
jmp 0x50680f
call edx
mov eax, dword [ebp - 0x238]
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.0049aa22
mov esp, ebp
pop ebp
ret