hooking into a program

Started by
0 comments, last by ApochPiQ 18 years, 5 months ago
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 :).
www.prsoftware.de
Advertisement
"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.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

This topic is closed to new replies.

Advertisement