Jump to content

2 posts in this topic

Recommended Posts

Posted

Hi guys, I have this Unity code

[Address(RVA = "0x2DFB948", Offset = "0x2DFB948", VA = "0x2DFB948")]
public void SendAdjustEvent(string adjustEventToken)
{
}

and another function to work as a pointer

[Address(RVA = "0x2E11424", Offset = "0x2E11424", VA = "0x2E11424")]
private void InitScore()
{
}

Then I tried to pass some string as adjustEventToken params like this in Ted2 menu mod:

#import "Macros.h"
#include <string>
/***********************************************************
  INSIDE THE FUNCTION BELOW YOU'LL HAVE TO ADD YOUR SWITCHES!
***********************************************************/
void (*SendAdjustEvent)(void *self, const char *event);
void new_SendAdjustEvent(void *self, const char *event){

  SendAdjustEvent(self, event);
}

void (*InitScore)(void *self);
void new_InitScore(void *self){
  InitScore(self);
  std::string gay = "laaa32";
  const char* param = gay.c_str();
  SendAdjustEvent(self, param);

}

void setup() {

HOOK(0x2DFB948, new_SendAdjustEvent, SendAdjustEvent);
HOOK(0x2E11424, new_InitScore, InitScore);
  // Empty switch - usefull with hooking
  [switches addSwitch:NSSENCRYPT("name")
    description:NSSENCRYPT("des")
  ];


}

But it keeping crash the app when InitScore is called. Can you show me what I was wrong and how to fix it?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines