Jump to content

Struggles with MSHook New way


Go to solution Solved by Rook,

43 posts in this topic

Recommended Posts

Posted

oh yeah, it's actually the same almost

_bikeInfo_isAllWheel

_bikeInfo_isExtraChance

_bikeInfo_isGhost

_bikeInfo_isHog

_bikeInfo_isReverse

_bikeInfo_isReverse

 

 

Some example code:

 

 

float (*crosshairOld)(void *self);
 
%ctor{
if(GetPrefBool(@"key")) {
MSHookFunction((void*)(_dyld_get_image_vmaddr_slide(0) + 0x231DB8 + 1),(void*)crosshair,(void**)&crosshairOld);
//but you would replace what's above with your MSHook since you are hooking symbols and not offsets
}
}
 
  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted

 

Some example code:

float (*crosshairOld)(void *self);
 
%ctor{
if(GetPrefBool(@"key")) {
MSHookFunction((void*)(_dyld_get_image_vmaddr_slide(0) + 0x231DB8 + 1),(void*)crosshair,(void**)&crosshairOld);
//but you would replace what's above with your MSHook since you are hooking symbols and not offsets
}
}
 

uhmm, I don't understand it xD, can you make an example with one of the functions I wanna use?

Posted

uhmm, I don't understand it xD, can you make an example with one of the functions I wanna use?

 

if you paste your tweak.xm here :p

Posted

if you paste your tweak.xm here :p

#include <substrate.h>

bool isGhost()
{
return true;
}

bool isHog()
{
return true;
}

bool isAllWheel()
{
return true;
}

bool isReverse()
{
return true;
}

bool isExtraChance()
{
return true;
}

bool isUnbreakable()
{
return true;
}

%ctor{
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isGhost")),(void*)isGhost, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isHog")),(void*)isHog, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isAllWheel")),(void*)isAllWheel, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isReverse")),(void*)isReverse, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isExtraChance")),(void*)isExtraChance, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isUnbreakable")),(void*)isUnbreakable, NULL);
}
Posted

 

#include <substrate.h>

bool isGhost()
{
return true;
}

bool isHog()
{
return true;
}

bool isAllWheel()
{
return true;
}

bool isReverse()
{
return true;
}

bool isExtraChance()
{
return true;
}

bool isUnbreakable()
{
return true;
}

%ctor{
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isGhost")),(void*)isGhost, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isHog")),(void*)isHog, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isAllWheel")),(void*)isAllWheel, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isReverse")),(void*)isReverse, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isExtraChance")),(void*)isExtraChance, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isUnbreakable")),(void*)isUnbreakable, NULL);
}

shmoo, on 21 Feb 2016 - 9:31 PM, said:
if you paste your tweak.xm here 
#include <substrate.h>

bool isGhost()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isHog()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isAllWheel()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isReverse()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isExtraChance()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isUnbreakable()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

%ctor{
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isGhost")),(void*)isGhost, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isHog")),(void*)isHog, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isAllWheel")),(void*)isAllWheel, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isReverse")),(void*)isReverse, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isExtraChance")),(void*)isExtraChance, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isUnbreakable")),(void*)isUnbreakable, NULL);
}

Have you made a patcher before?

Posted
shmoo, on 21 Feb 2016 - 9:31 PM, said:
if you paste your tweak.xm here 
#include <substrate.h>

bool isGhost()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isHog()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isAllWheel()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isReverse()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isExtraChance()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

bool isUnbreakable()
{
if(GetPrefBool(@"key")){
return true;
}
return %orig;
}

%ctor{
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isGhost")),(void*)isGhost, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isHog")),(void*)isHog, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isAllWheel")),(void*)isAllWheel, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isReverse")),(void*)isReverse, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isExtraChance")),(void*)isExtraChance, NULL);
MSHookFunction(((void*)MSFindSymbol(NULL, "_bikeInfo_isUnbreakable")),(void*)isUnbreakable, NULL);
}
Have you made a patcher before?

 

the code you just did, I've tried before. I'm getting a error: %orig found outside of hook or subs class.

 

and yes, I did. Why ?

Posted

the code you just did, I've tried before. I'm getting a error: %orig found outside of hook or subs class.

 

and yes, I did. Why ?

Try http://armconverter.com/ to make an mshook patcher

 

I don't usually make mshook patchers that was a guess :p

Posted

The online generator works fine. You're just probably doing it all wrong.

 

Always check your keys, your plist name, your bundle ID and the features itself.

Since I do it wrong, can you help with that online MSHook Patcher?

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