-
Notifications
You must be signed in to change notification settings - Fork 974
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
How to hook socket or connect #40
Comments
People have had issues with |
Is there any inspiration how to hook connect in libSystem? inline hook can not work on un jailbreaking system. may be there is another way? |
@kastiglione @waitianlou Looking forward to yours, thinks |
+1 |
Use fishhook in the simulator hook to connect and socket, but not in the iphone hook.
`static int (*orig_socket)(int, int, int);
static int (*orig_connect)(int, const struct sockaddr *, socklen_t);
int my_socket(int domain, int type, int protocol)
{
printf("this is my socket!");
return orig_socket(domain,type,protocol);;
}
int my_connect(int socket, const struct sockaddr * addr, socklen_t len)
{
printf("this is my connect");
return orig_connect(socket,addr,len);
}
int main(int argc, char * argv[])
{
@autoreleasepool {
rebind_symbols((struct rebinding[2]){{"connect", my_connect, (void *)&orig_connect},{"socket", my_socket, (void *)&orig_socket}}, 2);
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
`
The text was updated successfully, but these errors were encountered: