I tried too many times search overall the forum, even Google, but still no hope, so I need modders can analyze this function that how to hook!
Example Code:
Then I wrote code C++ in Main.cpp and i fixed Class1, Enum1 that added 2 class Class1 and Enum1 C++ in project:
And Build and Running App then tried set slider in menu mod and crashed immediately!
Hope you all can help me solve this problem!
Example Code:
C#:
// Token: 0x06029FCC RID: 171980 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6029FCC")]
[Address(RVA = "0x2BC7B2C", Offset = "0x2BC7B2C", VA = "0x2BC7B2C")]
public float Method(Class1 class1, Enum1 enum1)
{
return 0f;
}
C++:
float (*old_Method)(void *instance, Class1 class1, Enum1 enum1);
float Method(void *instance, Class1 class1, Enum1 enum1) {
if (instance != NULL && value > 1) {
return (float) value;
}
return old_Method(instance, class1, enum1);
}
Hope you all can help me solve this problem!