Does vmp support method inline/flatten
Posted: Sat Dec 16, 2023 10:26 am
Hello, To protect our code away from Harmony, we want to use method inline/flatten
e.g.
------->
Harmony can patch methods and apply prefix/postfix modifications, making the result of GetInt unreliable. So we want to inline the method and virtulization the whole method to prevent patch.
Do you have any suggestion to protect against Harmony's Patch? (prevent patch for our code and System assembly)
P.S. Harmony: https://github.com/pardeike/Harmony
e.g.
Code: Select all
static void Main(string[] args)
{
var VAR = GetInt(1)
}
private static int GetInt(int x) // althrough we can use VMP's rename, but hacker can find the method through parameter ( they try to find a method that have 1 int parameter and patch it)
{
return x + 1; // maybe difficult logic here.
}
Code: Select all
static void Main(string[] args)
{
var VAR = 1 + 1;
}
Harmony can patch methods and apply prefix/postfix modifications, making the result of GetInt unreliable. So we want to inline the method and virtulization the whole method to prevent patch.
Do you have any suggestion to protect against Harmony's Patch? (prevent patch for our code and System assembly)
P.S. Harmony: https://github.com/pardeike/Harmony