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 


Little ASM Question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Rissorr
Master Cheater
Reputation: 3

Joined: 17 Sep 2013
Posts: 273
Location: Israel!

PostPosted: Sun Jun 01, 2014 12:09 pm    Post subject: Little ASM Question Reply with quote

Can please some one explain me what are the operation/action of the following:

Code:

lea

int 3

cmp
test
//what the difference betwen them^^?


thanks to helpers Very Happy
Back to top
View user's profile Send private message
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Sun Jun 01, 2014 12:16 pm    Post subject: Reply with quote

LEA means "load effective address". Think of it like a mov, except that it doesn't actually move anything.

For example, "mov eax, [ebx+ecx*4]" will multiply ecx by 4, add it to ebx, then read the memory at that address and put it in eax. Conversely, "lea eax, [ebx+ecx*4]" does the same calculation, but instead of reading the memory it just puts the address into eax instead. This is a useful arithmetic instruction because you can lump multiple calculations into one instruction. It's really useful if you want to compute a pointer at a dynamic offset.

INT 3 means "interrupt 3". It causes a trap signal (step exception) to be raised, which a debugger can then catch. It's used for software breakpoints.

CMP and TEST are both comparisons. CMP does a subtraction of the two operands, and sets flags based on the result. This is useful for doing numeric comparisons, e.g. less than, equal, greater than. TEST uses bitwise AND instead of a subtraction, which is useful for checking flags. For example, if you've got a flag of 0x1000 and you want to check if a particular register has that flag set, "test reg, 0x1000" will set the zero flag if the register does not have that flag set. From there you can use jnz or jz to do conditional jumps based on that.

_________________
It's not fun unless every exploit mitigation is enabled.
Please do not reply to my posts with LLM-generated slop; I consider it to be an insult to my time.
Back to top
View user's profile Send private message
Rissorr
Master Cheater
Reputation: 3

Joined: 17 Sep 2013
Posts: 273
Location: Israel!

PostPosted: Sun Jun 01, 2014 2:42 pm    Post subject: Reply with quote

wow!! thanks you Very Happy
such a perfect answer
you explained everything perfectly! Surprised
it realy helpd!!!
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 Gamehacking 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