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 


autoGuess type at specific offset programmatically

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3229

PostPosted: Wed Oct 23, 2024 9:00 am    Post subject: autoGuess type at specific offset programmatically Reply with quote

Hi all,
I found this in CELUA.TXT so would like to take advantage of it:
Code:
autoGuess(baseaddresstoguessfrom, offset, size)


This code does not appear to be adding any elements:
Code:

      while(iGap>=iAlignment) do
        iOffsetToGuess=structEntryCurrent.Offset+structEntryCurrent.Bytesize+iAlignment*j
        sourceStructure.autoGuess(baseAddress+iOffsetToGuess, iOffsetToGuess, iAlignment)
        j=j+1
        iGap=iGap-iAlignment
      end


I know the address of the player, that's baseAddress.
iGap is the number of bytes between structEntryCurrent and structEntryNext.
iAlignment is either 4 or 8 (x86 vs. x64)

What am I doing wrong?

Thank you!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 465

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

PostPosted: Thu Oct 24, 2024 1:43 am    Post subject: Reply with quote

autoguess struct is for bigger sizes so it can guess all the elements within the block.
e.g:
sourceStructure.autoGuess(baseAddress+iOffsetToGuess, iOffsetToGuess, 4096) and then remove the things you don't need later

or instead just add entries manually

also remember that offsets don't have to follow based on size of the previous entry. you can skip bytes without any issues

_________________
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
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3229

PostPosted: Sat Oct 26, 2024 4:51 am    Post subject: Reply with quote

Understood, thanks!

Is there an easy way to determine what's a DWORD (signed or not), FLOAT, DOUBLE or a POINTER?
I'd like to get these basic types right, at least.

Thank you!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 465

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

PostPosted: Sat Oct 26, 2024 7:59 am    Post subject: Reply with quote

if the address is dividable by 4/8 and the value represents a readable address, it could be a pointer

if you read it as a float or double, and the value is between -10000 and 10000, but not in the range of -0.000001 and 0.000001 (so an exponent is needed) then it might be a float or double

pretty much anything else is likely an integer (dword)

_________________
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
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