Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Filter scan results (FoundList or Aobscan)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 34

Joined: 16 Feb 2017
Posts: 1462

PostPosted: Fri Jul 19, 2024 10:00 pm    Post subject: Filter scan results (FoundList or Aobscan) Reply with quote

What does the plugin do?
FoundList scan list or standalone aob scan list,
It tests whether a given byte contains a "00" and returns a table with the results if not.

Here are some useful functions and their results:

Code:
-- type options:
-- (1=Word,  2=Dword,  3=Qword,  4=Double,  5=Float,  6=String)


Code:
 s = "2B2D5764E64"
  aa1 = addrToAobString(s,2)
 print(aa1)


-- or

Code:
 s = 1000
  aa1 = numToAobString(s,2)
 print(aa1) -- > E8 03 00 00


-- or

Code:
 s = "Cheat"
  aa1 = numToAobString(s,6)
 print(aa1) -- > 43 68 65 61 74


-- It scans the given AOB code and lists the results in a table if there is no "00" in the desired byte range.

-- false = Aob scan ..
-- true = Found list filter ..
Code:
aa1 = ParseByte("E8 03 00 00 00 00 00 00",32,2,true)
  if #aa1~=0 then
    for l,k in pairs(aa1) do
     print(l.." - "..k)
    end
  end

*This function is described in the code, in the message "msgErr2".

Script:
Code:
function bytefromhex(str1)
 atbl,aleng,aword={},0,""
  for word in str1:gmatch("%w+") do table.insert(atbl,word) end
  aleng=#atbl
  for i,k in pairs(atbl) do aword=aword..atbl[aleng] aleng=tonumber(aleng) - 1 end
  num = (tonumber(aword, 16) + 2^31) % 2^32 - 2^31
   return math.floor(num)
end

function addrToAobString(s,opt)
local tbl = {}
  if opt==1 then -- word
    tbl = wordToByteTable(readBytes(s))
  elseif opt==2 then -- dword
    tbl = dwordToByteTable(readInteger(s))
  elseif opt==3 then -- qword
    tbl = qwordToByteTable(readQword(s))
  elseif opt==4 then -- double
    tbl = doubleToByteTable(readDouble(s))
  elseif opt==5 then -- float
    tbl = floatToByteTable(readFloat(s))
  elseif opt==6 then -- dword
    tbl = stringToByteTable(readString(s))
  end
  for k,v in ipairs(tbl) do
    tbl[k] = ('%02X'):format(v)
  end
  return table.concat(tbl, ' ')
end

function numToAobString(s,opt)
local tbl = {}
  if opt==1 then -- word
    tbl = wordToByteTable(tonumber(s))
  elseif opt==2 then -- dword
    tbl = dwordToByteTable(tonumber(s))
  elseif opt==3 then -- qword
    tbl = qwordToByteTable(tonumber(s))
  elseif opt==4 then -- double
    tbl = doubleToByteTable(tonumber(s))
  elseif opt==5 then -- float
    tbl = floatToByteTable(tonumber(s))
  elseif opt==6 then -- dword
    tbl = stringToByteTable(tostring(s))
  end
  for k,v in ipairs(tbl) do
    tbl[k] = ('%02X'):format(v)
  end
  return table.concat(tbl, ' ')
end

local msgErr2 = [[Please make sure you enter the parameters completely.
Test function: ParseByte(1, 2, 3, 4)
1) Code to scan: (Aobs)
2) The beginning of the byte you want to test: number (no hex)
3) Record symbol of the test byte: number
   (1=Word,  2=Dword,  3=Qword,  4=Double,  5=Float,  6=String)
4) Confirmation of memory to be scanned:
   true = Reads FoundList results and starts testing.
   false = Performs an Aobs scan and compares the results.
------------------------------------------------------------------
The results are given as a table and listed accordingly.]]

function ParseByte(s,byt1,typ,fl)
 if s==nil or byt1==nil or typ==nil or fl==nil then
  showMessage(msgErr2)
 else
  byt = ('%02X'):format(byt1)
  local resTbl = {}
  if fl==false then
    local aob = AOBScan(tostring(s))
      if (aob == nil) then
        showMessage("Not found!")
      else
       for i=0,aob.Count-1 do
        local address=stringlist_getString(aob,i)
        local addrByte = address.."+"..byt
        local resaobs1 = addrToAobString(addrByte,typ)
        local resaobs2 = numToAobString("0",typ)
        if resaobs1~=resaobs2 then
          resTbl[#resTbl + 1] = address
        end
       end
      end
    end
  if fl==true then
    fs3 = MainForm.Foundlist3
      for i=0, fs3.Items.count -1 do
        local address=tostring(fs3.Items[i].Caption)
        local addrByte = address.."+"..byt
        local resaobs1 = addrToAobString(addrByte,typ)
        local resaobs2 = numToAobString("0",typ)
        if resaobs1~=resaobs2 then
          resTbl[#resTbl + 1] = address
        end
      end
  end
  return resTbl
 end
end


Create the added file or download it and drop it into the CE-->autorun folder and start using it.

We remember @mgr.inz.Player more in this type of codes.

Until we see you in another article, enjoy it!



FilterSearchOptions.lua
 Description:

Download
 Filename:  FilterSearchOptions.lua
 Filesize:  3.11 KB
 Downloaded:  381 Time(s)


_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites