function cleanOffset(offset) if not offset or offset < 0 then return 0 end return offset end -- 时间段判断 原样不动 function getTimeText() local h = tonumber(os.date("%H")) if h >= 0 and h < 6 then return "凌晨" elseif h >= 6 and h < 10 then return "早上" elseif h >= 10 and h < 14 then return "中午" elseif h >= 14 and h < 18 then return "下午" elseif h >= 18 and h < 22 then return "晚上" else return "深夜" end end function addToFile(content) local filePath = "/storage/emulated/0/叶天_4.4.0_64Bit_偏移量.h" local file = io.open(filePath, "w") if file then file:write(content) file:close() end end function searchValue(name,searchStr,refineStr,range,dataType) gg.setRanges(range) gg.searchNumber(searchStr,dataType) if refineStr ~= "" then gg.refineNumber(refineStr,dataType) end end function getLibBase(libName) local ranges = gg.getRangesList(libName) if ranges and #ranges > 0 then return ranges[1].start end return nil end local UE4 = getLibBase("libUE4.so") local gameChineseName = "PUBG MOBILE" local packageName = gg.getTargetPackage() local gameInfo = gg.getTargetInfo() local gameVersionName = gameInfo and gameInfo.versionName or "未知" local versionCode = gameInfo and gameInfo.versionCode or "未知" local TB = "脚本已结束:\n" TB = TB .. "/*游戏进程: " .. gameChineseName .. "(" .. packageName .. ")\n" TB = TB .. "ABI架构: 64位 \n" TB = TB .. "版本/UID: " .. gameVersionName .. "/" .. versionCode .. "\n" TB = TB .. "抓取时间: " .. os.date("%Y年%m月%d日").." "..getTimeText().." "..os.date("%H时%M分%S秒").."\n" TB = TB .. "作者: 叶天 */\n" gg.clearResults() gg.setVisible(false) searchValue("Gname","1;5.60519386e-45::13","5.60519386e-45",16,16) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local addr = _G[1].address local off = string.format("0x%x",addr-UE4-0x8) TB = TB .. string.format("\nGname Offsets [0x%x] -> 0x%s ) + 0x110);",addr,off) end gg.clearResults() searchValue("VMatrix","90F;16384D","90",16,16) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local addr = _G[1].address local off = string.format("0x%x",addr-UE4+0x14) TB = TB .. string.format("\nVMatrix Offsets [0x%x] -> 0x%s ) + 0xC0);",addr,off) end gg.clearResults() searchValue("GNames","-698416192;-117412868;-1186987415::","-698416192",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x4) TB = TB .. "\n#define GNames_Offset "..off end gg.clearResults() searchValue("GEngineL","16384D;90::","90",16,16) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x14) TB = TB .. "\n#define GEngine_Offset "..off.." //ULocalPlayer" end gg.clearResults() searchValue("GEngineU","6208;6::","6",16,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x40) TB = TB .. "\n#define GEngine_Offset "..off.." //UEngine" end gg.clearResults() searchValue("GUObject","480000","",16,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local last = _G[#_G] local offsets = string.format("0x%x", last.address - UE4 - 0x18) TB = TB .. "\n#define GUObject_Offset " .. offsets end gg.clearResults() searchValue("GetActorArray","h01 3F D6 A0 00 00 36 68 42 44","-96",16384,1) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then for v in ipairs (_G) do local offsets = string.format("0x%x",_G[v].address-UE4+0x0) TB = TB .. "\n#define GetActorArray_Offset "..offsets end end gg.clearResults() searchValue("Canvas_Map","16384;2;4;128::91","2",16,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4-0x8) TB = TB .. "\n#define Canvas_Map_Offset "..off end gg.clearResults() searchValue("ProcessEventC","-113244184;-1275068352;-721215457;-1441463328;-700514048::250","-1275068352",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x14) TB = TB .. "\n#define ProcessEvent_Offset "..off.." //Child" end gg.clearResults() searchValue("ProcessEventM","-698416192;-1275068352;-700514048;-1205877854::520","-1275068352",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x14) TB = TB .. "\n#define ProcessEvent_Offset "..off.." //Main" end gg.clearResults() searchValue("GNativeAndroidApp","65537;605::","605",8,4,false) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local lastRes = _G[#_G] local offsets = string.format("0x%x",lastRes.address-UE4+0x8 - 0x60) TB = TB.."\n#define GNativeAndroidApp_Offset "..offsets end gg.clearResults() searchValue("PostRender","1409286305;-700514048;-788488192;-698416192;-700514048;-702611392::200","-788488192",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x18) TB = TB .. "\n#define PostRender_Offset "..off end gg.clearResults() searchValue("K2_DrawLine","-702611360;-698416192;-1459192835;-113168384::150","-1459192835",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4-0x4) TB = TB .. "\n#define K2_DrawLine_Offset "..off end gg.clearResults() searchValue("K2_DrawText","506276128;-117435415;-698416192::","-698416192",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x4) TB = TB .. "\n#define K2_DrawText_Offset "..off end gg.clearResults() searchValue("K2_DrawTextrue","-1454998531;-698416192;-1702362840::78","-698416192",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x4) TB = TB .. "\n#define K2_DrawTextrue_Offset "..off end gg.clearResults() searchValue("Actors","64;560;8;21::","8",8,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x30) TB = TB .. "\n#define Actors_Offset "..off end gg.clearResults() searchValue("LaunchBP","-700514048;-698416192;-1124072480;-1442577421::78","-698416192",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x4) TB = TB .. "\n#define LaunchBP_Offset "..off.." //BP追踪" end gg.clearResults() searchValue("ShootBulletInner","-113245952;-1441594400;-113154048;-113246200;-700514048::200","-113154048",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4-0x2C) TB = TB .. "\n#define ShootBulletInner_Offset "..off.." //Sh追踪" end gg.clearResults() searchValue("LineOfSightTo","-702611360;-698416192;-1861942275::43","-698416192",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x4) TB = TB .. "\n#define LineOfSightTo_Offset "..off.." //掩体判断" end gg.clearResults() searchValue("GetMuzzleTransform","-1862237185;-698416192;-1459269644;-113245560::100","-698416192",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then local off = string.format("0x%x",_G[1].address-UE4+0x10) TB = TB .. "\n#define GetMuzzleTransform_Offset "..off end gg.clearResults() searchValue("UpdateVolleyShootParameters","2.19913231e12;-6.13017998e13;-1.19265223e-7::150","-6.13017998e13",16384,4) _G = gg.getResults(gg.getResultsCount()) if _G and #_G>0 then for v in ipairs (_G) do local offsets = string.format("0x%x",_G[v].address-UE4+0x0) TB = TB .. "\n#define UpdateVolleyShootParameters_Offset "..offsets end end gg.clearResults() TB = TB .. "\n\n退出.\nBy 叶天" addToFile(TB) gg.toast("偏移采集完成,已保存文件") print(TB)