|
-
May 13th, 2009, 05:48 AM
#1
how to read memory address and get its value
hi, i want to read memory at adress 02804C20 and get its value, this should be simple but i'm a little new at this ^^
it should be something like
char txt[512];
txt = value.from.memory.at(02804C20);
-
May 13th, 2009, 06:01 AM
#2
Re: how to read memory address and get its value
Code:
memcpy (txt, (char*)(02804C20), sizeof(txt));
Why do you want to read something from a static memory address ?
-
May 13th, 2009, 06:04 AM
#3
Re: how to read memory address and get its value
i thougt i'd need a pointer at first too, but address was fully static
-
May 13th, 2009, 06:09 AM
#4
Re: how to read memory address and get its value
i thougt i'd need a pointer at first too, but address was fully static
Memory addresses change every time you run your program... that's why I asked.
-
May 13th, 2009, 06:32 AM
#5
Re: how to read memory address and get its value
 Originally Posted by Skizmo
Code:
memcpy (txt, (char*)(02804C20), sizeof(txt));
Why do you want to read something from a static memory address ?
that gives me errors =\
wrong syffix for number
bad number 8 for base 8
sint error: no ) before C20
sint error: no )
-
May 13th, 2009, 06:39 AM
#6
Re: how to read memory address and get its value
oops.. my bad...
Code:
memcpy (txt, (char*)(0x02804C20), sizeof(txt));
-
May 13th, 2009, 06:41 AM
#7
Re: how to read memory address and get its value
thx) works
btw sizeof(text) returns real size of text or its maxsize? or maxsize was maxsizeof(txt) ?
Last edited by Owyn; May 13th, 2009 at 07:00 AM.
-
May 13th, 2009, 07:06 AM
#8
Re: how to read memory address and get its value
sizeof(txt) is 512. It returns 512 * sizeof(char).
-
May 13th, 2009, 08:02 AM
#9
Re: how to read memory address and get its value
plus, how do i get value from 4 bytes address into an int ?
ps-how do i get the real size? like if char = '12345" so it'd be 5 or 6
-
May 13th, 2009, 08:05 AM
#10
Re: how to read memory address and get its value
like if char = '12345" so it'd be 5 or 6
strlen
-
May 13th, 2009, 08:10 AM
#11
Re: how to read memory address and get its value
thx, but what about int value? i have an adress 4 bytes which has a number, i need this number to count things
-
May 13th, 2009, 08:11 AM
#12
Re: how to read memory address and get its value
 Originally Posted by Owyn
i thougt i'd need a pointer at first too, but address was fully static
You didn't answer the question.
Why do you want to read the memory at a certain address? What application are you writing that requires this?
Regards,
Paul McKenzie
-
May 13th, 2009, 08:19 AM
#13
Re: how to read memory address and get its value
 Originally Posted by Paul McKenzie
You didn't answer the question.
Why do you want to read the memory at a certain address? What application are you writing that requires this?
Regards,
Paul McKenzie
an opengl game, i looked for a pointer but it was the address itself or something like that
-
May 13th, 2009, 08:22 AM
#14
Re: how to read memory address and get its value
Unless you're working with very specialized hardware, there's almost no reason ever to hard-code a particular address.
-
May 13th, 2009, 08:24 AM
#15
Re: how to read memory address and get its value
If you have a pointer, you can just dereference it (assuming you know what kind of data it is pointing at). I think you're missing some simple C++ concept here (or you're trying to cheat at the game).
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|