Jump to content

LUA scripting


Enyby
 Share

Recommended Posts

16 hours ago, tthgj said:

How to write a value that gets the address and then change the value found by the search to the value obtained

-- <your_address>
-- <your_type> like gg.TYPE_DWORD, gg.TYPE_FLOAT ...
-- <your_search_number> like "10" or "10;10;10;10::16"
..
local A,b,l
..
A = gg.getValues({{address = <your_address>, flags = <your_type>}})[1].value
..
gg.searchNumber(<your_search_number>, <your_type>)
b = gg.getResults(1)
gg.setValues({{address = b[1].address, flags = <your_type>, value = A}})
..

 

Link to comment
Share on other sites

So I want to search for a value and then get the address of the value and then do an address search for the address of the value to get how to write it into a script.

Edited by tthgj
Didn't say specifically.
Link to comment
Share on other sites

[ @tthgj ]
---
I'm honestly confused on what you're trying to say. Please add punctuation and explain it slowly. So this is what I understand:
Find value -> get the address from result -> address search, you mean pointer? -> and then save it:

gg.searchNumber('10', gg.TYPE_DWORD)
gg.loadResults( gg.getResults( gg.getResultsCount() ) )
gg.searchPointer()

*Use DWORD: for 32-bit & QWORD: for 64-bit
---

Link to comment
Share on other sites

how to freeze the value?
put addListItems before setValues or after setValues?
BadCase's GGIl2cpp Toolbox 1.0.4
 

function handleFieldEdits(className, fieldEditsTable, classTable, functionIndex)
    local classInstances = Il2cpp.FindObject({className})[1]
    local tempTable = {}
    for i, v in pairs(classInstances) do
        for index, value in pairs(fieldEditsTable) do
            for fieldIndex, fieldData in pairs(classTable.Fields) do
                if value.FieldName == fieldData.FieldName then
                    tempTable[#tempTable + 1] = {
                        address = v.address + tonumber(fieldData.Offset, 16),
                        flags = gg.TYPE_DWORD,
                        value = value.edit,
						freeze = true --freeze value
                    }
                end
            end
        end
    end
    restoreFields[functionIndex] = gg.getValues(tempTable)

	gg.addListItems(tempTable) -- add to save list for freeze. before setValues or after setValues ?
	gg.setValues(tempTable) -- set the value

end

 

Link to comment
Share on other sites

8 hours ago, kiynox said:

[@tthgj ]
---
老实说我对你想说的感到困惑。请加上标点符号并慢慢解释。这就是我的理解:
查找值->从结果中获取地址->地址搜索,你的意思是指针?-> 然后保存:

   

*使用 DWORD:适用于 32 位 & QWORD:适用于 64 位
---

8 hours ago, kiynox said:

[@tthgj ]
---
老实说我对你想说的感到困惑。请加上标点符号并慢慢解释。这就是我的理解:
查找值->从结果中获取地址->地址搜索,你的意思是指针?-> 然后保存:

   

*使用 DWORD:适用于 32 位 & QWORD:适用于 64 位
---

1.Search for a value.

2.Get the address of the value.

3.Search Address.

4.Modify the value of this address to 99.

I want it to search for the value only once and then loop through the following.

Link to comment
Share on other sites

[ @tthgj ]
---
You don't need loop, using "gg.editAll" will change all the value of the address to your desires.

# Search for Dword: 10
gg.searchNumber('10', gg.TYPE_DWORD)

# Edit all value to 99
gg.getResults(gg.getResultsCount())
gg.editAll('99', gg.TYPE_DWORD)

---
I recommend to read our documentation: here

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.