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 


Memscan with hex value

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Tr1gun87
Cheater
Reputation: 0

Joined: 17 May 2017
Posts: 27

PostPosted: Wed Dec 02, 2020 7:34 pm    Post subject: Memscan with hex value Reply with quote

hello,
i'm a bit noob and is the first time i write lua code
i writed this:
Code:
local myvalue = "test"
local memscan = createMemScan()
foundlist = createFoundList(memscan)
local memscan2 = createMemScan()
foundlist2 = createFoundList(memscan2)
memscan.firstScan(
  soExactValue, vtString, rtRounded,
  myvalue, nil, 0x0, 0xffffffffffffffff, "+W*X",
  fsmNotAligned, "1", false, false, false, false)
memscan.waitTillDone()
foundlist.initialize()
for i=0, foundlist.Count-1 do
  print(foundlist[i])
end
print("explode: "..foundlist[foundlist.Count-2])
memscan2.firstScan(soExactValue, vtDword, rtRounded, foundlist[foundlist.Count-2], nil, 0x0, 0xffffffffffffffff, "+W+X", fsmAligned, "4", true, false, false, false)
memscan2.waitTillDone()
foundlist2.initialize()
print(foundlist2.Count)
for i=0, foundlist2.Count-1 do
  print(foundlist2[1])
end

foundlist.destroy()
memscan.destroy()
foundlist2.destroy()
memscan2.destroy()

the memscan2 don't give me results but if i try to do the same manually from cheat engine i get 2 results
i think is a problem with hex but i put the true on the hexflag, so i don't understand what else is wrong Smile

any hint? Smile
my final objective is to find all pointers of the results and compare the pointers+10 with a 2nd value for get my results
i know the 2 values marked on the 1st screen and the distance is always +10 so i was thinking of this method for find the position



*EDIT*
solved Smile

Code:
local myvalue = "test"
local myvalue2 = 3
local memscan = createMemScan()
foundlist = createFoundList(memscan)
local memscan2 = createMemScan()
foundlist2 = createFoundList(memscan2)
memscan.firstScan(
  soExactValue, vtString, rtRounded,
  myvalue, nil, 0x0, 0x00007fffffffffff, "+W*X",
  fsmAligned, "1", false, false, true, true)
memscan.waitTillDone()
foundlist.initialize()
for i=0, foundlist.Count-1 do
  local temp = tonumber(foundlist[i],16)-0xC
  --print("explode: "..temp)
  memscan2.firstScan(soExactValue, vtDword, rtRounded, temp, nil, 0x0, 0x00007fffffffffff, "+W*X", fsmAligned, "4", false, false, false, false)
  memscan2.waitTillDone()
  foundlist2.initialize()
  for j=0, foundlist2.Count-1 do
    local temp2 = readInteger("["..foundlist2[j].."+0x10]+0x8")
    if ( temp2 == myvalue2 ) then
       print("found: "..foundlist2[j])
    end
  end
end

foundlist.destroy()
memscan.destroy()
foundlist2.destroy()
memscan2.destroy()

the problem was on the flag, should have used *X



Immagine 2020-12-03 025442.png
 Description:
 Filesize:  18.94 KB
 Viewed:  1145 Time(s)

Immagine 2020-12-03 025442.png



Immagine 2020-12-03 022852.png
 Description:
 Filesize:  6.42 KB
 Viewed:  1146 Time(s)

Immagine 2020-12-03 022852.png


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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