Jump to content
  • 0

How to use/get offsets


Bambook
 Share

Question

Hello, im learning gameguardian code, and offsets here is a very usefull thing. I looked so many tutorials, but i still dont understand: everything what im doing is wrong!

function setvalue(adress, flags, value)
x={}
x[1]={}
x[1].adress=adress
x[1].flags=flags
x[1].value=value
gg.setValue(x)
end
print(gg.setRangeList('lib.so'))
adr1 = gg.setRangeList('lib.so')[1].start
adr2 = adress

setvalue(adr1+adr2, flag, value)

This code i use to change offsets value, this is working but i can't understand: what should i choose here:image.thumb.png.a0c7e2b32bd467c07d814d48ed5a1453.png

Please help me!

Edited by Bambook
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
adr1 = gg.setRangeList('lib.so')[1].start

Here, the Xa range is not always on the index 1 can be on the index 2 sometime, and you got the Cd region in the index 1, so the best way is to dynamicaly check for the Xa range.
 

gg.setValue(x)

There is a typo here, the correct syntax is gg.setValues(x)

Another thing, you can hard code the flags as TYPE_QWORD so you dont have to pass it every time.
last thing you dont have to select anything in your gameguadian, the script is already getting the lib address.

So bellow is the fix of your code
 

local function getBaseAddr(lib)
  local ranges = gg.getRangesList(lib)
  for _, v in ipairs(ranges) do
    if v.state == 'Xa' then return v.start end
  end
end

local function setvalue(address, value)
  gg.setValues({ { address = address, flags = gg.TYPE_QWORD, value = value } })
end

local startAddr = getBaseAddr('lib.so')

setvalue(startAddr + 0x1C0B8, "HEX")
setvalue(startAddr + 0x1C0B8, "HEX")

 

Edited by MAARS
Link to comment
Share on other sites

  • 0
On 4/30/2023 at 2:37 PM, MAARS said:
adr1 = gg.setRangeList('lib.so')[1].start

Here, the Xa range is not always on the index 1 can be on the index 2 sometime, and you got the Cd region in the index 1, so the best way is to dynamicaly check for the Xa range.
 

gg.setValue(x)

There is a typo here, the correct syntax is gg.setValues(x)

Another thing, you can hard code the flags as TYPE_QWORD so you dont have to pass it every time.
last thing you dont have to select anything in your gameguadian, the script is already getting the lib address.

So bellow is the fix of your code
 

local function getBaseAddr(lib)
  local ranges = gg.getRangesList(lib)
  for _, v in ipairs(ranges) do
    if v.state == 'Xa' then return v.start end
  end
end

local function setvalue(address, value)
  gg.setValues({ { address = address, flags = gg.TYPE_QWORD, value = value } })
end

local startAddr = getBaseAddr('lib.so')

setvalue(startAddr + 0x1C0B8, "HEX")
setvalue(startAddr + 0x1C0B8, "HEX")

 

989044132_Screenshot_20230507-233059_X8Sandbox.thumb.jpg.21ad52e6173b39b4eb17962302326fe6.jpgidk what im doing wrong

Screenshot_20230507-233029_X8 Sandbox.jpg

Screenshot_20230507-232909_X8 Sandbox.jpg

Screenshot_20230507-232929_X8 Sandbox.jpg

Edited by Bambook
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.