Jump to content
  • 0

Help how to get value in filter script


notzagred
 Share

Question

please help me to get value in filter script

this my code

gg.setRanges(gg.REGION_ANONYMOUS) -- Set memory range to anonymous
gg.clearResults() -- Clear previous results
gg.searchNumber("2096;10::5", gg.TYPE_DWORD) -- Search for 2096 and 10 with distance 5
gg.refineNumber("2096", gg.TYPE_DWORD, false, gg.SIGN_NOT_EQUAL) -- Exclude 2096
local res1 = gg.getResults(gg.getResultsCount())
for i, v in ipairs(res1) do
  res1[i].address = res1[i].address + 8
  res1[i].flags = gg.TYPE_DWORD
end
gg.loadResults(res1)
gg.searchNumber("12~199", gg.TYPE_DWORD, true, gg.SIGN_EQUAL) -- Search for 12 to 199
local number = gg.getResults(1)
local res2 = gg.getResults(26)
for i, v in ipairs(res2) do
  res2[i].address = res2[i].address + 8
  res2[i].flags = gg.TYPE_DWORD
end
gg.loadResults(res2) -- Load modified results
gg.searchNumber(dword value from filter 670, gg.TYPE_DWORD, false, gg.SIGN_EQUAL)

I want to get value from result 26 above and filter it with '670$' and copy dword this hex 3E9EC670 and search dword value from 3E9EC670

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Instead of the last line in your script, write:

local r = getListItems()
gg.clearList()
local t
for i = 1, #r do
    t = gg.getValues({{address = r[i].address, flags = gg.TYPE_DWORD}})[1].value
    if t ~= 670 then
        return
    else
        break
    end
end

print(r[i].value)
print(r[i].address)

Then do whatever you want. 😀

Link to comment
Share on other sites

  • 0
On 7/19/2024 at 9:46 AM, notzagred said:

please help me to get value in filter script

this my code

gg.setRanges(gg.REGION_ANONYMOUS) -- Set memory range to anonymous
gg.clearResults() -- Clear previous results
gg.searchNumber("2096;10::5", gg.TYPE_DWORD) -- Search for 2096 and 10 with distance 5
gg.refineNumber("2096", gg.TYPE_DWORD, false, gg.SIGN_NOT_EQUAL) -- Exclude 2096
local res1 = gg.getResults(gg.getResultsCount())
for i, v in ipairs(res1) do
  res1[i].address = res1[i].address + 8
  res1[i].flags = gg.TYPE_DWORD
end
gg.loadResults(res1)
gg.searchNumber("12~199", gg.TYPE_DWORD, true, gg.SIGN_EQUAL) -- Search for 12 to 199
local number = gg.getResults(1)
local res2 = gg.getResults(26)
for i, v in ipairs(res2) do
  res2[i].address = res2[i].address + 8
  res2[i].flags = gg.TYPE_DWORD
end
gg.loadResults(res2) -- Load modified results
gg.searchNumber(dword value from filter 670, gg.TYPE_DWORD, false, gg.SIGN_EQUAL)

I want to get value from result 26 above and filter it with '670$' and copy dword this hex 3E9EC670 and search dword value from 3E9EC670

 

To get the value from result 26 and filter it with '670' and copy dword this hex 3E9EC670 and search dword value from 3E9EC670, modify your script like this:

 

```

-- ... (rest of your script remains the same)

 

-- Get the 26th result

local res2 = gg.getResults(26)

 

-- Extract the value from the 26th result

local value = res2[1].value

 

-- Filter the value with '670'

gg.searchNumber(tostring(value) .. ";670", gg.TYPE_DWORD)

 

-- Copy the DWORD value at address 0x3E9EC670

gg.searchNumber("0x3E9EC670", gg.TYPE_DWORD)

 

-- Search for the DWORD value

local result = gg.getResults(1)

gg.searchNumber(result[1].value, gg.TYPE_DWORD)

```

 

This script:

 

1. Extracts the value from the 26th result.

2. Filters the value with '670'.

3. Copies the DWORD value at address 0x3E9EC670.

4. Searches for the DWORD value.

 

Note: Make sure to adjust the script according to your needs, as the filtering and searching logic might need to be modified based on your specific requirements.

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.