Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1055
  • Last Modified:

How to find the vptr and vtable address

Hi experts,
I am doing some in investigation on c++ crashes and wanted to dome experiment by corrupting the vptr of a class. I know the memory layout of an object depends on the compiler. I am using gcc and want to access the vptr. Also, is there a way to find the address of vtable.
Using Gdb is fine too
0
ambuli
Asked:
ambuli
1 Solution
 
jkrCommented:
Simtimes Wikipedia is more useful than you expect it to be, see http://en.wikipedia.org/wiki/Virtual_method_table and especiay "Notes" as well as http://sourcery.mentor.com/public/cxx-abi/cxx-closed.html (also from that article) for other compiler verions and OS flavors.
0
 
ambuliAuthor Commented:
Thank you jkr. Yes, it appears fdump-class-hierarchy should help me. I will read through the wikipedia article.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now