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 


Is CE's autoassembler interpolating variables in strings?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Thu Jul 15, 2010 3:43 pm    Post subject: Is CE's autoassembler interpolating variables in strings? Reply with quote

Hi folks,

I was wondering why the following auto-assembler snippet stores the address of title into the memory pointed at by the symbol instead of the string title. If I change the "db 'title',0" line to "db 'titl e',0" or any other misspelling, it works as expected. Does the assembler interpolate into strings? Are there other variables that can be inserted in this way, like in Perl or Ruby?

Code:

[ENABLE]
registersymbol(title)
alloc(title,40)
title:
db 'title',0
 
[DISABLE]
dealloc(title)
unregistersymbol(title)


Thanks,
adude
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Thu Jul 15, 2010 5:27 pm    Post subject: Reply with quote

I don't understand what you're trying to say. That code above defines a label 'title:'. You also register a symbol 'title' which is a pointer to an allocated block of 40 bytes. It just so happens at the label 'title:' you have defined a buffer with a zero terminated string called 'title'. You have 2 separate things there, do you realise that ?
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Thu Jul 15, 2010 7:10 pm    Post subject: Reply with quote

Thanks for replying, Slug, but I don't understand what you're trying to explain.

Looking at the code, you would expect the memory pointed to by the title symbol to hold the string, "title", yes? When you execute the script, however, you're left with the ADDRESS of the allocated memory, instead. If you change the string to be, "this is a title string", you'll end up with a string in memory like, "this is a 123abc string" You see? That's what I mean by interpolation.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Thu Jul 15, 2010 9:33 pm    Post subject: Reply with quote

this is a bug, it shouldn't replace the text in strings with the name of a symbol (which is a good reason to use longer symbolnames for better readability and prevent bugs like this from causing a problem)
_________________
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
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Thu Jul 15, 2010 9:40 pm    Post subject: Reply with quote

Ah, I see. Sorry for posting in the wrong place, then. I thought it might be a feature! I can see how it would be useful to be able to automagically replace text with variables. Thanks for looking at it, and sorry for being unable to phrase my question more succinctly.

Cheers,
adude
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 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