-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in %hookf #67
Comments
This is by design. It’s not recommended to use MSFindSymbol() or dlsym() with NULL passed as the image argument, as looking up a symbol across the entire set of images loaded in the processes is slow. Unfortunately the initial design of %hookf encouraged this. Instead, define it yourself by passing the pointer into %hookf(void, afunction) {
// …
}
%ctor {
void *myLib = dlopen("/System/Library/PrivateFrameworks/Awesome.framework/Awesome", RTLD_NOLOAD);
void *myFunc = dlsym(myLib, "afunction");
%init(afunction = myFunc);
} |
Thanks @NSExceptional . What about adding an optional: %hooklib "/System/Library/PrivateFrameworks/Awesome.framework/Awesome" Best of both world? @kirb I write most of my tweaks without logos, but I love to have logos when I need to do a quick and dirty proof of concept or a throw away analysis tweak. Having to write the constructor defeats the purpose of %hookf as I may as well call MSHookFunction by hand at this point. |
An idea that floated around when I originally introduced this feature was to specify the library along with the function name: %hookf(void, "/System/Library/PrivateFrameworks/Awesome.framework/Awesome:aFunction") {
} |
What are the steps to reproduce this issue?
Create a Tweak with the following code:
%hookf(void, "afunction"){
}
What happens?
MSHookFunction((void *)_logos_symbol$_ungrouped$"afunction", (void *)&_logos_function$_ungrouped$"afunction", (void **)&_logos_orig$_ungrouped$"afunction");
This obviously doesn't compile.
What were you expecting to happen?
MSHookFunction((void *)MSFindSymbol(NULL, "afunction"), (void *)&_logos_function$_ungrouped$lookup$afunction, (void **)&_logos_orig$_ungrouped$lookup$afunction);
Any logs, error output, etc?
Compilation errors due to missing MSFindSymbol and unwanted quotes.
Any other comments?
It worked perfectly until I updated theos.
What versions of software are you using?
Latest git master.
The text was updated successfully, but these errors were encountered: