Skip to content
Guest Big Announcement

MSHookFunction doesn't work

Featured Replies

Hello everyone!

I'm trying to hack a game with Logos (MonkeyDev project).
So I have dump.cs with function offsets.
But when I try to

MSHookFunction((void *)getRealOffset(0xoffset), (void *)_replaceFunc, (void **)&origFunc) 

nothing happens (NSLog in _replaceFunc doesn't print something)
Offset is real, because writeData(0xoffset, data) works correctly.

iOS: 11.3.1
MonkeyDev Xcode project
substrate.h

Any ideas? ?

Updated by jux3z

  • Author
10 hours ago, Ted2 said:

The function you're hooking, are you actually returning something?

No, it's just Update function 
 

private void Update(); // 0x101A25EA4


So, code:
 

void (*Player_Update)(void *player);

void _Player_Update(void *player) {

    NSLog(@"Player UPDATE!"); // Just for test

    Player_Update(player);

}

%hook UnityAppController

- (void)applicationDidBecomeActive:(id)arg1

{
	NSLog(@"did become active"); // It works
    MSHookFunction((void *)(getRealOffset(0x101A25EA4)), (void *)_Player_Update, (void **)&Player_Update);

    %orig;
}

%end


P.S.: I tried to hook not only the Update function, but also many others. No effect

Updated by jux3z

  • Author
1 hour ago, Ted2 said:

What if you put that mshook outside the applicationdidbecomeactive??

 

%ctor {

Mshook.......

}

Thanks for the idea! But it also doesn't work :(

46 minutes ago, jux3z said:

Thanks for the idea! But it also doesn't work :(

Hmm weird. What if you put some silly if statement around it?

 

Also how do you get NSLog to see? I've wanted to get that to work too, but couldn't get it.

  • Author

I use https://github.com/AloneMonkey/MonkeyDev Xcode project, so I can see all debug messages in debug console. 
 

48 minutes ago, Ted2 said:

Hmm weird. What if you put some silly if statement around it?

I think the problem may be in linking CydiaSubstrate framework.

There is

#import <substrate.h>

but it seems that this function (MSHookFunction) does nothing. 
 

2 minutes ago, jux3z said:

I would like to try to use symbols (MSFindSymbol), but there are no symbols in IDA
image.png

Then you can't use it. But again, you make a JB tweak or a NJB?

  • Author
2 minutes ago, Ted2 said:

MSHook doesn't work on NJB. Only on JB, you know that?

Hmm, didn't know that. 
So, MSHook is not used in hacks for NJB? What then?
 

Archived

This topic is now archived and is closed to further replies.

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.