0

当我写入具有多个偏移量的地址时,我遇到了问题。

值不变。

代码:

int Base = 0x00477958;
VAMemory vam = new VAMemory("gameNameHere");

int localPlayer = vam.ReadInt32((IntPtr)Base);

while (true)
{
    int address = localPlayer + 0x34 + 0x6c + 0x6fc; // base + offsets (Score Pointer)
    vam.WriteInt32((IntPtr)(address), 5000000); // here if i replaced address with 0x02379F1C, it will work but that's not dynamic

    Thread.Sleep(500);
}

我使用作弊引擎来获取偏移量,然后我重新启动游戏以检查我的偏移量是否正确

00477958 -> 02522880
02522880 + 6FC -> 023D5B00
023D5B00 + 6C -> 02379EE8
02379EE8 + 34 -> 02379F1C

02379F1C = 5034500 // Score
4

1 回答 1

2

指针不能那样工作,您需要在每个级别“取消引用”。我继续并修复了您的代码。

应该很容易理解并理解正在发生的事情。

代码

int Base = 0x00477958;
VAMemory vam = new VAMemory("gameNameHere");

// So first you dereference the base address (read it)
int localPlayer = vam.ReadInt32((IntPtr)Base);

while (true)
{
    // for every offset you do the same until the last one
    int buffer = vam.ReadInt32((IntPtr)(localPlayer + 0x6FC));
    buffer = vam.ReadInt32((IntPtr)(buffer + 0x6C));

    // last offset you can just add to the buffer and it'll point to the memory address you intend on writing to. 
    IntPtr pScore = (IntPtr)(buffer + 0x34);

    vam.WriteInt32(pScore, 5000000); 

    Thread.Sleep(500);
}

此外,与您发布的指针路径相比,您似乎是以向后的顺序添加偏移量(尽管这并不重要,因为您做错了,加上可交换属性......),或者至少它向后看我希望上面代码中的顺序是正确的,但如果不是,那么你就知道问题所在了。

于 2018-11-18T20:54:43.960 回答