Solved

How to find the vptr and vtable address

Posted on 2012-04-09
2
869 Views
Last Modified: 2012-04-11
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
Comment
Question by:ambuli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 37825362
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
 

Author Comment

by:ambuli
ID: 37826103
Thank you jkr. Yes, it appears fdump-class-hierarchy should help me. I will read through the wikipedia article.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question