View previous topic :: View next topic |
Author |
Message |
hesho28 Newbie cheater
Reputation: 0
Joined: 03 Oct 2009 Posts: 13
|
Posted: Wed Sep 24, 2014 6:51 pm Post subject: [MASM32] Help in cmp instruction |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Wed Sep 24, 2014 7:14 pm Post subject: |
|
|
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 |
|
 |
hesho28 Newbie cheater
Reputation: 0
Joined: 03 Oct 2009 Posts: 13
|
Posted: Wed Sep 24, 2014 7:20 pm Post subject: |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25791 Location: The netherlands
|
Posted: Wed Sep 24, 2014 7:48 pm Post subject: |
|
|
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 |
|
 |
hesho28 Newbie cheater
Reputation: 0
Joined: 03 Oct 2009 Posts: 13
|
|
Back to top |
|
 |
|