Jump to content

19 posts in this topic

Recommended Posts

Posted

Example how I did mshook

 

 

 

#import <CoreFoundation/CoreFoundation.h>
#import <substrate.h>
#import <Foundation/Foundation.h>
#define prefs @"/var/mobile/Library/Preferences/com.kenny808.mcpemods.plist"
inline bool GetPrefBool(NSString *key){
return [[[NSDictionary dictionaryWithContentsOfFile:prefs] valueForKey:key] boolValue];
}



int (*orig__ZN9Inventory3addEP12ItemInstance)(void *self, unsigned int i1);
int __ZN9Inventory3addEP12ItemInstance(void *self, unsigned int i1) {
if(GetPrefBool(@"kadd"))
{
return 64;
}
else
{
return orig__ZN9Inventory3addEP12ItemInstance(self,i1);
}
}

__attribute__((constructor)) void DylibMain() {
MSHookFunction(((void*)MSFindSymbol(NULL,"__ZN9Inventory3addEP12ItemInstance")),(void *)__ZN9Inventory3addEP12ItemInstance,(void**)&orig__ZN9Inventory3addEP12ItemInstance);
}
Posted

Example how I did mshook

 

 

 

#import <CoreFoundation/CoreFoundation.h>
#import <substrate.h>
#import <Foundation/Foundation.h>
#define prefs @"/var/mobile/Library/Preferences/com.kenny808.mcpemods.plist"
inline bool GetPrefBool(NSString *key){
return [[[NSDictionary dictionaryWithContentsOfFile:prefs] valueForKey:key] boolValue];
}



int (*orig__ZN9Inventory3addEP12ItemInstance)(void *self, unsigned int i1);
int __ZN9Inventory3addEP12ItemInstance(void *self, unsigned int i1) {
if(GetPrefBool(@"kadd"))
{
return 64;
}
else
{
return orig__ZN9Inventory3addEP12ItemInstance(self,i1);
}
}

__attribute__((constructor)) void DylibMain() {
MSHookFunction(((void*)MSFindSymbol(NULL,"__ZN9Inventory3addEP12ItemInstance")),(void *)__ZN9Inventory3addEP12ItemInstance,(void**)&orig__ZN9Inventory3addEP12ItemInstance);
}

 

HEY I MISS U <3

Posted

Use %ctor if it's still not working

 

It still isn't working :(

 

How come it works on your device but not on mine :/

Posted

I don't know :/

:(

You should've stuck around more, maybe you could've helped me and evolved into a better hacker :p

Posted


#include <substrate.h>

 

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.goggwell.FruitNinja.plist"

 

inline bool GetPrefBool(NSString *key) {

return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];

}

 

bool (*old_IsTimedGame)(void *self);

int (*old_WaveSpawnManager_SpawnBomb)(void *self);

int (*old_WaveManager_GetCriticalChance)(void *self);

int (*old_Components_Score_LifeLost)(void *self);

bool (*old_Components_Score_IsNewBest)(void *self);

int (*old_AIManager_Tournament_GetEntryFee)(void *self);

 

 

bool IsTimedGame(void *self) {

if(GetPrefBool(@"kTimed")) {

return FALSE;

} else {

return old_IsTimedGame(self);

}

}

 

int WaveSpawnManager_SpawnBomb(void *self) {

if(GetPrefBool(@"kBomb")) {

return 0;

} else {

return old_WaveSpawnManager_SpawnBomb(self);

}

}

 

int WaveManager_GetCriticalChance(void *self) {

if(GetPrefBool(@"kCrit")) {

return 100;

} else {

return old_WaveManager_GetCriticalChance(self);

}

}

 

int Components_Score_LifeLost(void *self) {

if(GetPrefBool(@"kLost")) {

return 0;

} else {

return old_Components_Score_LifeLost(self);

}

}

 

int Components_Score_IsNewBest(void *self) {

if(GetPrefBool(@"kBest")) {

return TRUE;

} else {

return old_Components_Score_IsNewBest(self);

}

}

 

int AIManager_Tournament_GetEntryFee(void *self) {

if(GetPrefBool(@"kFee")) {

return 0;

} else {

return old_AIManager_Tournament_GetEntryFee(self);

}

}

 

%ctor {

 

MSHookFunction((void*)MSFindSymbol(NULL,"__Z11IsTimedGamev"),(void*)IsTimedGame,(void**)&old_IsTimedGame);

MSHookFunction((void*)MSFindSymbol(NULL,"__ZN11WaveManager9SpawnBombEiP12SPAWNER_INFOi"),(void*)WaveSpawnManager_SpawnBomb,(void**)&old_WaveSpawnManager_SpawnBomb);

MSHookFunction((void*)MSFindSymbol(NULL,"__ZN11WaveManager17GetCriticalChanceEi"),(void*)WaveManager_GetCriticalChance,(void**)&old_WaveManager_GetCriticalChance);

MSHookFunction((void*)MSFindSymbol(NULL,"__ZN10Components5Score8LifeLostE8_Vector3IfEiP6Entity"),(void*)Components_Score_LifeLost,(void**)&old_Components_Score_LifeLost);

MSHookFunction((void*)MSFindSymbol(NULL,"__ZNK10Components5Score9IsNewBestEv"),(void*)Components_Score_IsNewBest,(void**)&old_Components_Score_IsNewBest);

MSHookFunction((void*)MSFindSymbol(NULL,"__ZN9AIManager10Tournament11GetEntryFeeERKN6Mortar11AsciiStringE"),(void*)AIManager_Tournament_GetEntryFee,(void**)&old_AIManager_Tournament_GetEntryFee);

 

}

Posted
#include <substrate.h>

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.goggwell.FruitNinja.plist"

inline bool GetPrefBool(NSString *key) {
    return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}

bool (*old_IsTimedGame)(void *self);
int (*old_WaveSpawnManager_SpawnBomb)(void *self);
int (*old_WaveManager_GetCriticalChance)(void *self);
int (*old_Components_Score_LifeLost)(void *self);
bool (*old_Components_Score_IsNewBest)(void *self);
int (*old_AIManager_Tournament_GetEntryFee)(void *self);


bool IsTimedGame(void *self) {
    if(GetPrefBool(@"kTimed")) {
        return FALSE;
    } else {
        return old_IsTimedGame(self);
    }
}

int WaveSpawnManager_SpawnBomb(void *self) {
    if(GetPrefBool(@"kBomb")) {
        return 0;
    } else {
        return old_WaveSpawnManager_SpawnBomb(self);
    }
}

int WaveManager_GetCriticalChance(void *self) {
    if(GetPrefBool(@"kCrit")) {
        return 100;
    } else {
        return old_WaveManager_GetCriticalChance(self);
    }
}

int Components_Score_LifeLost(void *self) {
    if(GetPrefBool(@"kLost")) {
        return 0;
    } else {
        return old_Components_Score_LifeLost(self);
    }
}

int Components_Score_IsNewBest(void *self) {
    if(GetPrefBool(@"kBest")) {
        return TRUE;
    } else {
        return old_Components_Score_IsNewBest(self);
    }
}

int AIManager_Tournament_GetEntryFee(void *self) {
    if(GetPrefBool(@"kFee")) {
        return 0;
    } else {
        return old_AIManager_Tournament_GetEntryFee(self);
    }
}

%ctor {

    MSHookFunction((void*)MSFindSymbol(NULL,"__Z11IsTimedGamev"),(void*)IsTimedGame,(void**)&old_IsTimedGame);
    MSHookFunction((void*)MSFindSymbol(NULL,"__ZN11WaveManager9SpawnBombEiP12SPAWNER_INFOi"),(void*)WaveSpawnManager_SpawnBomb,(void**)&old_WaveSpawnManager_SpawnBomb);
    MSHookFunction((void*)MSFindSymbol(NULL,"__ZN11WaveManager17GetCriticalChanceEi"),(void*)WaveManager_GetCriticalChance,(void**)&old_WaveManager_GetCriticalChance);
    MSHookFunction((void*)MSFindSymbol(NULL,"__ZN10Components5Score8LifeLostE8_Vector3IfEiP6Entity"),(void*)Components_Score_LifeLost,(void**)&old_Components_Score_LifeLost);
    MSHookFunction((void*)MSFindSymbol(NULL,"__ZNK10Components5Score9IsNewBestEv"),(void*)Components_Score_IsNewBest,(void**)&old_Components_Score_IsNewBest);
    MSHookFunction((void*)MSFindSymbol(NULL,"__ZN9AIManager10Tournament11GetEntryFeeERKN6Mortar11AsciiStringE"),(void*)AIManager_Tournament_GetEntryFee,(void**)&old_AIManager_Tournament_GetEntryFee);

}

Testing soon :D

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