Jump to content

[Tutorial] How to make a MSHook Patcher


8 posts in this topic

Recommended Posts

Updated (edited)

Require:

- Theos

- Project with Preferences Bundle

- I'll be using mcpe mod sprint

- Knowledge of hacking :3

- knowledge of Preferences Bundle A Tutorial can be found here http://iosgods.com/topic/444-how-to-make-a-preference-bundle/

 

Instructions:

#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];
}


%hook minecraftpeAppDelegate
- (void)applicationDidBecomeActive:(id)non {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"MCPE MODS:" message:@"Mods by Kenny808 Enjoy :)" delegate:nil cancelButtonTitle:@"Thank You!" otherButtonTitles:nil];
[alert show];
[alert release];
}
%end

float (*orig__ZN6Player23getWalkingSpeedModifierEv)(void *self, unsigned int i1);
float __ZN6Player23getWalkingSpeedModifierEv(void *self, unsigned int i1) {
if(GetPrefBool(@"kspeed"))
{
return 1.5f;
}
else
{
return orig__ZN6Player23getWalkingSpeedModifierEv(self,i1);
}
}
__attribute__((constructor)) void DylibMain()
{

MSHookFunction(((void*)MSFindSymbol(NULL,"__ZN6Player23getWalkingSpeedModifierEv")),(void *)__ZN6Player23getWalkingSpeedModifierEv,(void**)&orig__ZN6Player23getWalkingSpeedModifierEv);
}
1.image.jpg

Here a example...

 

2. then go to your resource folder and go to .plist file not the info.plist

And then type "kname" my is "kspeed" be sure the PSSwitchcell is false

image.jpg

 

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>items</key>
  <array>
<dict>
      <key>cell</key>
      <string>PSSwitchCell</string>
      <key>default</key>
      <false/>
      <key>defaults</key>
      <string>com.kenny808.mcpemods</string>
      <key>key</key>
      <string>kspeed</string>
      <key>label</key>
      <string>Sprint Mod</string>
    </dict>
  </array>
  <key>title</key>
  <string>Mods</string>
</dict>
</plist> 
Then compile it :) Updated by kenny808
Posted

Great tutorial :) i will try to give u the text one

Posted

Nice Tutorial Kenny.

 

It'd be helpful for members if you could copy paste the Tweak.xm's content and add them in [code ] tags here on the forum. :p

Posted

Nice Tutorial Kenny.

 

It'd be helpful for members if you could copy paste the Tweak.xm's content and add them in [code ] tags here on the forum. :p

Ok...
Posted

@Kennyboy bro,receive errors every time.can you post your makefiles ?i think the Issue come from this.

Undefined symbols for architecture armv7:

  "_MSFindSymbol", referenced from:

      DylibMain() in Tweak.xm.4a464597.o

  "_MSHookFunction", referenced from:

      DylibMain() in Tweak.xm.4a464597.o

ld: symbol(s) not found for architecture armv7

 

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