如何从内存中读取字节

时间:2018-02-28 13:02:55

标签: memory size offset

我想问两个问题..有一个游戏,有人为它创造了某种反作弊。他还提供了一个脚本功能,您可以在其中读取您选择的玩家记忆地址的最大4个字节(来自游戏的过程)..

我在这里粘贴了一个如何使用它的示例:

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        // read 1 byte from 0x8CB7A5 representing the radio station player is currently listening to.
        CAC_ReadMemory(playerid, 0x8CB7A5, 1);
    }
    return 1;
}

public CAC_OnMemoryRead(player_id, address, size, const content[])
{
    if(address == 0x8CB7A5 && size == 1)
    {
        // "content" is an array with "size" elements, each cell containing 1 byte.
        // We read only 1 byte, so the station id is at index 0.
        if(content[0] == 0x07) // 0x07 = Radio X
        {
            SendClientMessage(player_id, -1, "Radio X is indeed the best station.");
        }
        else
        {
            SendClientMessage(player_id, -1, "What the hell are you listening to ?!");
        }
    }
    return 1;
}

所以问题是我不知道我是如何找到一个特定的地址。我的目标是找出一个特定的.dll(人们注入“作弊”)的地址我可以从带脚本的游戏...所以我在桌面上有这个特定的文件,我不知道如何开始找出这个文件在注入时会使用什么样的内存地址..

感谢您提前提供任何帮助:)

0 个答案:

没有答案
相关问题