首页 > 编程语言 >Windbg: going from vftable to c++ class

Windbg: going from vftable to c++ class

时间:2023-02-26 15:01:04浏览次数:50  
标签:sheet Windbg share going vftable data class se

Windbg: going from vftable to c++ class

 

As part of an assignment, I am delving into the world of Internet Explorer, and am trying to figure out exactly what class(es) are being allocated on the heap.

In the mshtml!CEventObj::GenericGetElement() method, the eax register points to an instance of a class, edi points to the object it references, and esi points to the vftable.

This being said, I inserted a breakpoint that would list these registers each time through the function, and they always point to the same vftable.

The vftable in question is mshtml!CBodyElement, but does this actually mean that all these instances are of the CBodyElement, or could they be for classes derived from CBodyElement.

If they are from derived classes, how do I determine the actual classes being allocated ?

  edited Oct 13, 2014 at 8:26 perror's user avatar perror  

A derived class will get its own vtable if it overrides any of the virtual functions.

If the derived class does not override any virtual functions, it will use the original vtable.

I would say that your assumption is correct ~90% of the time.

The best that you can do for static type recovery, is to look at the vtable being used.

What you can do to help a bit is to turn one PageHeap with stack tracking (gflags.exe /i iexplore.exe +hpa +ust) and look at the address allocated for the object (!heap -p -a 0xaddress). This will give you a full stack trace to the allocation-site of the object, which is sometimes to determine the type of object (e.g. if a Factory pattern was used).

Finally, there are additional dynamic analysis tricks you can play. I wrote a Pin tool and IDA Python plugin, ida-splode for almost exactly this application. By capturing information at runtime, you can enhance your IDA traces. Below is an example screenshot from the slide deck. The better symbol information you have (or the better fleshed-out your IDB is), the better the information you get.

enter image description here

    answered Oct 13, 2014 at 21:48 Zach Riggle's user avatar Zach Riggle 2,29711 gold badge1414 silver badges28

标签:sheet,Windbg,share,going,vftable,data,class,se
From: https://www.cnblogs.com/ioriwellings/p/17156710.html

相关文章

  • How to fix memory leaks in C/C++ using WinDbg
    HowtofixmemoryleaksinC/C++usingWinDbgOn May30,2021 By ArtemRazin In UncategorizedContentsIntroductionExamplesofmemoryleaksThecommon......
  • class的类继承
     <!DOCTYPEhtml><html><head><metacharset="utf-8"><title></title></head><body><script>classPhone{//构造方法co......
  • class的静态成员
     <script>//ES5//手机类//functionPhone(brand,price){//this.brand=brand;//this.price=price;//}//Phone.phoneName='......
  • class介绍初体验
     <!DOCTYPEhtml><html><head><metacharset="utf-8"><title></title></head><body><script>classShouji{......
  • classification_report()评估报告
    1、使用数据生成器后获得标签映射方法一:labels=[kforkintrain_generator.class_indices]方法二:1labels=[None]*len(test_generator.class_indices)2fo......
  • The bean ‘api‘, defined in class path resource [com/common/swagger/SwaggerAuto
    Thebean‘api‘,definedinclasspathresource[com/common/swagger/SwaggerAutoConf1.解决办法-1将重复的bean覆盖掉加一个这个注解spring.main.allow-bean-definit......
  • Lightroom Classic for mac(Lrc2021) v10.4 激活版
    Lightroom Classic2021mac中文版是一款以后期制作为重点的图形工具软件,其增强的校正工具、强大的组织功能以及灵活的打印选项可以帮助您加快图片后期处理速度,将更多的时......
  • 用es6的class类单例模式封装canvas环形进度条
    项目中需要一个请求进度效果,尝试了下自己用canvas来绘制一个环形进度条,动效直接用的休眠函数加随机数来模拟。用到了es6里的class类,用单例模式的懒汉模式来实例化对象......
  • 深入学习jquery源码之addClass()和toggleClass()与hasClass()
    深入学习jquery源码之addClass()和toggleClass()与hasClass()addClass(class|fn)概述为每个匹配的元素添加指定的类名。参数class String一个或多个要添加到元素中的CSS类......
  • CSS Id 和 Class
    id和class选择器如果你要在HTML元素中设置CSS样式,你需要在元素中设置"id"和"class"选择器。id选择器id选择器可以为标有特定id的HTML元素指定特定的样式。......