DigitalKnight
Awesome Active Platinian
Hello Guys, Hope everyone is fine.
For some games, some of the functions require a enum or struct parameter in order to return an object. If the function would simply return a basic value eg int or float, it would be fine. But if it returns object, we do need a proper struct or enum passed as in or the function won't work
Example:
Suppose here is the function:
And here is the CurrencyType enum
Now the basic idea would be to call the function in the hook, get the instance of the return object, edit it's fields and return it back.
The problem is, i cannot pass in the enum as is because i have no idea how to get it's passed value
So far i have tried int, int*, void*, made my own similiar enum and did CurrencyType*. But in all cases, when i do try to read the value, it either crashes or returns a bogus value such as -1123234213. Same goes with struct, i have no idea how to pass them as is. Thanks for the help!
Edit: If the enum or structs are not passed in as is, the function won't return the object. And the game would always display 0 gems, coins etc
For some games, some of the functions require a enum or struct parameter in order to return an object. If the function would simply return a basic value eg int or float, it would be fine. But if it returns object, we do need a proper struct or enum passed as in or the function won't work
Example:
Suppose here is the function:
Code:
public BigInteger get_currency(CurrencyType _type) {} //0x___
And here is the CurrencyType enum
Code:
public enum CurrencyType
{
public int value_;
public const int Gems = 0;
public const int Coins = 1;
public const int Tickets = 2;
public const int Spins = 4;
}
Now the basic idea would be to call the function in the hook, get the instance of the return object, edit it's fields and return it back.
The problem is, i cannot pass in the enum as is because i have no idea how to get it's passed value
So far i have tried int, int*, void*, made my own similiar enum and did CurrencyType*. But in all cases, when i do try to read the value, it either crashes or returns a bogus value such as -1123234213. Same goes with struct, i have no idea how to pass them as is. Thanks for the help!
Edit: If the enum or structs are not passed in as is, the function won't return the object. And the game would always display 0 gems, coins etc