i want to get the return address of a function in assembly and then compare that return address value with another value without corrupting the stack or changing anything in the stack,
how can that be done in assembly?
i’m using x86
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Usualy on x86 if using stdcall convention return address is stored at content of register ebp +4. So
cmp ebp, whatever;should do the job. Actualy it’s not dependent from calling convention rather as it depends whether your compiler puts push ebp as the first instruction of your function, which it usualy does. Generaly the function then looks like: