Question Extracting Data from external Windows Application, Please Help

SeppeC

New member
Joined
Jun 17, 2008
Messages
2
Programming Experience
1-3
I'm building a statistics-program that will need to extract data from a game.
The game is in window mode and is a Windows Application.

Does someone know how I can extract data from it? I don't know where to start...

Thanks in advance.
 
What kind of stats data do you mean? If you want to take statistics on the long term, you can use log like files that you fill with the main application. Create a new file and fill it with the logged info every minute. Use incremented file names and unlock the previous files correctly all the time.

Then you can have your stats program attempt to read the file every 5 secs. If the file is locked, it just waits another 5 secs. Then whenever the next file is unlocked, you read it, parse its data and rename the file to make sure you don't parse it again.

Your files would look like this :

1.bak <-- this file was parsed.
2.log <-- this file is locked by the application and was not parsed yet.

As soon as the main application detects that a minute passed, it closes the file "2.log" and creates a new file called "3.log". The stats program eventually succeeds in opening the file "2.log", reads it content, does some stats compilation and renames "2.log" into "2.bak". It goes on and on... You can also simply delete the backup files instead and you must make sure the stats program doesn't crash in the event that the main application would not have created the next log file before the stats application is ready to read it.

Now that was one way I just made up that would allow you to keep stats on the program along with all the data you need to diagnose an anomaly. This is good if you want to compile statistical frame rate data over the course of the game or some similar stuff.

If you need to call functions and stuff from your stats application to retrieve information and data from your main application, I think I would simply go for RPC. It should work fine on its own and will even work from the network if you allow it to! Anyway, this is one technique I know of and I don't know of any other. :rolleyes:

Maybe this : http://www.xml-rpc.net/ or some other you would find on the net. The only time I used RPC was in python... Long long ago in a galaxy far far away...
 
The problem is that the main application is just a game and I can not change the source code of that game to let it make logfiles.

I need to find a way to extract the data from it but I don't know how...
One way is ofcourse just typing it over but in that case I am the guy reading the application and posting the data into the program.

I want my program to be able to do that job on its own.
 
Back
Top