Function at 0x40152b
Capabilities:
Check if file exists
Get common file path
Get file attributes
Get startup folder
Set file attributes

Disassembly:
push ebp
sub esp, 0x618
lea ebp, [esp - 4]
mov eax, dword [0x664e94]
xor eax, ebp
mov dword [ebp + 0x618], eax
push 0x18
mov eax, 0x5b7ac0
call fcn.0058f985
xor eax, eax
mov esi, 0x206
push esi
mov word [ebp], ax
xor ebx, ebx
lea eax, [ebp + 2]
push ebx
push eax
call fcn.0058fa90
xor eax, eax
push esi
mov word [ebp + 0x208], ax
lea eax, [ebp + 0x20a]
push ebx
push eax
call fcn.0058fa90
xor eax, eax
push esi
mov word [ebp + 0x410], ax
lea eax, [ebp + 0x412]
push ebx
push eax
call fcn.0058fa90
add esp, 0x24
call fcn.00496dcd
push eax
lea ecx, [ebp - 0x10]
call fcn.0040141e
push str.Cleaning_up_SAR_and_DB_files
mov dword [ebp - 4], ebx
xor edi, edi
call fcn.004437b6
pop ecx
lea ecx, [ebp - 0x24]
call fcn.004964e5
push str.rxc.db
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x24]
mov byte [ebp - 4], 1
call fcn.00496bdc
push str.sarlicense11.dat
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x24]
call fcn.00496bdc
push str.rxc12OEM.db
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x24]
call fcn.00496bdc
push str.sarlicense12OEM.dat
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x24]
call fcn.00496bdc
push str.rxc13.db
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x24]
call fcn.00496bdc
push str.sarlicense13.dat
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x24]
call fcn.00496bdc
lea eax, [ebp]
push eax
push ebx
push ebx
push 0x23
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jl 0x40171b
mov esi, dword [sym.imp.SHLWAPI.dll_PathCombineW]
push str.Sonic
lea eax, [ebp]
push eax
lea eax, [ebp + 0x208]
push eax
call esi
lea eax, [ebp + 0x208]
push eax
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
je 0x401714
cmp dword [ebp - 0x1c], ebx
jle 0x401704
push edi
lea ecx, [ebp - 0x24]
call fcn.00446d5b
push dword [eax]
lea eax, [ebp + 0x208]
push eax
lea eax, [ebp + 0x410]
push eax
call esi
lea eax, [ebp + 0x410]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4016cf
lea eax, [ebp + 0x410]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
and eax, 0xfffffffc
push eax
lea eax, [ebp + 0x410]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push dword [ebp + 0x624]
lea eax, [ebp + 0x410]
push eax
call fcn.004164bb
pop ecx
pop ecx
jmp 0x4016fa
push edi
lea ecx, [ebp - 0x24]
call fcn.00446d5b
lea ecx, [ebp + 0x410]
push ecx
push dword [eax]
lea eax, [ebp - 0x10]
push str.____s_could_not_be_found_using_path:__s
push eax
call fcn.00401518
push dword [ebp - 0x10]
call fcn.004437b6
add esp, 0x14
inc edi
cmp edi, dword [ebp - 0x1c]
jl 0x40166f
lea eax, [ebp + 0x208]
push ebx
push eax
call fcn.00416257
pop ecx
jmp 0x401725
push str.___The_Sonic_folder_does_not_exist
jmp 0x401720
push str.___Could_not_retrieve_the_value_of_CSIDL_COMMON_APPDATA
call fcn.004437b6
pop ecx
lea ecx, [ebp - 0x24]
mov byte [ebp - 4], bl
call fcn.004968d3
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffff0
call fcn.00401019
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x618]
xor ecx, ebp
call fcn.0058f976
add ebp, 0x61c
leave
ret 4