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 


auto search & first address add table?

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

Joined: 04 Dec 2011
Posts: 27

PostPosted: Sun Dec 18, 2011 10:33 pm    Post subject: auto search & first address add table? Reply with quote

Ex)

New Scan
Scan range: 0x000000 ~ 0x10000000
Scan Type: Text
Value: test1

Next Scan
Value: test2

many Address list.... first address add table...?


sorry... I can't speak English.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25287
Location: The netherlands

PostPosted: Mon Dec 19, 2011 6:07 pm    Post subject: Reply with quote

Code:

ms=createMemScan()
memscan_firstScan(ms, soExactValue, vtString, rtRounded, "test1", "0", 0x00000000, 0x10000000, "", fsmNotAligned, "", false, false, false, true) --change the last true to false if you do not wish case sensitivity
memscan_waitTillDone(ms)

memscan_nextScan(ms, soExactValue, rtRounded, "test2", "", false, false, false, true, false, '')
memscan_waitTillDone(ms)



--get the result of the scans
fl=createFoundList(ms)
foundlist_initialize(fl)
local count=foundlist_getCount(fl)

if (count>0) then
  local saddress=foundlist_getAddress(fl, 0) --get the first address

  print("Adding "..saddress.." to the list")

  --add to the addresslist
  local al=getAddressList()
  local mr=addresslist_createMemoryRecord(al)

  memoryrecord_setDescription(mr,"Result of automated scan")
  memoryrecord_setAddress(mr, saddress)

  --If you have ce 6.2 beta
  --memoryrecord_setType(mr, vtString)
  --memoryrecord_string_setSize(mr, 5)
  --But for now:
  memoryrecord_setType(mr, vtDword)

else
  print("No addresses found")
end



--cleanup
object_destroy(fl)
object_destroy(ms)

Please note that the current example with "test1" and "test2" will result in nothing found (since since test1 is not test2)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
gamjadory
Cheater
Reputation: 0

Joined: 04 Dec 2011
Posts: 27

PostPosted: Tue Dec 20, 2011 6:09 am    Post subject: Reply with quote

Another Type Scan Code??

Byte

2byte

4byte

8byte

Array...
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25287
Location: The netherlands

PostPosted: Tue Dec 20, 2011 9:20 am    Post subject: Reply with quote

replace vtString with one of these:
Code:

    vtByte
    vtWord   : 2 bytes
    vtDword  : 4 bytes
    vtQword  : 8 bytes
    vtSingle : float
    vtDouble : double
    vtString
    vtByteArray
    vtBinary
    vtAll

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
gamjadory
Cheater
Reputation: 0

Joined: 04 Dec 2011
Posts: 27

PostPosted: Tue Dec 20, 2011 8:35 pm    Post subject: thank you!! Reply with quote

Thanks Dark Byte!!
Back to top
View user's profile Send private message
gamjadory
Cheater
Reputation: 0

Joined: 04 Dec 2011
Posts: 27

PostPosted: Thu Dec 22, 2011 10:35 am    Post subject: Reply with quote

How to add offset address??

Ex)
resualt address + 28
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Thu Dec 22, 2011 10:44 am    Post subject: Reply with quote

Code:
memoryrecord_setAddress(mr, saddress+28)


edit.
My bad. I forgot about hexadecimal.

Code:

hexoffset = '28'      -- this is a string
decoffset = '40'          -- this one too

memoryrecord_setAddress(mr, tonumber(saddress,16)+tonumber(hexoffset,16)  )

-- or
memoryrecord_setAddress(mr, ('0x'..saddress)+('0x'..hexoffset)  )

-- or
memoryrecord_setAddress(mr, tonumber(saddress,16)+decoffset  )

-- or
memoryrecord_setAddress(mr, ('0x'..saddress)+decoffset  )


-- when "+" operator is used on strings, lua automatically tries to
-- convert it to number

_________________


Last edited by mgr.inz.Player on Sun Dec 25, 2011 8:59 am; edited 6 times in total
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25287
Location: The netherlands

PostPosted: Thu Dec 22, 2011 2:32 pm    Post subject: Reply with quote

Saddress is a string so either convert to an integer or pass in CE address format:
saddress.."+20"
Or
tonumber("0x"..saddress)+0x20

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
BlubBlab
How do I cheat?
Reputation: 0

Joined: 05 Sep 2014
Posts: 6

PostPosted: Tue Sep 09, 2014 8:18 pm    Post subject: Reply with quote

Is that still valid? Those function seems nowhere mentioned in 6.4?
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