简体   繁体   English

卡在读取偏移量/指针上

[英]Stuck at reading offset/pointer

I am reading memory of a process like this: 我正在读取以下过程的内存:

int MEM_BATTLESPEED_ADDR = 0x12EC900; // <- this is a static address
int MEM_battleSpeed;
if (ReadProcessMemory(hProcess,(void *) MEM_BATTLESPEED_ADDR, &MEM_battleSpeed, 4, NULL))   
{
   cout << "MEM_battleSpeed: " << MEM_battleSpeed << "\r\n"; 
}

The address is static so it never changes when I restart the application. 该地址是静态的,因此在我重新启动应用程序时它永远不会改变。 I can read this without problem. 我可以毫无问题地阅读。 It's all okay. 没关系的

My problem is, some addresses aren't static. 我的问题是,某些地址不是静态的。 I know the offsets and pointers but I don't know how to read the following: 我知道偏移量和指针,但是我不知道如何阅读以下内容:

[Info]
$Static   = 0x12BCAC8
$Offset_1 = 0x07F8
$Offset_2 = 0x000C
$Offset_3 = 0x0284

How can I read the [Info] value? 如何读取[Info]值?

Adding the offset to the contents of the pointer gives the address that you want: 将偏移量添加到指针的内容即可得到所需的地址:

Static   = 0x12BCAC8;
Offset_1 = 0x07F8;

ReadProcessMemory(hProcess,(void *) (Static + Offset_1), &value, 4, NULL);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM