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 


[MASM32] Help in cmp instruction

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
hesho28
Newbie cheater
Reputation: 0

Joined: 03 Oct 2009
Posts: 13

PostPosted: Wed Sep 24, 2014 6:51 pm    Post subject: [MASM32] Help in cmp instruction Reply with quote

Hello,

iam new to asm and i wanted to figure out what is wrong in this code:


Code:
mov eax,0040001bh
Again:
cmp dword ptr [eax],454C4946h
Je Found
inc eax
jmp Again
Found:
invoke MessageBox,0,addr Found,addr Found,MB_OK


i just wanted to compare between the value of the address stored in eax with 454C4946h , if the value is equal then messagebox that the address has been found , but the comparison still between the address (eax itself not the value of the address inside it) and 454C4946h !!

so it returns the value 454C4946 not the address carrying the value.

What is wrong with comparison ? Any Help?

Thanks.

_________________
sssssss
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Sep 24, 2014 7:14 pm    Post subject: Reply with quote

I don't know how eax gets the exact value you're looking for, but i do know that invoking the messagebox will overwrite eax with whatever value it returns
_________________
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
hesho28
Newbie cheater
Reputation: 0

Joined: 03 Oct 2009
Posts: 13

PostPosted: Wed Sep 24, 2014 7:20 pm    Post subject: Reply with quote

Dark Byte wrote:
I don't know how eax gets the exact value you're looking for, but i do know that invoking the messagebox will overwrite eax with whatever value it returns



the address which actually has this value is 0040003B but this loop returns the value --> 454C4946h not the address --> 0040003B which actually has the right value.

_________________
sssssss
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Sep 24, 2014 7:48 pm    Post subject: Reply with quote

check the rest of your code and debug it with a debugger, perhaps you are dereferencing the result to a dword
_________________
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
hesho28
Newbie cheater
Reputation: 0

Joined: 03 Oct 2009
Posts: 13

PostPosted: Wed Sep 24, 2014 7:57 pm    Post subject: Reply with quote

Dark Byte wrote:
check the rest of your code and debug it with a debugger, perhaps you are dereferencing the result to a dword


Thanks for your help , solved Smile

_________________
sssssss
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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