View Single Post
Old 03-16-2005, 04:49 AM   #1 (permalink)
madtown54
Registered User
 
Join Date: Mar 2005
Posts: 1
madtown54 is on a distinguished road
Accessing a specific memory address

I am creating a trainer for a game and I need to be able to read and write to a specific memory location. My first attempt was as follows:

int main(int argc, char *argv[]) {
int *num1;
void *p;
p = reinterpret_cast< void* > (0x04e27e74);
num1 = (int*)p;
printf("0x4e27e74=0x%x\n", *num1);
return 0;
}

but every time I run the code to see what is in the memory location I get an access violation exception. I though of using MK_FP, but I do not know what the segment address of this memory address is or how to figure it out.

Basically the above code segment is what I want to do, except I also want to write to the specific location, but it does not work. All sugestions are welcomed.

Madtown54
madtown54 is offline