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 


small problem moving a value under x64 bits

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

Joined: 16 Oct 2005
Posts: 395
Location: DEAD

PostPosted: Sun Dec 14, 2014 8:34 am    Post subject: small problem moving a value under x64 bits Reply with quote

Hi all, i try explain me problem trying move a reg value to other reg and the stored value is a bit confused.

this is the code:

Code:
push rax
push rbx
mov rbx,rcx
test rbx,rbx
jz short _code
mov rbx,dword ptr[rbx+8] //value 8 bytes stored FFFFFFFBXXXXXXXX
test rbx,rbx
jz short _code
cmp dword ptr [rbx+10],'string' //string no exist in FFFFFFFBXXXXXXXX but yes in 00000000XXXXXXXX no idea why show me FFFFFFFBXXXXXXXX
jne short _code
//BLABLABLA
_code:
pop rbx
pop rax


debugging test rbx,rbx under mov rbx,dword ptr[rbx+8] i can see FFFFFFFBXXXXXXXX onto rbx register, i cant understand why this happen, i need move and store on rbx only 0000000XXXXXXXX no FFFFFFFBXXXXXXX because here dont exist the string, any can help me why this happen?

_________________
Welcome to the Hell.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Dec 14, 2014 8:49 am    Post subject: Reply with quote

Code:

mov rbx,dword ptr[rbx+8]

does not exist

it gets automatically upscaled to
Code:

mov rbx,qword ptr [rbx+8]


to limit it to 4 bytes, use
Code:

xor rbx,rbx
mov ebx,dword ptr[rbx+8]

_________________
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
Xblade Of Heaven
Master Cheater
Reputation: 0

Joined: 16 Oct 2005
Posts: 395
Location: DEAD

PostPosted: Sun Dec 14, 2014 9:07 am    Post subject: Reply with quote

thanks again db, using xor rbx,rbx the value stored is now correct.

regards

_________________
Welcome to the Hell.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
mgr.inz.Player
I post too much
Reputation: 222

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

PostPosted: Sun Dec 14, 2014 4:26 pm    Post subject: Reply with quote

I often see such things:

movzx rbx,byte ptr [rbx+08]

movsx rbx,byte ptr [rbx+08]

movzx rbx,word ptr [rbx+08]

movsx rbx,word ptr [rbx+08]

movsxd rbx,dword ptr [rbx+08]



also, simple "MOV EAX, EBX" automatically zeroes upper 32 bits of RAX register




  • 64-bit operands generate a 64-bit result in the destination general-purpose register.
  • 32-bit operands generate a 32-bit result, zero-extended to a 64-bit result in the destination general-purpose register.
  • 8-bit and 16-bit operands generate an 8-bit or 16-bit result. The upper 56 bits or 48 bits (respectively) of the destination general-purpose register are not be modified by the operation. If the result of an 8-bit or 16-bit operation is intended for 64-bit address calculation, explicitly sign-extend the register to the full 64-bits.

_________________
Back to top
View user's profile Send private message MSN Messenger
Xblade Of Heaven
Master Cheater
Reputation: 0

Joined: 16 Oct 2005
Posts: 395
Location: DEAD

PostPosted: Sun Dec 14, 2014 6:50 pm    Post subject: Reply with quote

thanks too mgr.inz.Player Very Happy
_________________
Welcome to the Hell.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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