Skip to content
Guest Big Announcement

Help to hook Unity string params on iOS

Featured Replies

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

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.