Jump to content

Recommended Posts

Posted
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}})
..

 

Posted (edited)

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.
Posted

[ @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
---

Posted

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

 

Posted
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.

Posted

[ @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

  • 1 year later...
Posted (edited)

I need to write a script could you help me 

I need to search for a value then refine a value less by a certain amount than the search value like 2 for example

 

I need to write a script could you help me 

I need to search for a value the refine a value less by a certain amount than the search value like 2 for example

 

Edited by Jackdenmo2133
  • 4 weeks later...
Posted
On 1/12/2025 at 3:43 AM, Jackdenmo2133 said:

I need to write a script could you help me 

I need to search for a value then refine a value less by a certain amount than the search value like 2 for example

 

I need to write a script could you help me 

I need to search for a value the refine a value less by a certain amount than the search value like 2 for example

 

-- Define the menu options
menu = gg.choice({
    "1. Enter Value and Search",
    "2. Refine Search",
    "3. Edit Results",
    "4. Exit"
}, nil, "Game Guardian Script")
-- Function to search for the value in memory
function searchValue()
    gg.clearResults()
    value = gg.prompt({"Enter the value to search:"}, {[1] = "0"}, {[1] = "number"})
    if value == nil then return end
    
    dataType = gg.choice({
        "1. Dword",
        "2. Float",
        "3. Double",
        "4. Word",
        "5. Byte"
    }, nil, "Select Data Type")
    
    if dataType == nil then return end
    
    local typeMap = {
        [1] = gg.TYPE_DWORD,
        [2] = gg.TYPE_FLOAT,
        [3] = gg.TYPE_DOUBLE,
        [4] = gg.TYPE_WORD,
        [5] = gg.TYPE_BYTE
    }
    
    gg.searchNumber(value[1], typeMap[dataType])
    gg.toast("Search completed!")
end
-- Function to refine the search results
function refineSearch()
    value = gg.prompt({"Enter the new value to refine search:"}, {[1] = "0"}, {[1] = "number"})
    if value == nil then return end
    
    gg.refineNumber(value[1], gg.TYPE_DWORD) -- Default to DWORD for refinement
    gg.toast("Refinement completed!")
end
-- Function to edit the search results
function editResults()
    value = gg.prompt({"Enter the new value to set:"}, {[1] = "0"}, {[1] = "number"})
    if value == nil then return end
    
    local results = gg.getResults(100) -- Get up to 100 results
    for i, v in ipairs(results) do
        v.value = value[1]
    end
    gg.setValues(results)
    gg.toast("Values updated!")
end
-- Main loop
while true do
    if menu == 1 then
        searchValue()
    elseif menu == 2 then
        refineSearch()
    elseif menu == 3 then
        editResults()
    elseif menu == 4 then
        gg.toast("Exiting script...")
        os.exit()
    end
    menu = gg.choice({
        "1. Enter Value and Search",
        "2. Refine Search",
        "3. Edit Results",
        "4. Exit"
    }, nil, "Game Guardian Script")
end

 

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
×
×
  • 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.