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 


customTypesExt

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting -> Lua Extensions
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 148

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

PostPosted: Mon Nov 14, 2016 4:23 pm    Post subject: customTypesExt Reply with quote

You can access the registered custom types from Lua.
You can get such information like: how many of them, name of type, bytesize of type, ...

Works only with CE6.6.
- readCustom() writeCustom(), .getValue() and .setValue()
- AA CustomType and Lua CustomType supported

Usage:
Code:
getCustomTypeCount() - returns the number of "custom types" loaded into CE.

getCustomType(index) - returns the custom type data (a table) for chosen custom type,
                       index=1 first type, index=2 second type, ...
                       
getCustomType(name) - see above but here you just input custom type name

custom type data (table) has fields:
name, bytesize, alignment, usesFloat (true or false),
scriptUsesCDecl (true or false), customTypeType (0 - AA, 1 - Lua)

and method:
getValue(address)
setValue(address,value)


readCustom(index, address) - reads value from the specified address, custom type (by index)
readCustom(name, address) - reads value from the specified address, custom type (by name)

writeCustom(index, address, value) - writes value to the specified address, custom type (by index)
writeCustom(name, address, value) - writes value to the specified address, custom type (by name)



example1 (enumerating custom types):
Code:
for i=1,getCustomTypeCount() do
  local customtype = getCustomType(i)
  print('custom type name: "'..customtype.name..'"',', uses float: '..tostring(customtype.usesFloat))
end



example2
Code:
local ct1 = getCustomType(1)
local value1 = ct1.getValue(address1)

local ct2 = getCustomType('4byte Big Endian')
local value2 = ct2.getValue(address2)



example3
Code:
local value3 = readCustom(4, address3)
local value4 = readCustom('custom type name', address4)




Download:
http://forum.cheatengine.org/download.php?id=119902

Installation:
place it in autorun folder



customTypesExt.lua
 Description:
version 3

Download
 Filename:  customTypesExt.lua
 Filesize:  10.43 KB
 Downloaded:  574 Time(s)


_________________


Last edited by mgr.inz.Player on Thu Dec 01, 2016 11:45 am; edited 2 times in total
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
Grandmaster Cheater Supreme
Reputation: 52

Joined: 06 Jul 2014
Posts: 1795
Location: Arcadian Suburbia

PostPosted: Mon Nov 14, 2016 5:21 pm    Post subject: Reply with quote

Thank you very much for this. When I have the time I'll be sure to put this to good use.
_________________
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
mgr.inz.Player
I post too much
Reputation: 148

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

PostPosted: Wed Nov 23, 2016 6:30 pm    Post subject: Reply with quote

version 2:
- added Lua CustomType support

_________________
Back to top
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 148

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

PostPosted: Thu Dec 01, 2016 11:42 am    Post subject: Reply with quote

version3:
- added setValue(address, value) method
- added writeCustom(index/name, address, value)

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