function S_Pointer(t_So, t_Offset, _bit) local function getRanges() local ranges = {} local t = gg.getRangesList('^/data/*.so*$') for i, v in pairs(t) do if v.type:sub(2, 2) == 'w' then table.insert(ranges, v) end end return ranges end local function Get_Address(N_So, Offset, ti_bit) local ti = gg.getTargetInfo() local S_list = getRanges() local _t = ti_bit and 32 or 4 local _S = nil for i in pairs(S_list) do local _N = S_list[i].internalName:gsub('^.*/', '') if N_So[1] == _N and N_So[2] == S_list[i].state then _S = S_list[i] break end end if not _S then return nil end local t = {{address = _S.start + Offset[1], flags = _t}} if #Offset ~= 1 then for i = 2, #Offset do local S = gg.getValues(t) t = {} for _,v in pairs(S) do if not ti.x64 then v.value = v.value & 0xFFFFFFFF end t[#t+1] = {address = v.value + Offset[i], flags = _t} end end end return t[#t].address end return Get_Address(t_So, t_Offset, _bit) end local so_gun = {"libunity.so", "Cd"} local off_gun = {0x1F5A0, 0xEC} local function gunRangeOn() local addr = S_Pointer(so_gun, off_gun, true) if addr then gg.setValues({{address=addr,flags=16,value=15}}) gg.toast("gun range on") else gg.toast("addr fail") end end local function gunRangeOff() local addr = S_Pointer(so_gun, off_gun, true) if addr then gg.setValues({{address=addr,flags=16,value=1}}) gg.toast("gun range off") else gg.toast("addr fail") end end local menuList = { "1. Gun Range On", "2. Gun Range Off", "0. Exit" } while true do local choose = gg.choice(menuList,nil,"Menu") if choose == nil or choose == #menuList then break end if choose == 1 then gunRangeOn() elseif choose == 2 then gunRangeOff() end gg.sleep(200) end