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.5.2_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 ~= nil and 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 = "BETA 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 .. "频道: @PUBGMYTNB \n" TB = TB .. "作者: 叶天 */\n" gg.clearResults() gg.setVisible(false) -- 自定义函数补全 function getFloat(addr)return gg.getValues({{address=addr,flags=16}})[1].value end function getDword(addr)return gg.getValues({{address=addr,flags=4}})[1].value end searchValue("Gname","0.00001",nil,8,16) local TIM = gg.getResults(gg.getResultsCount()) local Addr = "" for i, v in ipairs (TIM) do if getFloat(v.address+0x10) == 1.0 and getDword(v.address+0x1C) == 4 then Addr = string.format("0x%x",v.address+0x14-UE4) break end end if Addr ~= "" then TB = TB .. "\nGname Offset -> "..Addr.." ) + 0x110);\n" end gg.clearResults() searchValue("GWorld","6208;110~130;-1;110~130;4::150","4",16,4) local _G = gg.getResults(gg.getResultsCount()) if _G[1] then local add = string.format("0x%x",_G[1].address+0x14-UE4) TB = TB.."\nGWorld Offset -> "..add.." ) + 0x50);\n" end gg.clearResults() searchValue("GNames","-113243141;-698416192;-1862269955;-113246200;-117437793::","-698416192",16384,4) fw = gg.getResults(1) if fw[1] then local add = string.format("0x%x",fw[1].address+0x14-UE4) TB = TB.."#define GNames_Offset "..add end gg.clearResults() searchValue("GEngine","1,119,092,736;1:29","1",16,4) local _G = gg.getResults(gg.getResultsCount()) if _G[1] then local offsets = string.format("0x%x",_G[1].address+0x40-UE4) TB = TB.."\n#define GEngine_Offset "..offsets.." //UlocalPlayer" end gg.clearResults() searchValue("GEngine","6208;6::","6",16,4) local _G = gg.getResults(gg.getResultsCount()) if _G[1] then local offsets = string.format("0x%x",_G[1].address+0x40-UE4) TB = TB.."\n#define GEngine_Offset "..offsets.." //UEngine" end gg.clearResults() searchValue("GUObject","480000;16384::21","480000",16,4) fw = gg.getResults(1) if fw[1] then local offsets = string.format("0x%x",fw[1].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) local _G = gg.getResults(gg.getResultsCount()) if _G[1] then local offsets = string.format("0x%x",_G[1].address-0x64-UE4) TB = TB.."\n#define GetActorArray_Offset "..offsets end gg.clearResults() searchValue("Canvas_Map","16384;2;4;128::91","2",16,4) fw = gg.getResults(1) if fw[1] then local offsets = string.format("0x%x",fw[1].address-UE4-0x8) TB = TB.."\n#define Canvas_Map_Offset "..offsets end gg.clearResults() searchValue("ProcessEvent","-1441528864;-1447396355;-717500327;-113240280;-1442774028::100","-1447396355",16384,4) local _G = gg.getResults(gg.getResultsCount()) if _G[1] then local offsets = string.format("0x%x",_G[1].address-UE4) TB = TB.."\n#define ProcessEvent_Offset "..offsets end gg.clearResults() searchValue("GNativeAndroidApp","65537;605::","65537",8,4) fw = gg.getResults(1) if fw[1] then local offsets = string.format("0x%x",fw[1].address-0x44-UE4) TB = TB.."\n#define GNativeAndroidApp_Offset "..offsets end gg.clearResults() searchValue("ULocalPlayer","16384D;90F::","90",16,16) fw = gg.getResults(1) if fw[1] then local add = string.format("0x%x",fw[1].address+0x14-UE4) local adds = string.format("0x%x",fw[1].address+0x14-UE4) TB = TB.."\n#define ULocalPlayer_Cb "..add TB = TB.."\n#define ULocalPlayer_Cd "..adds end gg.clearResults() searchValue("Actors","64;560;8;21::65","8",8,4) local _G = gg.getResults(gg.getResultsCount()) if _G[1] then local offsets = string.format("0x%x",_G[1].address+0x30-UE4) TB = TB.."\n#define Actors_Offset "..offsets.."\n" end gg.clearResults() searchValue("LaunchBP","-700514048;-698416192;-1124072480;-1442577421::78","-698416192",16384,4) local _G = gg.getResults(gg.getResultsCount()) if _G[1] then local offsets = string.format("0x%x",_G[1].address+0x4-UE4) TB = TB.."\n#define LaunchBP_Offset "..offsets.."//BP追踪" end gg.clearResults() searchValue("ShootBulletInner","-1455269898;-1442708512;-117437445;-1862269955;-1441528862::200","-1442708512",16384,4) local _G = gg.getResults(gg.getResultsCount()) if _G[1] then local offsets = string.format("0x%x",_G[1].address+0xC-UE4) TB = TB.."\n#define ShootBulletInner_Offset "..offsets.."//Sh追踪" end gg.clearResults() searchValue("UpdateVolleyShootParameters","2.19909036e12;-1.01171507e-28;-5.66681324e-23;-6.13017998e13::130","-6.13017998e13",16384,16) fw = gg.getResults(1) if fw[1] then local offsets = string.format("0x%x",fw[1].address+0x14-UE4) TB = TB.."\n#define UpdateVolleyShootParameters_Offset "..offsets.."//Up追踪" end gg.clearResults() searchValue("GetCameraRotation","-117440375;-698416192;-1442839582;-698416192;-1442839582::100","-1442839582",16384,4) fw = gg.getResults(1) if fw[1] then local offsets = string.format("0x%x",fw[1].address+0x1C-UE4) TB = TB.."\n#define GetCameraRotation_Offset "..offsets end gg.clearResults() searchValue("GetCameraLocation","-117440375;-698416192;-1459553283::150","-1459553283",16384,4) fw = gg.getResults(1) if fw[1] then local offsets = string.format("0x%x",fw[1].address-0x14-UE4) TB = TB.."\n#define GetCameraLocation_Offset "..offsets end gg.clearResults() TB = TB .. "\n\n退出.\nBy 叶天" addToFile(TB) gg.toast("偏移采集完成,已保存文件") print(TB)