Jump to content
  • 0

Lua script error can't figure out.


CoyFanatic
 Share

Question

I've been working on this script where I do a group search with static values and a specific offset to get the address of that one hack value whose address changes after restart . Something like this:

gg.setRanges(gg.REGION_CODE_APP)
function Zoom()
gg.searchNumber('36;0~~0::377', gg.TYPE_DOUBLE)
gg.refineNumber('1;0~~0::265', gg.TYPE_DOUBLE)
local t = gg.getResults(67)
t[14].value = '9' print('done',gg.setValues(t))
end
local a = gg.choice({'Zoom','exit'})
if a == 1 then Zoom() end
if a == 2 then os.exit() end

So basically I want the 14th value of the table to be 9 (value type double) but unfortunately it's not changing when I launch the script. When I manually edit the value (without script) it works like a charm. Can anyone please tell me where I went wrong:(

Link to comment
Share on other sites

Recommended Posts

  • 0
On 10/25/2020 at 8:48 PM, Lover1500 said:

Yes. Many scriptors also use group search. 

Most use group search directly. Few search single value and check around with offset. 

Same results but different run time.

 

 

On 10/25/2020 at 8:48 PM, Lover1500 said:

Yes. Many scriptors also use group search. 

Most use group search directly. Few search single value and check around with offset. 

Same results but different run time. 

Just one last thing my guy. How will I add the offset to an address in a script? I have seen many forums here which shows the example but I couldn't understand how it works. Like if I have the address of a value and it's offset then in script do I use this?

offset = bla bla

Table = r[1].address + offset -- r[1] is the static value. 

But what do I do after this to edit the value of the address stored in table. I mean I can't comprehend how or what it is stored as.

Edited by CoyFanatic
Link to comment
Share on other sites

  • 0
4 hours ago, CoyFanatic said:

Just one last thing my guy. How will I add the offset to an address in a script? I have seen many forums here which shows the example but I couldn't understand how it works. Like if I have the address of a value and it's offset then in script do I use this?

offset = bla bla

Table = r[1].address + offset -- r[1] is the static value. 

But what do I do after this to edit the value of the address stored in table. I mean I can't comprehend how or what it is stored as.

Distance between two addresses is offset.

Address 4C - address 44 = offset 8

Imagine below. 

address >>> value >>> type

0004 >>> 11223344 >>> dword -- static
0008 >>> 84 >>> float -- current health
000C >>> 100 >>> dword -- max health(static)

In this case, we can search two static value as group search. They two are away at offset 8.

gg.searchNumber('11223344;100::9', 4)
gg.refineNumber('100') -- refine one static code
p = gg.getResults(gg.getResultCount()) 
--Let it be we get 1 result

--now we have static code 100.but we want edit above its address.need to subtract offset 4 to get address of current health

--Let build a table for current health.
--we'll use gg.setValues(). to use it,we need two info atleast. 
--address and type. about value? we can get by gg.getValues().

hi = {}
hi[1] = {}
hi[1].address = p[1].address - 0x4
hi[1].flags = gg.TYPE_FLOAT -- health is float
hi = gg.getValues(hi) --attempt to get value

print(hi[1].value) -->output is 84

hi[1].value = 445566
gg.setValues(hi)

--now health will be edited as 445566.

This is some usage of offset edit. If results are more than 1 ,you can set a loop.

Idk its a need to you. But you will .

Link to comment
Share on other sites

  • 0
19 hours ago, Lover1500 said:

Distance between two addresses is offset.

Address 4C - address 44 = offset 8

Imagine below. 


address >>> value >>> type

0004 >>> 11223344 >>> dword -- static
0008 >>> 84 >>> float -- current health
000C >>> 100 >>> dword -- max health(static)

In this case, we can search two static value as group search. They two are away at offset 8.


gg.searchNumber('11223344;100::9', 4)
gg.refineNumber('100') -- refine one static code
p = gg.getResults(gg.getResultCount()) 
--Let it be we get 1 result

--now we have static code 100.but we want edit above its address.need to subtract offset 4 to get address of current health

--Let build a table for current health.
--we'll use gg.setValues(). to use it,we need two info atleast. 
--address and type. about value? we can get by gg.getValues().

hi = {}
hi[1] = {}
hi[1].address = p[1].address - 0x4
hi[1].flags = gg.TYPE_FLOAT -- health is float
hi = gg.getValues(hi) --attempt to get value

print(hi[1].value) -->output is 84

hi[1].value = 445566
gg.setValues(hi)

--now health will be edited as 445566.

This is some usage of offset edit. If results are more than 1 ,you can set a loop.

Idk its a need to you. But you will .

This is perfect now I understand thanks again I appreciate this 🙂 .

Link to comment
Share on other sites

  • 0

@TekMonts

l = gg.getRangesList('libil2cpp.so')
if (l[1] ~= nil) then libaddres = string.format( "0X%8.8X", t[1]['start'] ) end

function haxx(offsethax,valuehax,type)
	_address = libaddres + offsethax
	local _value = {}
	_value[1] = {}
	_value[1].address = _address
	_value[1].flags = type
	_value[1].value = valuehax
	gg.setValues(_value)
end

function main()
  gg.alert("begin hack abc at xyz")
  haxx(0xABCDEF01, 9999, 16)
end

give another example plss,to make it clear for me

 

i want to edit the value which is

offset > 0xABCDEF02

edit value to > 1000

edit value 1000 type > dword

how to insert into the command u provided..thx

 

 

Link to comment
Share on other sites

  • 0
On 5/24/2021 at 2:22 PM, HAaHUuHIi said:

@TekMonts


l = gg.getRangesList('libil2cpp.so')
if (l[1] ~= nil) then libaddres = string.format( "0X%8.8X", t[1]['start'] ) end

function haxx(offsethax,valuehax,type)
	_address = libaddres + offsethax
	local _value = {}
	_value[1] = {}
	_value[1].address = _address
	_value[1].flags = type
	_value[1].value = valuehax
	gg.setValues(_value)
end

function main()
  gg.alert("begin hack abc at xyz")
  haxx(0xABCDEF01, 9999, 16)
end

give another example plss,to make it clear for me

 

i want to edit the value which is

offset > 0xABCDEF02

edit value to > 1000

edit value 1000 type > dword

how to insert into the command u provided..thx

 

 

l = gg.getRangesList('libil2cpp.so') --get the range address from lib
if (l[1] ~= nil) then libaddres = string.format( "0X%8.8X", t[1]['start'] ) end --check null and set memory where GG start working at

function haxx(offsethax,valuehax,type)
	_address = libaddres + offsethax
	local _value = {}
	_value[1] = {}
	_value[1].address = _address
	_value[1].flags = type
	_value[1].value = valuehax
	gg.setValues(_value)
end

function main()
  gg.alert("begin hack value 1000 type DWORD at 0xABCDEF02")
  haxx(0xABCDEF02, 1000, gg.TYPE_DWORD) -- call function, where 0xABCDEF02 is offset need to change, value 1000, type dword
end

 

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.