• Advertisement
Sign in to follow this  

Gathering information from a windows application

This topic is 3573 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone i'm new here and i'm fairly new to programming in Java as well. I am thinking about starting to pick up c# but I was wondering what your guys thoughts were on how to go about gathering information from a windows application. For example if I was playing a black jack game and the game starts a new hand and sends to my screen that I have an Ace and 10 of diamonds how can I capture that data and store it somewhere? I guess the program is making calls to the windows API????? so I guess what i'm trying to say is , is it possible to intercept this call to the windows API and before it gets there, store it, then return it to the windows API. What do you guys think would be a good away about getting started on this? Thanks for any help. Is this even possible in java? What would be better for this C# or c++? [Edited by - MottsAppleSauce on July 10, 2008 1:18:11 PM]

Share this post


Link to post
Share on other sites
Advertisement
Well the concept is API hooking, but exactly how you go about doing this will vary greatly on the program you want to hook into. For instance, the information you want might not go through the API at all but is handled entirely by the program itself. All the API might do is get user input and display pixels. I've never done hooking myself so it might end up being pretty easy for you. Hope this helps.

Share this post


Link to post
Share on other sites
Generally, if a program doesn't expose an API for acquiring some information, then it can only be done via the most roundabout ways. For example, taking screenshots and doing image processing. There are minor exceptions for the most structured and well-defined of environments; for example, many utilities are available for a game called Dwarf Fortress which use well-known locations in Dwarf Fortress' private memory pool to explore the structures in memory, and perform manipulation on the game and environment. This behaviour is often caught by virus scanners as cross-process viral propogation, but is also exactly the way your IDE's debugger works.

With the Windows API, regardless of what language you use, you cannot capture or intercept API calls a target application makes, but you can capture global events such as mouse-clicks and keyboard presses and changes of screen resolution and whatnot; these are what are called Hooks in Windows API terminology.

If the program you want to monitor communicates with another computer, you could capture packets coming and going from your network card and reverse-engineer that program's protocol so you can see anything that is passed back and forth, but if that stream is encrypted you'll need to find a way to access the decryption keys locally via memory snooping (assuming symmetric ciphers are used).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement