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 --搜索函数:name,搜,精搜,范围,类型,false function searchValue(name,searchStr,refineStr,range,dataType,isd) local st = os.clock()*1000 gg.setRanges(range) gg.searchNumber(searchStr,dataType) if refineStr ~= nil and refineStr ~= "" then gg.refineNumber(refineStr,dataType) end return os.clock()*1000 - st 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 UE4bss = getLibBase("libUE4.so",2) 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) --GName local cost = searchValue("GName","0.00001",nil,8,16,false) local TIM = gg.getResults(gg.getResultsCount()) local Addr = nil if #TIM>0 then Addr = string.format("0x%x",TIM[1].address+0x14-UE4) TB = TB..string.format("GName_Offset [0x%x] -> %s [%.1fms]\n",TIM[1].address,Addr,cost) else TB = TB..string.format("GName_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --GNames cost = searchValue("GNames","-113243141;-698416192;-1862269955;-113246200;-117437793::","-698416192",16384,4,false) local fw = gg.getResults(1) if #fw>0 then local add = string.format("0x%x",fw[1].address+0x14-UE4) TB = TB..string.format("GNames_Offset [0x%x] -> %s [%.1fms]\n",fw[1].address,add,cost) else TB = TB..string.format("GNames_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --GEngine UEngine cost = searchValue("GEngine","6208;6::","6",16,4,false) local _G = gg.getResults(gg.getResultsCount()) if #_G>0 then for _,v in ipairs (_G) do local offsets = string.format("0x%x",v.address+0x40-UE4) TB = TB..string.format("GEngine_Offset [0x%x] -> %s [%.1fms]\n",v.address,offsets,cost) end else TB = TB..string.format("GEngine_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --GWorld cost = searchValue("GWorld","6208;110~130;-1;110~130;4::150","4",16,4,false) _G = gg.getResults(gg.getResultsCount()) if #_G>0 then for _,v in ipairs (_G) do local add = string.format("0x%x",v.address+0x14-UE4) TB = TB..string.format("GWorld_Offset [0x%x] -> %s [%.1fms]\n",v.address,add,cost) end else TB = TB..string.format("GWorld_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --GUObject cost = searchValue("GUObject","480000;16384::21","480000",16,4,false) fw = gg.getResults(1) if #fw>0 then local offsets = string.format("0x%x",fw[1].address-UE4-0x18) TB = TB..string.format("GUObject_Offset [0x%x] -> %s [%.1fms]\n",fw[1].address,offsets,cost) else TB = TB..string.format("GUObject_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --GetActorArray cost = searchValue("GetActorArray","h01 3F D6 A0 00 00 36 68 42 44","-96",16384,1,false) _G = gg.getResults(gg.getResultsCount()) if #_G>0 then for _,v in ipairs (_G) do local offsets = string.format("0x%x",v.address-0x64-UE4) TB = TB..string.format("GetActorArray_Offset [0x%x] -> %s [%.1fms]\n",v.address,offsets,cost) end else TB = TB..string.format("GetActorArray_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --Canvas_Map cost = searchValue("Canvas_Map","16384;2;4;128::91","2",16,4,false) fw = gg.getResults(1) if #fw>0 then local offsets = string.format("0x%x",fw[1].address-UE4-0x8) TB = TB..string.format("Canvas_Map_Offset [0x%x] -> %s [%.1fms]\n",fw[1].address,offsets,cost) else TB = TB..string.format("Canvas_Map_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --ProcessEvent cost = searchValue("ProcessEvent","-1441528864;-1447396355;-717500327;-113240280;-1442774028::100","-1447396355",16384,4,false) _G = gg.getResults(gg.getResultsCount()) if #_G>0 then for _,v in ipairs (_G) do local offsets = string.format("0x%x",v.address-UE4) TB = TB..string.format("Process_Event_Offset [0x%x] -> %s [%.1fms]\n",v.address,offsets,cost) end else TB = TB..string.format("Process_Event_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --GNativeAndroidApp cost = searchValue("GNativeAndroidApp","65537;605::","65537",8,4,false) fw = gg.getResults(1) if #fw>0 then local offsets = string.format("0x%x",fw[1].address-0x44-UE4) TB = TB..string.format("GNativeAndroidApp_Offset [0x%x] -> %s [%.1fms]\n",fw[1].address,offsets,cost) else TB = TB..string.format("GNativeAndroidApp_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --ULocalPlayer cost = searchValue("ULocalPlayer","16384D;90F::","90",16,16,false) fw = gg.getResults(1) if #fw>0 then local adds = string.format("0x%x",fw[1].address+0x14-UE4) TB = TB..string.format("GEngine_Offset [0x%x] -> %s [%.1fms]\n",fw[1].address,adds,cost) else TB = TB..string.format("GEngine_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --LaunchBP cost = searchValue("LaunchBP","-700514048;-698416192;-1124072480;-1442577421::78","-698416192",16384,4,false) _G = gg.getResults(gg.getResultsCount()) if #_G>0 then for _,v in ipairs (_G) do local offsets = string.format("0x%x",v.address+0x4-UE4) TB = TB..string.format("LaunchBP_Offsets [0x%x] -> %s [%.1fms]\n",v.address,offsets,cost) end else TB = TB..string.format("LaunchBP_Offsets: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --ShootBulletInner cost = searchValue("ShootBulletInner","-1455269898;-1442708512;-117437445;-1862269955;-1441528862::200","-1442708512",16384,4,false) _G = gg.getResults(gg.getResultsCount()) if #_G>0 then for _,v in ipairs (_G) do local offsets = string.format("0x%x",v.address+0xC-UE4) TB = TB..string.format("ShootBulletInner_Offset [0x%x] -> %s [%.1fms]\n",v.address,offsets,cost) end else TB = TB..string.format("ShootBulletInner_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --UpdateVolleyShootParameters cost = searchValue("UpdateVolleyShootParameters","2.19909036e12;-1.01171507e-28;-5.66681324e-23;-6.13017998e13::130","-6.13017998e13",16384,16,false) fw = gg.getResults(1) if #fw>0 then local offsets = string.format("0x%x",fw[1].address+0x14-UE4) TB = TB..string.format("UpdateVolleyShootParameters_Offset [0x%x] -> %s [%.1fms]\n",fw[1].address,offsets,cost) else TB = TB..string.format("UpdateVolleyShootParameters_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --GetCameraRotation cost = searchValue("GetCameraRotation","-117440375;-698416192;-1442839582;-698416192;-1442839582::100","-1442839582",16384,4,false) fw = gg.getResults(1) if #fw>0 then local offsets = string.format("0x%x",fw[1].address+0x1C-UE4) TB = TB..string.format("GetCameraRotation_Offset [0x%x] -> %s [%.1fms]\n",fw[1].address,offsets,cost) else TB = TB..string.format("GetCameraRotation_Offset: 搜索失败 [%.1fms]\n",cost) end gg.clearResults() --GetCameraLocation cost = searchValue("GetCameraLocation","-117440375;-698416192;-1459553283::150","-1459553283",16384,4,false) fw = gg.getResults(1) if #fw>0 then local offsets = string.format("0x%x",fw[1].address-0x14-UE4) TB = TB..string.format("GetCameraLocation_Offset [0x%x] -> %s [%.1fms]",fw[1].address,offsets,cost) else TB = TB..string.format("GetCameraLocation_Offset: 搜索失败 [%.1fms]",cost) end TB = TB .. "\n\n退出.\nBy 叶天" addToFile(TB) gg.toast("偏移采集完成,已保存文件") print(TB)