Click to See Complete Forum and Search --> : Question (memory) how to??
[T.S]Psycho
January 15th, 2008, 01:31 PM
Hello all,
I'm quiet a newbie to C++, I know a bit PHP, Javascript, and know Action Scripts.
My question that I have is how to store or possibly display a value from a memory address on your screen.
I want to know this to possibly make an applet for my G15 keyboard.
Maybe one knows even how exactly to make an applet for a G15 keyboard and wants to help me, I could provide you with the memory addresses I want to display.
It's about an applet for Unreal Tournament 3, to display the ammo amount from all weapons, you health/armor status, score, kills, deaths and ping.
[T.S]Psycho
January 19th, 2008, 08:15 PM
Any one have an answer ?
A tutorial you could refer to that I can read to learn how to display a memory value on the screen. (How to get the memory value)
dglienna
January 19th, 2008, 10:11 PM
What is a G15? I don't know.
sjaycohn
January 20th, 2008, 10:30 AM
Nice Keyboard!!
Did you actually dish out the cash for that or was it a gift?
OK, to answer your question, you can access memory in many different ways in C and C++.
Let me first ask you what kind of program you are writing:
Is this a Windows console program with that stupid black output window using printf or cout, or is this a Windows GUI program?
I can give help you with either one.
Let me first start off by saying that you do not have direct access to memory locations outside your program. Windows is a protect memory Operating System, and each program is granted its own memory space, so not only do real memory locations not exist to your program, but they are mapped anyway so any address that can be returned is likely a fake address.
OK, to access memory, you could either first have a predesignated memory space using a variable such as:
int space1;
OR int space2;
You can store whatever you want because this is a 32-bit integer and will hold 4 bytes.
You can print like this printf("%d", space1); or cout << space1;
if your program is console mode.
You would use the TextOut fuction if you program is a Windows GUI program.
The other way to access memory is through use of arrays or pointers.
The following may or may not work depending on both your compiler, and Operating System. This is the C way to access memory directly. You probably won't have access to this specific memory location, but you should still look up pointers - try Google.
int * paddress = (int *) 0x0000000F;
int data_at_that_address = *paddress;
You could print the data at that memory location like this:
cout << data_at_that_address;
Or you could modify the data at that address like this:
*paddress = 20; //Random data - 20
I hope this helps.
sjaycohn
January 20th, 2008, 10:33 AM
Oh, did you want to display the data on the computer screen or right on the keyboard.
If you want to do this on the keyboard, you would have to look at the API provided for that keyboard - if they even allow that.
Or I might be able to help you when I have more time.
Do you have a link to the users manual or Programming API that you could give me?
[T.S]Psycho
January 22nd, 2008, 04:18 AM
I want to display it directly on my keyboard (the lcd).
I have included two archivers (.zip) that includes the total SDK folder.
So if you have the time and would like to make me the applet that would be great ^^. The memory values I want to display I can provide if needed.
The applet is to display (to start with) the ammo count of the weapons in Unreal Tournament 3. If that is working I want to make a second applet that displays the score (team or individual), kills, deaths, ping, server-ip/name.
I will try to make it myself but like I said I quiet a newbie with C++
If you make it I shall upload it to my own webserver and post it on some of the larger communitie sites with credits to you (the maker).
sjaycohn
January 24th, 2008, 01:09 PM
Sorry for not getting back to you sooner, but are you still interested in help.
You forgot to post the ZIPs.
Attach them and I'll take a look at them.
By the way, one thing I should ask, if you are trying to display this stuff on your keyboard, does the game grant you access to this data.
I'm pretty sure the keyboard lets you display whatever you want.
If you want, you can email the zips to my gmail account: jasond.cohn@gmail.com
I will take a look at them ASAP, and see what I can come up with.
TheCPUWizard
January 24th, 2008, 01:19 PM
Let me first start off by saying that you do not have direct access to memory locations outside your program. Windows is a protect memory Operating System, and each program is granted its own memory space, so not only do real memory locations not exist to your program, but they are mapped anyway so any address that can be returned is likely a fake address.
Sure, you have full access to ALL memory. All you have to do is write a Ring-0 Kernel mode program. :p
(Probably a bit advanced for a beginner :lol: )
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.