MSHookMessageEx and Logos are not working
haniag opened this issue · comments
Hani Abughazaleh commented
I am unable to have MSHookMessageEx and Logos hooking in a tweak. In this code, only "myTweak CTOR" is output in console.
Notes:
- The tweak is built for X86_64 using
TARGET = macosx::10.14
andARCHS = x86_64
. - Ellekit is built with most recent commit.
- Using Ventura M2.
- When I first ran the app, it crashed with error that it is missing "/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate". So I created the folder and symlink "ellekit.dylib" to it as "CydiaSubstrate".
#include <Foundation/Foundation.h>
#include <substrate.h>
%group mytweak
%hook someClass
-(BOOL)someMethod{
NSLog(@"myTweak 1:%d", %orig());
return TRUE;
}
%end
//end group
%end
BOOL (*oldMethod)(id self, SEL _cmd);
BOOL newMethod(id self, SEL _cmd) {
NSLog(@"myTweak 2:%d", oldMethod(self, _cmd));
return TRUE;
}
%ctor {
NSLog(@"myTweak CTOR");
MSHookMessageEx(objc_getClass("someClass"), @selector(someMethod), (IMP)newMethod, (IMP *)&oldMethod);
%init(mytweak);
}
Hani Abughazaleh commented
Closing this since I discovered a typo in one of my classes. Hooking is working perfectly fine!