bb=require ("Memory")
require ("SYSMen")
local pkg="com.airuika.hxxys.HUAWEI"
local baseModule=bb.GetModuleHandle (pkg,"libunity.so")
local tmpAddr=bb.MemoryRead (pkg, baseModule+0x4bec,"U32") --u32有符号四字节整数 32位 U64 64位
print (tmpAddr)
tmpAddr=bb.MemoryRead (pkg, tmpAddr+ 0x602,"U32") --tmpAddr 临时地址
tmpAddr=bb.MemoryRead (pkg, tmpAddr+ 0x810,"U32") --tmpAddr 临时地址
for i=1,10000 do
local blood =bb.MemoryRead (pkg, tmpAddr+ 0xba0,"U32") --当前的血值
local bloodCode =bb.MemoryRead (pkg, tmpAddr+ 0xba8,"U32") --校验值
print (blood,bloodCode)
if blood<500 then
bb.MemoryWrite (pkg, tmpAddr+ 0xba0,726,"U32") --写入血值
bb.MemoryWrite (pkg, tmpAddr+ 0xba8,726+1689,"U32") --写入校验值
end
sleep (100)
end