如何确定“CListViewHost”中的条目数量

问题描述 投票:0回答:1

我基于 PYKD.PYD 库扩展了 “heap_stat”脚本,以便查看集合的元素,如以下示例所示:

if type_name.endswith("CSortableDoubleArray"):
    collection_Size = typedVar('CSortableDoubleArray', ptr).m_nSize
...
elif type_name.endswith("CPtrList"):                          
    collection_Size = typedVar('CPtrList',             ptr).m_nCount
...

如您所见,我需要属性的名称(

m_nSize
m_nCount
,...)才能确定条目数量。

现在我正在处理一个转储,其中包含一些

shell32!CListViewHost
条目,正如您在 heap_stat 结果中看到的那样:

0x75b032a4  shell32!CListViewHost
0x75b032c0  shell32!CListViewHost
0x75b032dc  shell32!CListViewHost

我一直在互联网上查找,但没有找到有关该课程的任何文档。

有人知道我可以用来确定此类列表中的条目数量的属性名称吗?

供您参考:我在 Visual Studio 中看不到这一点:我目前正在调查 C# 应用程序的转储。即使在本机调试该转储时,条目

(CListViewHost)0x75b032a4
(shell32!CListViewHost)0x75b032a4
在监视窗口中也不会给出任何内容。

提前致谢

编辑:

x /2 *!*
vftable'
command)   While running the
x /2
vftable'
命令的结果,
CListViewHost
类也出现了,所以我希望它是众所周知的,但我不知道)不明白为什么我在互联网上找不到任何相关信息。这里是
x /2 *!*
vftable'
command: (there are more
CListViewHost` 相关条目的部分结果,我只是展示了其中的一些)

6e893d10          WinTypes!`winrt::impl::make_marshaler'::`2'::marshaler::`vftable'
6e87366c          WinTypes!Microsoft::WRL::FtmBase::`vftable'
6e8950b4          WinTypes!Windows::Foundation::Value<Windows::Foundation::ValueArray<int> >::`vftable'
6e8950a4          WinTypes!Windows::Foundation::Value<Windows::Foundation::ValueArray<int> >::`vftable'
...
7579e6b8          shell32!CFolderItemVerbs::`vftable'
75798784          shell32!CListViewHost::`vftable'
75782d9c          shell32!DirectUI::ClassInfo<CInfoPane,CFrameModule,DirectUI::StandardCreator<CInfoPane> >::`vftable'
...
7578ea74          shell32!Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<2>,Microsoft::WRL::Implements<Microsoft::WRL::RuntimeClassFlags<2>,IDesktopGadget> >::`vftable'
757988c8          shell32!CListViewHost::`vftable'
75788dc4          shell32!CBitBucketDropTarget::`vftable'
...
7579e75c          shell32!CEnumFolderItemVerbs::`vftable'
757989c8          shell32!CListViewHost::`vftable'
75783774          shell32!CWordWheel::`vftable'
...
757883dc          shell32!CWrapOldCallback::`vftable'
75798a5c          shell32!CListViewHost::CJustInTimeItemSink::`vftable'
75796798          shell32!CImmersiveContextMenuOwnerDrawHelper::`vftable'
...
7579cbdc          shell32!Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<2>,CWRLObjectWithSite,Microsoft::WRL::ChainInterfaces<IContextMenu3,IContextMenu2,IContextMenu,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil,Microsoft::WRL::Details::Nil>,IShellExtInit,IFileOperationProgressSink>::`vftable'
75798910          shell32!CListViewHost::`vftable'
757831b0          shell32!CXElementModuleInner::`vftable'
...
python c# dump pykd
1个回答
0
投票

您正在处理的 CListViewHost 类似乎是 Windows 中 shell32 DLL 使用的内部类。该 DLL 是 Windows Shell API 的一部分,它提供文件浏览和其他与 shell 相关的功能的接口。由于 CListViewHost 是一个内部类,因此公开可用的文档有限也就不足为奇了。

也许这有帮助:

运行时检查:如果您有使用 CListViewHost 的应用程序的实时实例,您可能能够使用调试器在运行时检查该对象。这有时可以揭示属性及其值。

模式识别:由于您已成功识别其他类的计数属性(m_nSize、m_nCount),因此您可能会在 CListViewHost 对象中查找类似的模式。例如,如果您看到一个整数值的变化方式与列表视图中的项目数一致,那么这可能就是您正在寻找的属性。

vftable分析:虚函数表(vftable)包含指向类的虚函数的指针。通过分析 vftable,您可能会获得有关该类的接口和功能的线索。寻找可能与项目计数或迭代相关的函数。

© www.soinside.com 2019 - 2024. All rights reserved.