473,385 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help getting information from a non managed programme.

Program is witten in C++ and runs on my windows xp computer. It is a
game, but I have been struggling with this project for weeks now so
would appreciate some help - although I understand what i'm trying to
do is quite advanced. I'm doing this more as a learning excercise where
the means is more important than the end.

When you press 'caps lock' in the programme a heads up type overview is
placed on the screen. The overview consists of coloured squares
representing friends or foe. The squares are different colours
depending on if they represent a friend or a foe. In addition to these
small coloured squares shaded blocks are displayed which indicate the
walls in the room (the parts you can't walk through).

When you press 'caps lock' a second time the heads up view vanishes, so
'caps lock' toggles the view. When the heads up view is displayed you
can walk around as normal it's just a overlay that appears on the
screen.

What I would like to do is create a form which recreates this overlay.
So basically I would open the game and then open my form and the form
would display the same heads up view (or similiar) to what you get when
you press 'caps lock' in the game.

How do I do this please? Any ideas would be appreciated, because this
project is consuming too many of my weekends now without making any
progress!

Many Thanks,

Gary-

Dec 16 '06 #1
8 1343
Try,

microsoft.public.vc.language
--
....Carl Frisk
Anger is a brief madness.
- Horace, 20 B.C.
http://www.carlfrisk.com

<ga********@myway.comwrote in message news:11**********************@73g2000cwn.googlegro ups.com...
Program is witten in C++ and runs on my windows xp computer. It is a
game, but I have been struggling with this project for weeks now so
would appreciate some help - although I understand what i'm trying to
do is quite advanced. I'm doing this more as a learning excercise where
the means is more important than the end.

When you press 'caps lock' in the programme a heads up type overview is
placed on the screen. The overview consists of coloured squares
representing friends or foe. The squares are different colours
depending on if they represent a friend or a foe. In addition to these
small coloured squares shaded blocks are displayed which indicate the
walls in the room (the parts you can't walk through).

When you press 'caps lock' a second time the heads up view vanishes, so
'caps lock' toggles the view. When the heads up view is displayed you
can walk around as normal it's just a overlay that appears on the
screen.

What I would like to do is create a form which recreates this overlay.
So basically I would open the game and then open my form and the form
would display the same heads up view (or similiar) to what you get when
you press 'caps lock' in the game.

How do I do this please? Any ideas would be appreciated, because this
project is consuming too many of my weekends now without making any
progress!

Many Thanks,

Gary-
Dec 16 '06 #2
Carl, im writing this in C# :)

Carl Frisk wrote:
Try,

microsoft.public.vc.language
--
...Carl Frisk
Anger is a brief madness.
- Horace, 20 B.C.
http://www.carlfrisk.com

<ga********@myway.comwrote in message news:11**********************@73g2000cwn.googlegro ups.com...
Program is witten in C++ and runs on my windows xp computer. It is a
game, but I have been struggling with this project for weeks now so
would appreciate some help - although I understand what i'm trying to
do is quite advanced. I'm doing this more as a learning excercise where
the means is more important than the end.

When you press 'caps lock' in the programme a heads up type overview is
placed on the screen. The overview consists of coloured squares
representing friends or foe. The squares are different colours
depending on if they represent a friend or a foe. In addition to these
small coloured squares shaded blocks are displayed which indicate the
walls in the room (the parts you can't walk through).

When you press 'caps lock' a second time the heads up view vanishes, so
'caps lock' toggles the view. When the heads up view is displayed you
can walk around as normal it's just a overlay that appears on the
screen.

What I would like to do is create a form which recreates this overlay.
So basically I would open the game and then open my form and the form
would display the same heads up view (or similiar) to what you get when
you press 'caps lock' in the game.

How do I do this please? Any ideas would be appreciated, because this
project is consuming too many of my weekends now without making any
progress!

Many Thanks,

Gary-
Dec 16 '06 #3
On 16 Dec 2006 02:20:41 -0800, ga********@myway.com wrote:
>What I would like to do is create a form which recreates this overlay.
So basically I would open the game and then open my form and the form
would display the same heads up view (or similiar) to what you get when
you press 'caps lock' in the game.
What problems are you having?

Do you need help on how to read the Caps Lock key? Look at the
KeyDown, KeyPress and KeyUp events.

Do you need help with setting a transparent background for your
overlay?

If you can be more specific then we can give you more help.

rossum

Dec 16 '06 #4
ga********@myway.com wrote:
>What I would like to do is create a form which recreates this overlay.
So basically I would open the game and then open my form and the form
would display the same heads up view (or similiar) to what you get when
you press 'caps lock' in the game.
Clarify:

can you alter the source code of the game?

are you trying to get real data from the game, or just trying to learn
how to pop up an overlay?

--
Lucian
Dec 16 '06 #5
Thankyou sorry if i was vague.
I'm trying to get real data from the game. I dont have source code for
the game.

So far I have come to the conclusion (rightly or wrongly) that i need
to use P/Invoke and use functions of kernel32.dll for reading memory.
But I dont know where to start looking for what parts of memory i
should be reading etc.. I've never done anything like this before and
am struggling to make a start.

I hope I have clarified a bit, please ask if i need to clarify more.

Thankyou,

Gary-

Lucian Wischik wrote:
ga********@myway.com wrote:
What I would like to do is create a form which recreates this overlay.
So basically I would open the game and then open my form and the form
would display the same heads up view (or similiar) to what you get when
you press 'caps lock' in the game.

Clarify:

can you alter the source code of the game?

are you trying to get real data from the game, or just trying to learn
how to pop up an overlay?

--
Lucian
Dec 16 '06 #6
ga********@myway.com wrote:
>So far I have come to the conclusion (rightly or wrongly) that i need
to use P/Invoke and use functions of kernel32.dll for reading memory.
But I dont know where to start looking for what parts of memory i
should be reading etc.. I've never done anything like this before and
am struggling to make a start.
This is one of the most difficult reverse-engineering tasks there is!
And people in this newsgroup are oriented towards high-level
programming rather than low-level reverse engineering. If you want
advice on the reverse-engineering, what you'd have to do is explain
clearly and in detail how the game works, what its user-interface is
like, who wrote it, what's its name, ... And even then you're unlikely
to get useful advice.

I can tell you how I've gone about reverse-engineering stuff.

(1) To reverse engineer a binary file format, I created some example
files in the application, saved them to disk, printed out a binary
dump of them, and just stared at them looking for patterns. Finding
more and more patterns. Figure out what are the blocks, what is the
block architecture.

(2) To reverse engineer how win95 screensavers worked, I loaded a
screensaver in a debugger (Borland C++Builder) and stepped through the
machine code step by step.

(3) To disable copy-protection on one of my games, I loaded it up in
the debugger and looked for a call to the DialogBox API function which
popped up "please insert the CD in your primary CD drive". Set the
breakpoint here. And looked at the callstack when it got here.

(4) To hack a game, I took a note of the number of my current health
points in the game. Saved a snapshot of the game's memory state. Then
searched through the memory looking for that number. Figured out the
surrounding data-structures.

It sounds like you want to query the game's map. This will be like a
combination of (1) and (4), but much more difficult, because the map
will be stored in some game-specific format, not just plain numbers.
If it's a network game then it might be easier to sniff network
packets.

--
Lucian
Dec 16 '06 #7
Oh. I just saw the Program written in C++ and non managed in the subject line with no reference that you are writing an
add-on in something else like C#.

You do have an interesting task ahead in reverse engineering the C++ code. Without the source and or an API you are
going to have to see what is exposed publicly. Try using Dependency Walker http://www.dependencywalker.com/ and or
Spy++ which comes with VS 200x. You don't mention which application you are attempting to hook into. That would help.

With that said C# may not be my 1st choice. C++ most likely would be so I would have ready use of pointers. But that's
my own style of course. A lot of games have APIs to accomplish just what you are trying to do.
--
....Carl Frisk
Anger is a brief madness.
- Horace, 20 B.C.
http://www.carlfrisk.com
<ga********@myway.comwrote in message news:11**********************@80g2000cwy.googlegro ups.com...
Carl, im writing this in C# :)

Carl Frisk wrote:
>Try,

microsoft.public.vc.language
--
...Carl Frisk
Anger is a brief madness.
- Horace, 20 B.C.
http://www.carlfrisk.com

<ga********@myway.comwrote in message news:11**********************@73g2000cwn.googlegro ups.com...
Program is witten in C++ and runs on my windows xp computer. It is a
game, but I have been struggling with this project for weeks now so
would appreciate some help - although I understand what i'm trying to
do is quite advanced. I'm doing this more as a learning excercise where
the means is more important than the end.
<omiited>
Gary-
>
Dec 16 '06 #8
hmm thanks Lucian lots to think about there

Lucian Wischik wrote:
ga********@myway.com wrote:
So far I have come to the conclusion (rightly or wrongly) that i need
to use P/Invoke and use functions of kernel32.dll for reading memory.
But I dont know where to start looking for what parts of memory i
should be reading etc.. I've never done anything like this before and
am struggling to make a start.

This is one of the most difficult reverse-engineering tasks there is!
And people in this newsgroup are oriented towards high-level
programming rather than low-level reverse engineering. If you want
advice on the reverse-engineering, what you'd have to do is explain
clearly and in detail how the game works, what its user-interface is
like, who wrote it, what's its name, ... And even then you're unlikely
to get useful advice.

I can tell you how I've gone about reverse-engineering stuff.

(1) To reverse engineer a binary file format, I created some example
files in the application, saved them to disk, printed out a binary
dump of them, and just stared at them looking for patterns. Finding
more and more patterns. Figure out what are the blocks, what is the
block architecture.

(2) To reverse engineer how win95 screensavers worked, I loaded a
screensaver in a debugger (Borland C++Builder) and stepped through the
machine code step by step.

(3) To disable copy-protection on one of my games, I loaded it up in
the debugger and looked for a call to the DialogBox API function which
popped up "please insert the CD in your primary CD drive". Set the
breakpoint here. And looked at the callstack when it got here.

(4) To hack a game, I took a note of the number of my current health
points in the game. Saved a snapshot of the game's memory state. Then
searched through the memory looking for that number. Figured out the
surrounding data-structures.

It sounds like you want to query the game's map. This will be like a
combination of (1) and (4), but much more difficult, because the map
will be stored in some game-specific format, not just plain numbers.
If it's a network game then it might be easier to sniff network
packets.

--
Lucian
Dec 16 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martin Bless | last post by:
I need to access a MSSQL database (MS-Sql, not MySQL!)and would very much like to use mssql-0.09.tar.gz which is available from http://www.object-craft.com.au/projects/mssql/download.html ...
1
by: Bilo Aga | last post by:
The installation of MSDE fails and I dont find any solution to get it work. If I start the setup than a windows with the time bar appears and says it will take 1 minute. After nearly 1 minute it...
1
by: remove | last post by:
Hi all, I have a fairly simple database containing details of broadcast news reports. Each record contains information about the programme title, date, time, presenter, and details of the...
9
by: Microsoft News Server | last post by:
Hi, I am currently having a problem with random, intermittent lock ups in my ASP.net application on our production server (99% CPU usage by 3 threads, indefinately). I currently use IIS Debug...
2
by: garyusenet | last post by:
Hi All, I have been working on the following programme over the last day or so and have made a good deal of progress. It is a very simple programme, but is proving very useful as a learning aid,...
3
by: garyusenet | last post by:
Some time ago I enquired about how I interface with a program written in an old version of C++ Any terms i use like list that follow are used in their common everyday usuage! One of the...
0
by: tomwolfstein | last post by:
Hi. I am trying to write a wrapper for the standard VC1 decoder, and I need to resolve a "TypeLoadException" The decoder comes an an executable which I've turned into a .dll. This decoder has about...
0
by: thinboy | last post by:
Im having trouble with a Java Home work. I have found the following classes are their anymore This system is intended to provide the school timetabler with information to support his/her...
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.