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 


bug

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
OldCheatEngineUser
Whateven rank
Reputation: 17

Joined: 01 Feb 2016
Posts: 1443

PostPosted: Wed Jan 23, 2019 7:54 am    Post subject: bug Reply with quote

cheat engine cant encode the following correctly, thus it cant decode it as well:

cheat engine assembles:
Code:
mov [eax],eax // as 89 00 mov [rax],eax
mov [eax],rax // as 48 89 00 mov [rax],rax
mov [rax],rax // as 48 89 00 mov [rax],rax
mov [rax],eax // as 89 00 mov [rax],eax


cheat engine disassembles:
Code:
db 67 89 00 // as mov [rax],eax
db 67 48 89 00 // as mov mov [rax],rax
db 48 89 00 // as mov [rax],rax
db 89 00 // as mov [rax],eax


original byte and opcode:
Code:
db 67 89 00 // mov [eax],eax
db 67 48 89 00 // mov [eax],rax
db 48 89 00 // mov [rax],rax
db 89 00 // mov [rax],eax

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
patched cheat engine tutorials
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 361

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

PostPosted: Wed Jan 23, 2019 10:32 am    Post subject: Reply with quote

i don't see the bug.
Addressing always uses the registertype equal to the current addressing mode

so if you use [eax] in a 64 bit process you must have made a mistake and meant [rax]

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
OldCheatEngineUser
Whateven rank
Reputation: 17

Joined: 01 Feb 2016
Posts: 1443

PostPosted: Wed Jan 23, 2019 2:04 pm    Post subject: Reply with quote

Dark Byte wrote:
i don't see the bug.
Addressing always uses the registertype equal to the current addressing mode

so if you use [eax] in a 64 bit process you must have made a mistake and meant [rax]

that means you are forcing the default addressing mode, even if intel provided an address size prefix.

you should not force to default addressing mode, even if beginners may make mistakes.

Code:
alloc(longmode,256,$0)
registersymbol(longmode)
createthread(longmode)

longmode:
jmp short skip_data
nop

data:
dq 0
register_data:
dq 0

skip_data:
mov rdx,longmode
mov rax,FFFFFFFF00000000
or rax,rdx
mov qword ptr [register_data],rax
mov rdx,'DB CE'
db 67 48 89 50 03 // mov [eax+03],rdx
ret

{
67 -                address size prefix
48 -                REX prefix

longmode -          add to address list (length 2-byte as hex) // points to entrypoint
"longmode"+03 -     add to address list (string length 8) // points to data
"longmode"+0B -     add to address list (length 8-byte as hex) // points to register_data
}


by forcing to the defaults, mov [RAX+03],rdx writes to the wrong address.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
patched cheat engine tutorials
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 361

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

PostPosted: Wed Jan 23, 2019 3:17 pm    Post subject: Reply with quote

Yeah, CE doesn't support the addressing switch flag at all right now.

But how many programs have you seen that use this ? (excluding hacks by other people)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
OldCheatEngineUser
Whateven rank
Reputation: 17

Joined: 01 Feb 2016
Posts: 1443

PostPosted: Wed Jan 23, 2019 3:32 pm    Post subject: Reply with quote

maybe one program or so, and compilers will probably use the defaults. (32-bit operand size and 64-bit address size)

but hey CE will disassemble instructions with address size prefix incorrectly, and that can cause issues when storing register's address or so.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
patched cheat engine tutorials
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 68

Joined: 06 Jul 2014
Posts: 2202

PostPosted: Wed Jan 23, 2019 11:43 pm    Post subject: Reply with quote

I don't see the point of adding it right now. Few people even know about it and even fewer will ever find any good reason to use it.

If you really want to enable it, you could use registerBinUtil or maybe registerAutoAssemblerPrologue / registerGlobalDisassembleOverride.

Note that some current AA scripts rely on this to reduce code duplication in portable code. e.g. some custom types assume [ecx] will be assembled as [rcx] when assembled as 64-bit code.

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions 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