假设要加载game.exe的pdb文件game.pdb。首先调试game.exe或者打开dump.
然后
!sym noisy
然后添加一个符号目录。以下面为例
.symfix+ c:\symbols
运行完这个命令后windbg会尝试重新加载符号。也可以手动.reload
触发。这个时候会在windbg的输出中观察not found的提示。然后按照windbg提示的路径建立好目录再把pdb放置进去。最后运行.reload
依然假设模块名为Game.exe
dt Game!UObject
0:000> dt Game!UObject
+0x000 __VFN_table : Ptr64
+0x008 ObjectFlags : EObjectFlags
+0x00c InternalIndex : Int4B
+0x010 ClassPrivate : Ptr64 UClass
+0x018 NamePrivate : FName
+0x020 OuterPrivate : Ptr64 UObject
如果结构体名称不清晰,可以使用通配符进行搜索。这对于泛型的实例比较有用,因为很多时候不清楚这些符号究竟会在<>里面变成什么样子,也不知道<>里面是否何处被添加了空格。例如,通过如下的形式搜索TArray\<UObject*>
dt Game!TArray<UObject*, *>
Game!TArray<UObject *,TSizedDefaultAllocator<32> >
Game!TArray<UObject const *,TSizedDefaultAllocator<32> >
Game!TArray<UObject *,TSizedDefaultAllocator<32> >
Game!TArray<UObject * *,TSizedDefaultAllocator<32> >
Game!TArray<UObject * *,TSizedDefaultAllocator<32> >
Game!TArray<UObject const *,TSizedDefaultAllocator<32> >
Game!TArray<UObject::FAssetRegistryTag,TSizedDefaultAllocator<32> >
Game!TArray<UObject::FAssetRegistryTag,TSizedDefaultAllocator<32> >
Game!TArray<UObject *,TInlineAllocator<1,TSizedDefaultAllocator<32> > >
Game!TArray<UObject *,TInlineAllocator<1,TSizedDefaultAllocator<32> > >
Game!TArray<UObjectBase *,TSizedDefaultAllocator<32> >
Game!TArray<UObjectBase *,TSizedDefaultAllocator<32> >
Game!TArray<UObjectReferencer *,TSizedDefaultAllocator<32> >
Game!TArray<UObjectReferencer *,TSizedDefaultAllocator<32> >
使用x命令。 /f 搜索函数,/d 搜索数据
例如,搜索ubject:: 内的函数
x /f Game!UObject::*
若要搜索结构体,使用dt命令。例如搜索UObjec开头的结构有哪些
dt Game!UOBjec*
0:000> dt Game!UOBjec*
Game!UObject
Game!UObjectBase
Game!UObject::<unnamed-enum-StaticClassFlags>
Game!UObject::ENetFields_Private
Game!UObject
Game!UObject::Object_eventExecuteUbergraph_Parms
Game!UObject::FAssetRegistryTag::ETagType
Game!UObject::FAssetRegistryTag::ETagDisplay
Game!UObject::FAssetRegistryTag
Game!UObject::FAssetRegistryTag
Game!UObjectTraceWorldSubsystem
Game!UObjectTraceWorldSubsystem::<unnamed-enum-StaticClassFlags>
Game!UObjectTraceWorldSubsystem
Game!UObjectBaseUtility
Game!UObject
Game!UObjectBaseUtility
Game!UObjectRedirector
Game!UObjectRedirector::<unnamed-enum-StaticClassFlags>
Game!UObjectRedirector
Game!UObjectBase
!address
!vadump
!heap