// RVA: 0x16657f8 VA: 0x77a6ad07f8
public Void AddCoins(Int32 amount, CoinsEarnedMethod earnedMthod, Boolean storeBackup) { }
How did you hook?
void (*AddCoins)(void *instance, int amount, int earnedMthod, bool storeBackup);
bool (*_SpendCoins)(void *instance, int amount);
bool SpendCoins(void *instance, int amount) {
if(instance != NULL) {
AddCoins(instance, 5000, 1, true);
}
return _SpendCoins(instance, amount);
}
DobbyHook((void *)getAbsoluteAddress("libil2cpp.so", 0x1668ec4), (void *) SpendCoins, (void **) &_SpendCoins);
AddCoins = (void(*)(void *, int, int, bool))getAbsoluteAddress(targetLibName, 0x16657f8);
/*dump.cs:
// RVA: 0x16657f8 VA: 0x77a6ad07f8
public Void AddCoins(Int32 amount, CoinsEarnedMethod earnedMthod, Boolean storeBackup) { }
// RVA: 0x1668ec4 VA: 0x77a6ad3ec4
public Boolean SpendCoins(Int32 amount) { }
*/
Oh and you'll need to hook the addcoins function. No need for the other bool also
You can configure a button in LGL menu to call the function when pressed, yes.
If you already have the menu set up, you'll just have to add a button into the features array, like: OBFUSCATE("1_Button_Add Coins"). Then in the switches section you can put the function AddCoins(instance, 5000, 1, true); in the switch 1 so that it gets called when the button is pressed..
I don't think you need any example code. You just need a hook, like you've already done here, and you can figure out all the button and switch stuff with the examples in the LGL menu. Question is, do you have the menu set up?Can I have an example code?
Don't really understand how to use this. Also, it's not very clear how this can help with my question
This does exactly that. Makes a button which gives you coins when pressed.You can configure a button in LGL menu to call the function when pressed, yes.
If you already have the menu set up, you'll just have to add a button into the features array, like: OBFUSCATE("1_Button_Add Coins"). Then in the switches section you can put the function AddCoins(instance, 5000, 1, true); in the switch 1 so that it gets called when the button is pressed..
Maybe that's true, but I haven't figured out the codeThis does exactly that. Makes a button which gives you coins when pressed.
Thank you, of course, but there is a similar example in main.cpp in the lgl project. I wrote this hook with SpendCoins just to check if addcoins works, which it does when I spend coins. SpendCoins can be replaced with Start, for example, and then 5000 coins will be added each time the application starts. Your code does not implement coin increase when the button is pressed; it only activates/deactivates the coin increase when they are spent[Hidden content]
Same as int. Use int as the typeDoes Anyone know How to Hook Enum
And don't spam it on every thread possible thanksDoes Anyone know How to Hook Enum
"pro"? Thanks. But anyways, you can't change the enum itself, at least not in a easy way. You need to look for the properties (values in a class) that use that enum and hook those as int.Shut up pro If you're not helping me
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies