Invoke doesn't work
Spiritcow opened this issue · comments
DynamicActionButtonSeparate.method("OnPress").implementation = function (value: boolean) {
console.log('OnPress called');
console.log(value);
console.log((this as Il2Cpp.Object).method("OnPress").virtualAddress);
this.method("OnPress").invoke(value);
}
Il2Cpp.gc.choose(DynamicActionButtonSeparate).forEach((instance: Il2Cpp.Object) => {
console.log('Captured');
console.log(instance.method("OnPress").virtualAddress);
instance.method("OnPress").invoke(true);
});
This is the signature.
[Token(Token = "0x60041ED")]
[Address(RVA = "0x1A59C14", Offset = "0x1A59C14", VA = "0x1A59C14", Slot = "6")]
protected override void OnPress(bool bPressed)
{
}
When i am doing this action from game, my hook works.
I have this hook. Inside hook OnPress method works fine. I can change the value and will see the effect. But then I try to invoke it - it doesn't work. But these methods have the same memory address.