?
Solved

How to find the vptr and vtable address

Posted on 2012-04-09
2
Medium Priority
?
915 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

752 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