使用 WinDbg 在堆上查找所有类型为 X 的 C++ 对象 [英] Find all C++ objects of type X on heap using WinDbg

查看:21
本文介绍了使用 WinDbg 在堆上查找所有类型为 X 的 C++ 对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在堆中查找 module!SomeClass 类型的所有对象.我认为这样的命令会起作用:

I'm trying to find all objects of type module!SomeClass in the heap. I thought a command like this would've worked:

> s -v 0 L?0xfffffff module!SomeClass

但可惜,它没有.如果我知道如何找到该类的 vtable 地址,那么我就可以在内存中搜索对该 vtable 的引用,但我也没有太多运气找到.我该怎么做?

but alas, it does not. If I knew how to find the vtable address for that class, I could then search memory for references to that vtable, but I haven't had much luck finding that either. How can I do it?

推荐答案

0:000> x module!SomeClass*table*
0:000> !heap -srch 'address_of_vtable'

这篇关于使用 WinDbg 在堆上查找所有类型为 X 的 C++ 对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆