| 
			
				|  | Cheat Engine The Official Site of Cheat Engine
 
 
 |  
 
	
		| View previous topic :: View next topic |  
		| Author | Message |  
		| mgr.inz.Player I post too much
 
  Reputation: 222 
 Joined: 07 Nov 2008
 Posts: 4438
 Location: W kraju nad Wisla. UTC+01:00
 
 | 
			
				|  Posted: Mon Nov 14, 2016 4:23 pm    Post subject: customTypesExt |   |  
				| 
 |  
				| 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
 
 
 
 
	
		
	 
		| Description: |  |  Download
 |  
		| Filename: | customTypesExt.lua |  
		| Filesize: | 10.43 KB |  
		| Downloaded: | 3243 Time(s) |  
 _________________
 
 
 Last edited by mgr.inz.Player on Thu Dec 01, 2016 11:45 am; edited 2 times in total
 |  |  
		| Back to top |  |  
		|  |  
		| ParkourPenguin I post too much
 
  Reputation: 152 
 Joined: 06 Jul 2014
 Posts: 4706
 
 
 | 
			
				|  Posted: Mon Nov 14, 2016 5:21 pm    Post subject: |   |  
				| 
 |  
				| 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 |  |  
		|  |  
		| mgr.inz.Player I post too much
 
  Reputation: 222 
 Joined: 07 Nov 2008
 Posts: 4438
 Location: W kraju nad Wisla. UTC+01:00
 
 | 
			
				|  Posted: Wed Nov 23, 2016 6:30 pm    Post subject: |   |  
				| 
 |  
				| version 2: - added Lua CustomType support
 _________________
 
 |  |  
		| Back to top |  |  
		|  |  
		| mgr.inz.Player I post too much
 
  Reputation: 222 
 Joined: 07 Nov 2008
 Posts: 4438
 Location: W kraju nad Wisla. UTC+01:00
 
 | 
			
				|  Posted: Thu Dec 01, 2016 11:42 am    Post subject: |   |  
				| 
 |  
				| version3: - added setValue(address, value) method
 - added writeCustom(index/name, address, value)
 _________________
 
 |  |  
		| Back to top |  |  
		|  |  
		|  |  
  
	| 
 
 | 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
 
 |  |