Can static variables with get and set method bodies be modified with 3rd part memory editors

Me and a colleague of mine are in a disagreement regarding static variables. Let me give you the code first;

public int SomeRandomVariable {
    get => PlayerPrefs.GetInt("Variable", 50);
    set => PlayerPrefs.SetInt("Variable", value);
}

PlayerPrefs.GetInt() and PlayerPrefs.SetInt() are static methods that do some I/O process and brings back/sets integer.

Now for the disagreement;

  • I believe that "SomeRandomVariable" is calculated on the runtime and therefore it can't be modified/viewed by memory modifiers because of this scope.
  • He believes that "SomeRandomVariable" is cached therefore, it can be modified/viewed by memory modifiers because of this scope.


Read more here: https://stackoverflow.com/questions/67936459/can-static-variables-with-get-and-set-method-bodies-be-modified-with-3rd-part-me

Content Attribution

This content was originally published by Ümit Yayla at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: