Jump to content

Game crashes when using custom text switch


Enoch

23 posts in this topic

Recommended Posts

Posted

I'm using @Ted2's template and I got rid of all the compiling errors finally but when I press "play" to go into a match, the game crashes. Whenever I use the one patch switch, it works perfectly. Even if I don't open the menu with the custom text field switches, it crashes.

Does anyone know why it would be freezing? Maybe I messed something up below?

iPhone 8, 13.3.1

float(*old_get_PointsKillMultiplier)(void *this_);
float get_PointsKillMultiplier(void *this_) {

  float userAmount = [[switches getValueFromSwitch:@"Custom Points:"] floatValue];

  if([switches isSwitchOn:@"Custom Points:"]) {
    return userAmount;
  }
  return old_get_PointsKillMultiplier(this_);
}

float(*old_get_GemsRewardForKill)(void *this_);
float get_GemsRewardForKill(void *this_) {

  float userAmount = [[switches getValueFromSwitch:@"Custom Gems:"] floatValue];

  if([switches isSwitchOn:@"Custom Gems:"]) {
    return userAmount;
  }
  return old_get_GemsRewardForKill(this_);
}

void setup() {

//public float get_PointsKillMultiplier(); // RVA: 0x15AD440 Offset: 0x15AD440
  HOOK(0x1015AD440, get_PointsKillMultiplier, old_get_PointsKillMultiplier);

  //public float get_GemsRewardForKill(); // RVA: 0x15A9F84 Offset: 0x15A9F84
  HOOK(0x1015A9F84, get_GemsRewardForKill, old_get_GemsRewardForKill);

    [switches addTextfieldSwitch:@"Custom Points:"
                description:@"Here you can enter your own points amount!"
                  inputBorderColor:[UIColor colorWithRed:0.74 green:0.00 blue:0.00 alpha:1.0]];

    [switches addTextfieldSwitch:@"Custom Gems:"
                description:@"Here you can enter your own coins amount!"
                  inputBorderColor:[UIColor colorWithRed:0.74 green:0.00 blue:0.00 alpha:1.0]];                                                                                      
}

 

  • Replies 22
  • Created
  • Last Reply
Posted
3 minutes ago, Laxus said:

Jailbreak tool and device?

Forgot about that,

iPhone 8, 13.3.1

I'm not sure what you mean by "jailbreak tool". I'm just entering the above in the Tweak.xm and compiling in Theos.

Posted
5 minutes ago, GeTRoZ said:

Hello @ZoZo,

Why you have two


void setup() {

declarations ?

Added that one on top in the edit by accident. Took the top one out.

Posted
1 minute ago, Ted2 said:

Just look at your offsets. You’re not using the one you should, you made them up yourself.

Those are the offsets that were in the dump.cs.

Posted
1 hour ago, ZoZo said:

//public float get_GemsRewardForKill(); // RVA: 0x15A9F84 Offset: 0x15A9F84 HOOK(0x1015A9F84, get_GemsRewardForKill, old_get_GemsRewardForKill);

In that case you’re using comments incorrect, as it doesn’t make sense commenting unrelated offsets above a hook & then not comment the actual offset, lol.

 

Also, show how it looks like in IDA

Posted
13 minutes ago, Ted2 said:

In that case you’re using comments incorrect, as it doesn’t make sense commenting unrelated offsets above a hook & then not comment the actual offset, lol.

 

Also, show how it looks like in IDA

ad20ee541031a930b712ebc5bdbd12c1.png

Archived

This topic is now archived and is closed to further replies.

×
  • 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