CacheParser¶
CacheParser as the name implies is a record made to parse information from certain files that are part of the game cache.
preferences.dat is where most client settings are stored.
preferences2.dat I have no idea? some values in address 00000020 seem to change after some times has passed randomly. (related to 6h log maybe!?!?)
random.dat in the user home directory seems to be a random identifier generated the first time you open a client if it doesn’t exist. while it exists, it seems to never change unless the user deletes it.
Note
For more information check this file: https://github.com/open-osrs/runelite/blob/dd4478eff7d90fcb3e85584171d5836809eb150a/runescape-client/src/main/java/ClientPreferences.java
type TCacheParser¶
type
TCacheParser = record(TSRLBaseRecord)
Disabled: Boolean;
Directory: String;
Preferences: String;
Preferences2: String;
end;
Type responsible for handling cache parsing.
CacheParser.Setup¶
procedure TCacheParser.Setup();
Internal method called automatically simply by including WaspLib.
CacheParser.GetPreference¶
function TCacheParser.GetPreference(prefNumber: Int32 = 1): String;
Read the preference file specified.
CacheParser.Update¶
function TCacheParser.Update(): Boolean;
Method to check if the cache files were updated.
CacheParser.GetHexString¶
function TCacheParser.GetHexString(prefNumber: Int32 = 1): String;
Print the cache files as a hex string.
Example:
WriteLn CacheParser.GetHexString(1);
CacheParser.Print¶
procedure TCacheParser.Print(prefNumber: Int32 = 0);
Print the cache files as strings. This is only useful for debugging purposes.
Example:
CacheParser.Print();
CacheParser.GetOptionsAmount¶
function TCacheParser.GetOptionsAmount(): Int32;
Returns the number of options saved in the cache. This is not very useful, AFAIK there’s only 2 possible values for this: 0 and 10. 0 is only if you haven’t accepted the EULA in the client.
Example:
WriteLn CacheParser.GetOptionsAmount();
CacheParser.TitleMusicDisabled¶
function TCacheParser.TitleMusicDisabled(): Boolean;
Checks if the music is enabled in the login screen.
Example:
WriteLn CacheParser.TitleMusicDisabled();
CacheParser.WindowMode¶
function TCacheParser.WindowMode(): Int32;
Returns 1 for fixed mode and 2 for resizable mode. Resizable modern and resizable classic make no difference here.
Example:
WriteLn CacheParser.WindowMode();
CacheParser.GetAuthenticatorAmount¶
function TCacheParser.GetAuthenticatorAmount(): Int32;
Returns the number of authenticators saved for the next 30 days. If this is more than 0, you will have 8 bytes for each of the saved authenticators. This is important to know so we know where the saved username starts if we have saved authenticators.
Example:
WriteLn CacheParser.GetAuthenticatorAmount();
CacheParser.GetAuthenticators¶
function TCacheParser.GetAuthenticators(): TStringArray;
Returns each authenticator saved in a TStringArray. Each string is 8 bytes like mentioned in CacheParser.GetAuthenticatorAmount() documentation.
Example:
WriteLn CacheParser.GetAuthenticators();
CacheParser.GetUsernameIndex¶
function TCacheParser.GetUsernameIndex(): Int32;
Internal function that returns byte index where the username starts. This is required because depending on wether we have authenticators saved or not, the bytes shift.
CacheParser.GetUsername¶
function TCacheParser.GetUsername(): String;
Returns the saved username in the game cache. This is the username you clicked to save on the client when logging in.
Example:
WriteLn CacheParser.GetUsername();
CacheParser.UsernameEndIndex¶
function TCacheParser.UsernameEndIndex(): Int32;
Internal function used to get the index of the byte of where the username ends.
CacheParser.HideUsername¶
function TCacheParser.HideUsername(): Boolean;
Returns true or false if we have the username hidden.
Example:
WriteLn CacheParser.HideUsername();
CacheParser.Brightness¶
function TCacheParser.Brightness(): Int32;
Returns the brightness value converted to a 0-100 value.
Example:
WriteLn CacheParser.Brightness();
CacheParser.MusicVolume¶
function TCacheParser.MusicVolume(): Int32;
Returns the music volume value converted to a 0-100 value.
Example:
WriteLn CacheParser.MusicVolume();
CacheParser.SoundEffectsVolume¶
function TCacheParser.SoundEffectsVolume(): Int32;
Returns the sound effects volume value converted to a 0-100 value.
Example:
WriteLn CacheParser.SoundEffectsVolume();
CacheParser.AreaSoundVolume¶
function TCacheParser.AreaSoundVolume(): Int32;
Returns the area sound volume value converted to a 0-100 value.
Example:
WriteLn CacheParser.AreaSoundVolume();
CacheParser.Field1247¶
function TCacheParser.Field1247(): Int32;
I have absolutely no idea what this is. It’s supposedly something, but AFAIK it’s always 0.
Example:
WriteLn CacheParser.Field1247();
CacheParser.DisplayFPS¶
function TCacheParser.DisplayFPS(): Boolean;
Returns true/false if we have Display FPS enabled. Display FPS can be enabled by typing ::displayfps in game.
Example:
WriteLn CacheParser.DisplayFPS();
CacheParser.Field1238¶
function TCacheParser.Field1238(): Int32;
I have absolutely no idea what this is. It’s supposedly something, but AFAIK it’s always 0.
Example:
WriteLn CacheParser.Field1238();