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 


[Auto Assembler] Compare 8 Byte

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Hatschi
Master Cheater
Reputation: 2

Joined: 28 Jan 2010
Posts: 327

PostPosted: Fri May 31, 2013 5:06 am    Post subject: [Auto Assembler] Compare 8 Byte Reply with quote

Hi,

what is the command to compare an address with a 8 byte value?
4 Byte would be:

cmp dword ptr

And 8 byte?
Back to top
View user's profile Send private message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Fri May 31, 2013 5:31 am    Post subject: Reply with quote

qword ptr
anyways that is if you have a x64 processor, if not use xmm or fpu

_________________
... Fresco
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

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

PostPosted: Fri May 31, 2013 8:55 am    Post subject: Reply with quote

8 byte integer value ?

Like this:
Code:

fild qword ptr [00400700]
fild qword ptr [00400800]
fcompp
fnstsw ax
sahf



then you can use what you want: jnae, jnbe, jna, jnb, ja, jb, jae, jbe,

_________________
Back to top
View user's profile Send private message MSN Messenger
Hatschi
Master Cheater
Reputation: 2

Joined: 28 Jan 2010
Posts: 327

PostPosted: Sun Jun 02, 2013 6:08 am    Post subject: Reply with quote

Sounds great, by wouldn't it be enough to use fild qword ptr + a jump only? Or is it necessary to work with registers at this point?
Back to top
View user's profile Send private message
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 Jun 02, 2013 3:39 pm    Post subject: Reply with quote

fcom[p[p]] do not change CPU flags (EFLAGS). So you need transfer STATUS WORD from FPU to CPU flag - fnstsw ax ; sahf



Yes there are other ways - SSE2

_________________
Back to top
View user's profile Send private message MSN Messenger
Hatschi
Master Cheater
Reputation: 2

Joined: 28 Jan 2010
Posts: 327

PostPosted: Sat Jun 29, 2013 10:19 am    Post subject: Reply with quote

Sorry for bumping but I've got a question. How to compare a 64bit register with a 64bit (8 byte) value?

I've tried to write the 8 byte value in a codecave and then do something like:

fild qword ptr [00400300] <-- stored 8 byte value
fild qword ptr [R8]
fcompp
fnstsw ax
sahf
jne originalcode

Doesn't work, it seems like CE converts the 8 byte value into 4 byte.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sat Jun 29, 2013 11:04 am    Post subject: Reply with quote

if it's an 8 byte and not a double, then do this:

Code:

cmp r8,[00400300]
jne originalcode


if r8 points to an address you wish to compare the value with then:
Code:

push rax
mov rax,[r8]
cmp rax,[00400300]
pop rax
jne originalcode

_________________
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
Hatschi
Master Cheater
Reputation: 2

Joined: 28 Jan 2010
Posts: 327

PostPosted: Sat Jun 29, 2013 2:45 pm    Post subject: Reply with quote

Same way as dealing with 32 bit addresses / 4 byte values except storing it, pretty easy haven't thought about this one thanks.

By the way, is it correct that the codecave scanner of CE doesn't support scanning in 64bit ranges? I may be wrong on this one too.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sat Jun 29, 2013 3:17 pm    Post subject: Reply with quote

I even completly forgot ce had that thing(it's pretty much useless), so yeah, it won't scan 64-bit memory ranges
_________________
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 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