473,803 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1364
Try,

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

<ga********@myw ay.comwrote in message news:11******** **************@ 73g2000cwn.goog legroups.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.publi c.vc.language
--
...Carl Frisk
Anger is a brief madness.
- Horace, 20 B.C.
http://www.carlfrisk.com

<ga********@myw ay.comwrote in message news:11******** **************@ 73g2000cwn.goog legroups.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********@mywa y.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********@mywa y.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********@mywa y.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********@mywa y.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********@myw ay.comwrote in message news:11******** **************@ 80g2000cwy.goog legroups.com...
Carl, im writing this in C# :)

Carl Frisk wrote:
>Try,

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

<ga********@my way.comwrote in message news:11******** **************@ 73g2000cwn.goog legroups.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********@mywa y.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
2074
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 Unfortunately the binary for Python-2.4 isn't available yet and I'd hate to step back to a previous version. I'm glad I managed to set up my XP machine to being able to compile extensions using the VC++ toolkit which freely availbale from MS. See
1
6888
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 closes the window and gives no additional information. But I see that it generates first all the directories and files in c:\Programme but after the setup is end everything is deleted. Nearly everything , I see a service "MSSQLServerADHelper" is...
1
1659
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 interviewees (if any) who contributed to a particular report. What I need to be able to do is count up instances of repeated text within the database. For example, I would like to be able to run a query which would provide a list of all the various...
9
3270
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 Tools to do a memory dump of the app when the lock up occurs, however the stack information is not very useful. I have just put a new build of our system onto production, and this build is a "Debug" build as opposed to a "Release" build. I am...
2
1627
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, and will eventually be useful to me in it's own right. It function is to open a text file, and remove HTTP addresses from the file. The file is always in a certain format, and the HTTP address is always proceeded by a key phrase.
3
1580
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 programmes features is that it displays a list. The contents of this list are the names of people that are logged into the programme.
0
1438
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 a ton of structures, most of the containing other structures, arrays of structures, and unions of structures. I need help converting the following to managed code: The unmanaged structure is this: typedef struct { vc1_eBlkType eBlkType; /**...
0
1255
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 timetabling activities. Please note it is not expected to schedule classes. The information required are the programmes, the core and option modules for each programme, the activities (lecture, seminar, lab etc) connected with each module, the available rooms...
0
3192
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 fine. Now we decided to move from mainframe IMS-DB2 to Windows 2003 server-DB2 UDB for LUW 9.5.
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10309
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10289
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6840
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.