CheatMaker 论坛

注册

 

发新话题 回复该主题

在Cheat Engine中批量添加地址 [复制链接]

1#
当你想添加无数道具/人物属性之类,假设它的第一个地址是0x1B7BD0,第二个的地址是0x1B7BD4 ....那么可以使用这个LUA脚本。
用法:
打开CE

复制代码到LUA引擎并运行
效果图:


LUA代码:
--[[
源代码&作者:
https://forum.cheatengine.org/viewtopic.php?t=609862&sid=7d1c8b7ce76f98b38a5c52bb8a0681cf
修改: xcdgs
]]

-----------------------用户可以自行配置的部分,修改时请不要删除代码中的引号----------------------
--[设置基地址]
local baseAddress =' [vbam.exe+0308B790]+0 '                                --此例为VBA-M 2.1.4 第一段基地址

--[设置条目的描述/名称]
local s_Description ="Cards"

--[设置子条目的起始偏移(0x 代表使用十六进制)]
local StepStart = 0x1B7BD0                                --假设你找到了一个道具,而且这个道具的偏移是 0x1B7BD0

--[设置偏移每次要增加的步长,此例为4]
local Step= 0x4                                                                        --假设你找到了第二个道具,她的偏移是1B7BD4,所以她的步长是 1B7BD4 - 1B7BD0 = 0x4 (步长)

--[设置子条目的数量,此例为10]
local num= 10                                                                        --假设这个游戏中总共有10个道具,道具的步长为0x4,
                                                                                                                        --则道具会批量添加为:1B7BD0 -> 1B7BD4 -> 1B7BD8 -> 1B7BDC  -> 1B7BE0  -> ......

--[设置条目/子条目要显示的类型,默认为 字节]
--[[
以下是可用的字节类型:
vtByte=字节,vtWord=2 字节,vtDword =4 字节,
vtQword =8 字节,vtSingle=单浮点,vtDouble=双浮点,
vtString=字符串,vtByteArray=字节数组,vtGrouped=群组
]]
local vtType=vtByte  

--[设置字符串长度.字节类型为字符串时此设置有效]
local StringSize=0




--------------------核心代码,如果不知道自己在做什么,请不要修改代码---------------------------
function addMoreAddresses(baseAddress, num, StepStart)  --基地址,数量,步长
local al = getAddressList() --获取地址列表

local base = al.createMemoryRecord()
base.setAddress(baseAddress)
base.setDescription(s_Description)
base.Type = vtType
base.String.Size = StringSize

for i=0, num-1  do
local rec = al.createMemoryRecord()
local str = string.format("+%X", StepStart)
rec.setAddress(str)
rec.setDescription(str)
rec.appendToEntry(base)
rec.Type = vtType
StepStart = StepStart + Step
end
end

addMoreAddresses(baseAddress, num,StepStart)

    已有1评分我要评分查看所有评分

    最后编辑dfzetcc 最后编辑于 2023-07-27 13:17:29
    分享 转发
    TOP
    2#

    数量多的时候比较实用的功能
    但看上去如果每个对象都是多级指针时应该是不支持的
    TOP
    发新话题 回复该主题