there are ways to do this, of course.
If you use C/C++ you could do inline asm (there may be mistakes, because im new to all this):
in intel syntax it would be something like this:
Code:
DWORD my_addr=0x403000; //the address where the data is stored
DWORD my_var; //the varaiable to store the data
__asm("mov eax, my_addr");
__asm("mov my_var, DWORD PTR DS:[eax]");
in AT&T:
Code:
DWORD my_addr=0x403000; //the address where the data is stored
DWORD my_var; //the varaiable to store the data
__asm("movl _my_addr,%eax");
__asm("movl (%eax), _my_var");
//as far as I know, my_var and my_addr must be [I]global[/I] variables
or use pointers:
PHP Code:
#include <iostream>
using namespace std;
int main() {
int* ptr=(int*) 0x403000;
cout <<"address is: " << ptr << endl;
cout << "value is: " << *ptr << endl;
}
you can also use memcpy, of course.
PHP Code:
#include <iostream>
#include <strings.h>
using namespace std;
int main() {
char buf[10];
int my_size=4; //=> 4 bytes
const void* my_addr= (const void*) 0x403000;
memcpy(buf, my_addr, my_size);
cout << "my Value: " << buf;
}