Sign in to follow this  
JazzD

hooking into a program

Recommended Posts

DISCLAIMER: I Know that this stuff is/can be illegal, dont tell me, im just curious how you actually do this. Okay you all know the people cheating in games using aimbots, macros and hacks. You always stumble across the word "hook" when you research about it. But how do you actually program a hook? Im not really into hacking and cracking stuff or cheating in games but i was always curious about it, how these crackers actually get this to work. Is it a feature of the winapi or is it possible to produce hooks on unix based systems too? Do you actually communicate with the application or just write into the part of memory to control it? I would be very happy if somebody could produce a little sample, (maybe using SDL?) where you have a main program and a simple hook that controls something in the other application. Also im interested in this because it can be helpful for many things too, if you have a program that you want to access with your own remote program for example. Thanks for your help :).

Share this post


Link to post
Share on other sites
"Hook" is a pretty generic term; essentially it just means that, by some means or another, you set your program up to be notified when stuff happens someplace (vague, I know [grin]).

Different hooks are configured different ways. For instance, there's a set of Win32 APIs that let you trap keyboard and mouse messages across the system (search MSDN for "hook," surprisingly enough). More complex hooks such as TTI or the layered service provider system in Winsock let you watch network traffic on a system. For any given activity in your computer, you can probably hook into it somehow - but some types of hooks are much easier to do than others.

More dirty hooks (for things like modifying other programs' behavior) require some evil magic to get around the Windows sandboxing system, which prevents one process from mucking around in other processes. Nicer hooks (such as COM, DCOM, or, for a blast from the past, DDE) use an intermediary (usually the operating system) to "marshall" data between participants in a hook setup.

Hooks, what they do, how they work, and what they look like all vary based on what you're looking to do and how the hook mechanism is implemented. Linux, BSD, Mach, MacOS, and Windows all support network hooks, for instance, but each platform's hook mechanisms look radically different.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this