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 


Help with what I assume is a VERY simple question to you all

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Goat Engine
Cheater
Reputation: 0

Joined: 13 Aug 2018
Posts: 44

PostPosted: Mon Jan 06, 2020 8:29 pm    Post subject: Help with what I assume is a VERY simple question to you all Reply with quote

I have a line I'm trying to change. The original code is:
Code:
movzx eax,byte ptr [rax+rcx]

And what I want to do is make the number being moved into eax be a 1 byte zero. My idea to accomplish this, based on past coding I had success with in CE scripts, was this...
Code:
mov eax, byte ptr 0

It fails.
Right off the bat I have a feeling you guys see a problem I don't.

Anyway, having been self learning cheat engine and everything it does, I haven't yet found anything that can clarify for me the mindset I should be using with the above line and why the auto assembler script tells me it WON'T work, no matter how I rearrange it?

I've used a similar line in the past to move a 0 without any problems. Only difference is today it's "eax" as the variable I'm trying to move 0 to instead of others. What's happening and is this specifically because it's eax? How does a person write this line when they want it to work exactly as I'm intending here, and is there any documentation that's cheat engine user friendly that sums up why I'm having an issue without being as complicated as if I just google for assembly help?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4711

PostPosted: Mon Jan 06, 2020 11:06 pm    Post subject: Reply with quote

"byte ptr" is used to refer to addresses. Remove it.
Code:
mov eax,0

A functionally equivalent but better way is to use xor:
Code:
xor eax,eax
// eax is now 0


If you only want to change one byte but leave everything else in eax alone, use the al register instead:
Code:
mov al,0
// or:
xor al,al

_________________
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
Goat Engine
Cheater
Reputation: 0

Joined: 13 Aug 2018
Posts: 44

PostPosted: Tue Jan 07, 2020 2:54 am    Post subject: Reply with quote

Ah, makes perfect sense. These tips will also help me with some things I plan on doing in the future too, so double thank you!! (I had a follow up question in my other thread you helped me in though, if you get time)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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