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 


How to cmp using decimal values in AOP injection?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
AMB
How do I cheat?
Reputation: 0

Joined: 23 Apr 2020
Posts: 4

PostPosted: Thu Apr 23, 2020 6:55 am    Post subject: How to cmp using decimal values in AOP injection? Reply with quote

Hello all

I'm trying to use (cmp) in AOP injection , but I don't know how to write down the number I want to compare to.

I'm doing the code injection on this code
mov [eax],cl

which I found to be writing to 98 address including the address I'm looking for , but the address I want to find is the only address that always has a decimal value of 57474 or 57490.

I tried writing the number in decimal format
cmp cl,57490
// and also tried hex format
cmp cl,0x000E092
// and then use
je jeLabel
jne orgCode

but both were not working correctly.

To make sure of that I injected the code after the (mov [eax],cl) line instead and used a breakpoint inside my jeLabel code so I can check EAX value.

But I found the comparison seems always to let other values to be evaluated as (equal to cl) and always jumb inside my jeLabel code without the value being 57490 or 0x000E092.

Is there something I need to change in my cmp code or a prefix I need to add to use decimal values?

or may be the issue is related to pushf and popf , as I was not sure if I need to use that or not for my code and currently I'm not using it?
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Thu Apr 23, 2020 7:43 am    Post subject: Re: How to cmp using decimal values in AOP injection? Reply with quote

AMB wrote:
I'm doing the code injection on this code
mov [eax],cl

which I found to be writing to 98 address including the address I'm looking for , but the address I want to find is the only address that always has a decimal value of 57474 or 57490.


that is no address, its moving a byte into some address and the value 57474 or 57490 is out of range.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
AMB
How do I cheat?
Reputation: 0

Joined: 23 Apr 2020
Posts: 4

PostPosted: Thu Apr 23, 2020 7:54 am    Post subject: Reply with quote

Update : The code did work correctly once I used [EAX] instead of cl , it seems I can only compare using basic registers or something here I'm missing.

Now the new question is Smile how I can copy the value of EAX to a new address I create.

currently I can only copy the address of EAX using :

globalalloc(pDir,4)
.....
mov [pDir], eax

but I cannot copy the value ( [EAX] ) as I cannot write either of these (both won't compile):
mov pDir, [eax]
// Or
mov [pDir], [eax]

So I was wondering how I can copy EAX value to an address I create ?

What I'm trying to do is having a static address which I create , then using the code to copy the value I found with cmp to my address.


Last edited by AMB on Thu Apr 23, 2020 7:55 am; edited 1 time in total
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3321

PostPosted: Thu Apr 23, 2020 7:55 am    Post subject: Re: How to cmp using decimal values in AOP injection? Reply with quote

AMB wrote:
Hello all

Hello!

You can compare to fixed numbers using various notations.
0x10 and (int)16 and (float)16 and (double)16 all work.

However, you need to be aware what you are comparing against.
Are you aware of the width of the CL register?
How about CH, CX, ECX and RCX?

You copy EAX's value to another register like this: mov ebx,eax
You copy EAX's value to a memory location like this: mov dword ptr [pDir],eax

I feel you try doing things without having the basic background.
I'd recommend a basic ASM course at the very least.
Back to top
View user's profile Send private message
AMB
How do I cheat?
Reputation: 0

Joined: 23 Apr 2020
Posts: 4

PostPosted: Thu Apr 23, 2020 8:00 am    Post subject: Re: How to cmp using decimal values in AOP injection? Reply with quote

Csimbi wrote:

Are you aware of the width of the CL register?


No I'm not aware of that was thinking it is 4 bytes.
Sorry I'm new to using assembly just read about the basics yesterday.

But now I'm using [eax] instead of cl and that is working fine.

And now I'm looking for a way to copy that value [eax] to my address/variable

Update :
Csimbi wrote:
You can compare to fixed numbers using various notations.
0x10 and (int)16 and (float)16 and (double)16 all work.


I'm using cmp [eax],0x000E092 at the moment , so that means I can also use cmp [eax],(int)57490 ?

Csimbi wrote:
You copy EAX's value to another register like this: mov ebx,eax
You copy EAX's value to a memory location like this: mov dword ptr [pDir],eax

oh nice that is what I'm lokking for , thanks.

Csimbi wrote:
I feel you try doing things without having the basic background.
I'd recommend a basic ASM course at the very least.

Yes I'm going to do that , I already read ([Tutorial] Beginning Assembly Language) posted in this forum. but I think that didn't mention some info like CL register width or how to copy the value using dword as you mentioned.
Do you recommend specific tutorial/course?
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3321

PostPosted: Thu Apr 23, 2020 4:53 pm    Post subject: Re: How to cmp using decimal values in AOP injection? Reply with quote

AMB wrote:

I'm using cmp [eax],0x000E092 at the moment , so that means I can also use cmp [eax],(int)57490 ?

That's exactly what it means.

AMB wrote:
Do you recommend specific tutorial/course?


https://yurichev.com/writings/

Pick one of the UAL- PDFs.
(UAL = Understanding Assembly Language)
Quite comprehensive, so it may take some time to read, but everything you need to know is in there.
C++, Java, even tips for ARM.

There's a link on that top of that page to the main site:
http://beginners.re
You might want to check that, too.
Back to top
View user's profile Send private message
AMB
How do I cheat?
Reputation: 0

Joined: 23 Apr 2020
Posts: 4

PostPosted: Fri Apr 24, 2020 3:01 pm    Post subject: Re: How to cmp using decimal values in AOP injection? Reply with quote

Csimbi wrote:

Pick one of the UAL- PDFs.
(UAL = Understanding Assembly Language)
Quite comprehensive, so it may take some time to read, but everything you need to know is in there.
C++, Java, even tips for ARM.

There's a link on that top of that page to the main site:
.


Awesome , seems to be a very good resource for these topics as he is discussing it from reverse engineering perspective.

Thank you for your help
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