Accessing direct memory addresses and obtaining the values in C++

前端 未结 5 1404
遇见更好的自我
遇见更好的自我 2020-12-31 04:14

I was wondering if it was possible to access a direct block of memory using C/C++ and grab the value. For example:

int i = 15;
int *p = &i;
cout <<         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 04:40

    If you want to change the memory used by another process, one way would be to inject your code into the other process. From that point, you can do whatever you want to the other program's memory as if it were your owns.

    Search around for remote thread creation or hooking. There are more than a few questions about it here (and here, for starters).

提交回复
热议问题