Skip to content
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

can fishhook hook c function in static framework? #44

Closed
uiuco opened this issue Jul 5, 2017 · 2 comments
Closed

can fishhook hook c function in static framework? #44

uiuco opened this issue Jul 5, 2017 · 2 comments

Comments

@uiuco
Copy link

uiuco commented Jul 5, 2017

A demo project have import a static framework, and the framework have a function named myF. I want to hook it and replace to hook_myFu, but it not work.
Is fishhook hook dylib function only? or I do something wrong?
Thank you!

code in simple ViewController

static void (*orig_myFunction)(void);
void hook_myFu(){
    NSLog(@" 123");
}
viewDidLoad {
    [super viewDidLoad];
    
    struct rebinding open_rebinding = {"myF", hook_myFu, (void *)&orig_myFunction};
    rebind_symbols((struct rebinding[1]){open_rebinding}, 1);
    myF();
}
@kastiglione
Copy link
Contributor

kastiglione commented Jul 5, 2017

Fishhook can only hook functions in other dylibs. I'm not aware of an alternative for static libraries.

@uiuco
Copy link
Author

uiuco commented Jul 6, 2017

Thank you for your help, good luck!

@uiuco uiuco closed this as completed Jul 6, 2017
@jobsyu jobsyu mentioned this issue Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants