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 


Memory Scan doesn't return when it's vtByteArray?

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

Joined: 22 Jun 2021
Posts: 507

PostPosted: Thu Jul 03, 2025 1:17 pm    Post subject: Memory Scan doesn't return when it's vtByteArray? Reply with quote

Code:
ms.firstScan(soExactValue, vtByteArray, nil, AOB, '', startAddress, endAddress, "", fsmNotAligned, "1", true, false, false, false)


I've checked the docs, but it still doesn't find any result, searching the AOB manually finds it
Yes, I've created foundlist for memscan
Yes, I'm using 'waitTillDone' method for waiting for the results
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4690

PostPosted: Thu Jul 03, 2025 1:54 pm    Post subject: Reply with quote

Rounding type should be something (e.g. rtRounded), not nil. It doesn't matter if it's not relevant for a vtByteArray scan- argument parsing by CE might not expect a nil value.

protection flags is an empty string. I don't know what the default is, but it should be explicitly specified.

Could always be something else not included in what you posted. A complete example is always appreciated.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 507

PostPosted: Fri Jul 04, 2025 4:46 am    Post subject: Reply with quote

it still cannot find anything even after putting rtRounded, the start address and end address are valid, as they indicate the module start and end addresses

Leaving protection flags indicates that it will search anything, as documented in celua.txt:
Code:
protectionflags is a string.
  X=Executable W=Writable memory C=Copy On Write. Add a + to indicate that flag MUST be set and a - to indicate that that flag MUST NOT be set. (* sets it to don't care)
  Examples:
    +W-C = Writable memory exluding copy on write and doesn't care about the Executable flag
    +X-C-W = Find readonly executable memory
    +W = Finds all writable memory and don't care about copy on write or execute
    "" = Find everything (is the same as "*X*C*W" )
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 36

Joined: 16 Feb 2017
Posts: 1511

PostPosted: Fri Jul 04, 2025 5:59 am    Post subject: Reply with quote

Code:
straddr = "299F0164E90" --3E 83 04 10 27 00 00 1A 59 83 04 01 00 00 00 21 18
endaddr = "299F0164EA0" --18
aob     = "10 27 00 00 1A 59 83 04 01 00 00 00 21"

dh=createMemScan()
dh.firstScan(soExactValue,vtByteArray,rtTruncated, aob, "", straddr, endaddr, "", fsmNotAligned, "", true, false, false, false)
dh.waitTillDone()
fl=createFoundList(dh)
fl.initialize()
local count=foundlist_getCount(fl)
   if (count>0) then
      for i=0, count -1 do
          local newaddr=fl.Address[i]
          print(newaddr)
      end
   end
fl.destroy()
dh.destroy()

-- result count: 1
-- result addr : 299F0164E93

_________________
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
Frouk
Grandmaster Cheater
Reputation: 5

Joined: 22 Jun 2021
Posts: 507

PostPosted: Fri Jul 04, 2025 7:22 am    Post subject: Reply with quote

AylinCE wrote:
Code:
straddr = "299F0164E90" --3E 83 04 10 27 00 00 1A 59 83 04 01 00 00 00 21 18
endaddr = "299F0164EA0" --18
aob     = "10 27 00 00 1A 59 83 04 01 00 00 00 21"

dh=createMemScan()
dh.firstScan(soExactValue,vtByteArray,rtTruncated, aob, "", straddr, endaddr, "", fsmNotAligned, "", true, false, false, false)
dh.waitTillDone()
fl=createFoundList(dh)
fl.initialize()
local count=foundlist_getCount(fl)
   if (count>0) then
      for i=0, count -1 do
          local newaddr=fl.Address[i]
          print(newaddr)
      end
   end
fl.destroy()
dh.destroy()

-- result count: 1
-- result addr : 299F0164E93


creating a found list after searching fixed the issue, I'm grateful for that
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