内存操作

请注意,内存操作时地址均使用不加0x的十六进制数

System_Memory_GetOffsetAddress(Address,Offset)

获取游戏内存的指定地址偏移

local offsetPtr = System_Memory_GetOffsetAddress('145073e80','A8')

此处获取某个内存地址的偏移地址,并非直接获取内存数据,类似于CE中的指针

System_Memory_GetAddressData(Address,Type)

获取游戏内存的指定地址数据

local MemoryData = System_Memory_GetAddressData('8ada0080','int')

此处数据类型包括int、float、bool、byte,需要使用小写字母写入

示例:获取猎人mr等级并写入缓存变量

local add = System_Memory_GetOffsetAddress('145073e80','0')
add = System_Memory_GetOffsetAddress(add ,'A8')
local data = System_Memory_GetAddressData(
    --注意,此处是一个地址加法计算,不能使用地址偏移,通常是ce指针的最后一个数
    string.format('%08X',
        (tonumber(add, 16) + tonumber('d4', 16))
    )
    ,'int')
    
Lua_Variable_SaveIntVariable('player mr', data)

System_Memory_SetAddressData(Address,Type,Value)

设置游戏内存的指定地址数据

System_Memory_SetAddressData('8ada0080','int',100)

此处数据类型包括int、float、bool、byte,需要使用小写字母写入

示例:设置猎人mr等级

local add = System_Memory_GetOffsetAddress('145073e80','0')
add = System_Memory_GetOffsetAddress(add ,'A8')
System_Memory_SetAddressData(
    --注意,此处是一个地址加法计算,不能使用地址偏移,通常是ce指针的最后一个数
    string.format('%08X',
        (tonumber(add, 16) + tonumber('d4', 16))
    )
    ,'int',100)

最后更新于