Jump to content

3 posts in this topic

Recommended Posts

Posted

I'm trying to hook a function called Actor::getPos in MinecraftBE.

However, that function is less than 8 bytes long, so I can't hook it with MSHookFunction.
What should I do?

Sample Code:

struct Vec3 {

	float x, y, z;
};

struct Actor {};

static Vec3& (*Actor_getPos)(Actor*);
static Vec3& _Actor_getPos(Actor* self) {

	return Actor_getPos(self);
}

%ctor {
  //If it doesn't, it will crash...
  MSHookFunction((void*)(0x10228c2b8 + _dyld_get_image_vmaddr_slide(0)), (void*)&_Actor_getPos, (void**)&Actor_getPos);
}

 

Posted

If you're using substitute jailbreak hooking 8 bytes might be an issue

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