| View previous topic :: View next topic |
| Author |
Message |
Hatschi Master Cheater
Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Fri May 31, 2013 5:06 am Post subject: [Auto Assembler] Compare 8 Byte |
|
|
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 |
|
 |
Fresco Grandmaster Cheater
Reputation: 4
Joined: 07 Nov 2010 Posts: 600
|
Posted: Fri May 31, 2013 5:31 am Post subject: |
|
|
qword ptr
anyways that is if you have a x64 processor, if not use xmm or fpu
_________________
... Fresco |
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Fri May 31, 2013 8:55 am Post subject: |
|
|
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 |
|
 |
Hatschi Master Cheater
Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Sun Jun 02, 2013 6:08 am Post subject: |
|
|
| 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 |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Jun 02, 2013 3:39 pm Post subject: |
|
|
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 |
|
 |
Hatschi Master Cheater
Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Sat Jun 29, 2013 10:19 am Post subject: |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Sat Jun 29, 2013 11:04 am Post subject: |
|
|
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 |
|
 |
Hatschi Master Cheater
Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Sat Jun 29, 2013 2:45 pm Post subject: |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25833 Location: The netherlands
|
Posted: Sat Jun 29, 2013 3:17 pm Post subject: |
|
|
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 |
|
 |
|