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 


Simple ASM CMP question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Sean1337
Master Cheater
Reputation: 0

Joined: 04 May 2007
Posts: 478

PostPosted: Mon Jun 25, 2007 7:33 am    Post subject: Simple ASM CMP question Reply with quote

Just a question from code I'm trying to understand.

The instruction is: CMP bp, [eax+04]

I understand that it's comparing the value of bp to the value of [eax+04]

What I don't understand is this:
- what is bp, is bp the 16 bit register BP? If so, how do I find the address for BP at that instruction because all I can see while tracing (in CE) are 32 bit registers, e.g. EBP, is BP in that instruction the same as EBP?
- [eax+04] - is it referring to the pointer of base eax + offset 4? or does it mean add 4 to the address of eax.

Thanks,
-Sean
Back to top
View user's profile Send private message
TheSorc3r3r
I post too much
Reputation: 0

Joined: 06 Sep 2006
Posts: 2404

PostPosted: Mon Jun 25, 2007 11:54 am    Post subject: Reply with quote

BP is the low word in EBP. Just look at the lower (to the right) 16 bits of EBP. Ex:

EBP:
0x00123456
BP:
0x3456

[eax+4] is the dereference of eax+4 (the r-value... read up on pointers if j00 don't understand).

If you want to view each value in CE write a script that dumps them at the address..

mov [dump_bp], bp
mov edx, [eax+4]
mov [dump_eax], edx

_________________


Don't laugh, I'm still learning photoshop!
Back to top
View user's profile Send private message
Sean1337
Master Cheater
Reputation: 0

Joined: 04 May 2007
Posts: 478

PostPosted: Mon Jun 25, 2007 7:35 pm    Post subject: Reply with quote

TheSorc3r3r wrote:
BP is the low word in EBP. Just look at the lower (to the right) 16 bits of EBP. Ex:

EBP:
0x00123456
BP:
0x3456

[eax+4] is the dereference of eax+4 (the r-value... read up on pointers if j00 don't understand).

If you want to view each value in CE write a script that dumps them at the address..

mov [dump_bp], bp
mov edx, [eax+4]
mov [dump_eax], edx


thanks bro. Smile +rep
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 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