Skip to content
Guest Big Announcement

Help ! increase attack rather than unlimited attack

Featured Replies

Request to write a tutorial on the increase attack power is 10 times the original attack, rather than unlimited attack "one hit kill" (mov r0, r7)

Thanks for help

Solved by Guest

  • Solution

Hook the attack function to return 10 times the normal attack


@@fruit

  • Author

Bro, Is possible to hook attack function with sub_x?if so ,please teach me the way.or take a simple example.

if attack function is "sub_23b148"

 

thx a lot.

 

@@shmoo

Updated by Fruit

@@fruit

 

Here is how you would hook a subroutine:

 

#import <substrate.h>

float (*attackOld)(void *self);

float attack(void *self) {

        return YourNormalAttackMultipliedByTen.0f;
}

%ctor{
if(GetPrefBool(@"kAttack"))
{
        MSHookFunction((void*)(0x23B148+1),(void*)attack,(void**)&attackOld);
}

}
If this game is a Unity game use take out the "+1"

 

That's how you would make a patcher out of it

Updated by Guest

@shmoo so Unity games are not thumb ?

The old ones are not but some of the new ones are but its rare

  • Author

@@shmoo

float attack(void *self) {

return YourNormalAttackMultipliedByTen.0f;
}
Here can you give an example?
I do not know how to express my attack multiplied by Ten. :p

@@shmoo

 

 

 

Here can you give an example?

I do not know how to express my attack multiplied by Ten. :p

Say the normal attack of your character is 15. 10 x 15 = 150. So you would be returning 150 instead of 10.

  • Author

Say the normal attack of your character is 15. 10 x 15 = 150. So you would be returning 150 instead of 10.

Character attack should be a variable,so i donnt know how to replace it.

In your opinion, it is my a constant attack.

Maybe I'm stupid.shmoo

This function should affect all characters I'm pretty sure. Just try it :)

  • Author

@shmoo This is my tweak.if i wanna add attack to it.I changed it like this, right?

and i can see ".0f" end of 150,what is it means?

thx so much

 

#import "writeData.h"

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#define PLIST_PATH @"/var/mobile/Library/Preferences/com.Fruit.TinyTroopers2.plist"
 
inline bool GetPrefBool(NSString *key)
{
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}
 
%ctor {
if(GetPrefBool(@"coins"))
{
writeData(0x1E73CE, 0x0F60);
} else {
 
}
 
if(GetPrefBool(@"kGems"))
{
writeData(0x1EB290, 0x3968);
} else {
 
}
 
 
 
}

change to

 

#import "writeData.h"

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <substrate.h>
#define PLIST_PATH @"/var/mobile/Library/Preferences/com.Fruit.TinyTroopers2.plist"
 
inline bool GetPrefBool(NSString *key)
{
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}
 
float (*attackOld)(void *self);
 
float attack(void *self) {
 
        return 150.0f;
}
 
%ctor {
if(GetPrefBool(@"coins"))
{
writeData(0x1E73CE, 0x0F60);
} else {
 
}
 
if(GetPrefBool(@"kGems"))
{
writeData(0x1EB290, 0x3968);
} else {
 
}
 
if(GetPrefBool(@"kAttack"))
{
        MSHookFunction((void*)(0x23B148+1),(void*)attack,(void**)&attackOld);
}
 
 
 
 
}

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.