Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6054249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:07:54+00:00 2026-05-23T08:07:54+00:00

I just compiled the following on VS2010(with optimization turned off). class Shape { public:

  • 0

I just compiled the following on VS2010(with optimization turned off).

class Shape {
  public:
    int x,y;
    Shape() {
      x=10;
      y=20;
    }

    virtual void function1() {
      cout<<"function1";
    }

    virtual void function2() {
      cout<<"function2";
    }
};

int main() {
    Shape *s = new Shape();
    s->function1();
    s->function2();    
    return 0;
}

The disassembly does not show the code blocks corresponding to the virtual functions or any calls to it, so Im assuming that it is because of the way virtual functions are looked up using the vftable. I’m using IDA Pro so it is probably not able to resolve such issues. Please correct me if I’m wrong.

I also have a few doubts in this regard.

  1. Is there any way I can view the virtual functions just as the other functions during disassembly? Any script(IDAPython)/method that I could use?
  2. Is there any way I can list all virtual functions in an executable?
  3. Suggested Reading?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:07:55+00:00Added an answer on May 23, 2026 at 8:07 am

    Virtual dispatch is only involved when the dynamic type of an object is different from its static type (pointer-to-Base pointing to a derived class). Since you don’t even have inheritance, and an exact type at the call site, why should it do the lookup in the vtable?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using c#3 compiled transforms the following seems to work just fine... <xsl:choose> <xsl:when test=$valA
I have the following source: #include <iostream> using namespace std; void main(int j) {
im just curious about the following example #include<stdio.h> int test(); int test(){ // int
I have the following code: typedef void VOID; int f(void); int g(VOID); which compiles
Why won't the following C code compile? It seems like it should just change
I just compiled and viewed a CHM file used in my project. I noticed
Just wondering if a .NET app can be compiled down to native machine code
I just finished a small project where changes were required to a pre-compiled, but
I've just finished a library in Objective-C that I compiled as a Static Library
I just upgraded to Snow Leopard, including installing the new XCode, re-compiled Ruby 1.8

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.