How to patch a variable in dll from private to public remotely?

It does not work - I tried

TypeDefinition Useable = rustAssembly.MainModule.GetType("Useable"); Useable.GetMethod("Refresh").SetPublic(true); 

  • one
    Decompile the build, change, re-compile. - Alexander Petrov
  • I do not have the source code - gaming library Assembly-CSharp.dll - Azymok
  • To decompile , the source code will appear. - Alexander Petrov
  • 3
    If a variable is declared as private , then the library code reliably trusts it without constantly checking for accuracy and consistency. If you begin to change the closed variables, then with a very high probability you will desynchronize the state of various parts of the object or even a group of objects. This will lead to unpredictable work of the program as a whole. - ߊߚߤߘ
  • one
    1) Search for a description of .NET DLL, and especially metadata. Or 2) make two copies of a DLL from the same code, only in one variable to declare public and private in the other. Compare. Show the hypothesis that there is a 1-2 bit difference between private and public, and understand where they should be. Having understood, patch in the right place DLL. But if it is signed, then oops, the signature will be wrong. - Mark Shevchenko

0