lm
lmv
概述
- 是
lm
命令的详细模式,用于显示所有已加载模块的完整信息,包括:- 模块基地址(
Start/End
):模块在内存中的起始和结束地址 - 模块路径(
Image path
):文件在磁盘中的完整路径 - 符号状态(
Symbols
):如Loaded
(符号已加载)、Deferred
(延迟加载)、Export
(仅导出表符号) - 时间戳(
Timestamp
):编译时间,用于验证符号文件(PDB)是否匹配 - 校验码(
Checksum
):文件完整性验证 - 文件版本(
File version
):如10.0.19041.1234
- 模块基地址(
lmv m test
- 用于筛选指定模块,支持通配符(
*
)匹配:
1 2 3 |
lmv m kernel32* # 查看名称以 "kernel32" 开头的模块 lmv m *api* # 查看名称包含 "api" 的模块 lmv m ntdll # 仅查看 ntdll.dll 的详细信息 |
lmi
- 比
lm
命令更全面的模块元数据
ln
概述
- 用于查找指定地址附近的符号信息的关键命令,尤其在调试崩溃、分析内存布局时至关重要
地址-符号
- 输入一个地址(如崩溃点),会显示该地址前后最接近的符号(函数名、全局变量等),帮助定位代码位置,示例如下:
- 表示
0x00401000
位于main
函数内,下一符号是helper_function
- 表示
1 2 |
0:000> ln 00401000 (00401000) MyApp!main | (00401050) MyApp!helper_function |
- 示例2:
- 地址
0x7158da
对应源码的第147
行,属于函数CMultiTabWebWnd::NavigateUrl
的代码逻辑范围 007157b0
:函数NavigateUrl
的起始地址+0x12a
:当前地址0x7158da
距离函数起始的偏移量(0x7158da - 0x7157b0 = 0x12a
)(00715ae0) birdwp!CMultiTabWebWnd::OnBtnClose
:当前地址的下一个相邻符号是函数OnBtnClose
,起始地址为0x715ae0
- 地址
1 2 3 4 5 |
0:000> ln 0x7158da Browse module Set bu breakpoint [d:\jenkins\.jenkins\workspace\birdwp\360wpapp\webview\multitabwebwnd.cpp @ 147] (007157b0) birdwp!CMultiTabWebWnd::NavigateUrl+0x12a | (00715ae0) birdwp!CMultiTabWebWnd::OnBtnClose |
!dh
概述
- 用于显示指定模块的
PE
(Portable Executable
)文件头信息,包括文件头(File Header
)、可选头(Optional Header
)、节区头(Section Headers
)及目录表(Data Directories
)
参数
-f
:仅显示文件头(File Header
)-s
:仅显示节区头(Section Headers
)-a
:显示所有头信息(默认行为)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
0:000> !dh 005f0000 File Type: EXECUTABLE IMAGE FILE HEADER VALUES 14C machine (i386) 5 number of sections 685D02E0 time date stamp Thu Jun 26 16:20:48 2025 0 file pointer to symbol table 0 number of symbols E0 size of optional header 102 characteristics Executable 32 bit word machine OPTIONAL HEADER VALUES 10B magic # 14.16 linker version 202800 size of code 39EC00 size of initialized data 0 size of uninitialized data 16D353 address of entry point 1000 base of code ----- new ----- 00400000 image base 1000 section alignment 200 file alignment 2 subsystem (Windows GUI) 5.01 operating system version 0.00 image version 5.01 subsystem version 5A5000 size of image 400 size of headers 5861E1 checksum 00100000 size of stack reserve 00001000 size of stack commit 00100000 size of heap reserve 00001000 size of heap commit 8140 DLL characteristics Dynamic base NX compatible Terminal server aware 250DA0 [ FC] address [size] of Export Directory 250E9C [ 1CC] address [size] of Import Directory 288000 [ 302078] address [size] of Resource Directory 0 [ 0] address [size] of Exception Directory 57BC00 [ 5EF8] address [size] of Security Directory 58B000 [ 19C38] address [size] of Base Relocation Directory 2345E0 [ 54] address [size] of Debug Directory 0 [ 0] address [size] of Description Directory 0 [ 0] address [size] of Special Directory 2346D8 [ 18] address [size] of Thread Storage Directory 234638 [ 40] address [size] of Load Configuration Directory 0 [ 0] address [size] of Bound Import Directory 204000 [ 8E4] address [size] of Import Address Table Directory 0 [ 0] address [size] of Delay Import Directory 0 [ 0] address [size] of COR20 Header Directory 0 [ 0] address [size] of Reserved Directory SECTION HEADER #1 .text name 2027B4 virtual size 1000 virtual address 202800 size of raw data 400 file pointer to raw data 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers 60000020 flags Code (no align specified) Execute Read SECTION HEADER #2 .rdata name 50046 virtual size 204000 virtual address 50200 size of raw data 202C00 file pointer to raw data 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers 40000040 flags Initialized Data (no align specified) Read Only Debug Directories(3) Type Size Address Pointer cv 59 240ea8 23faa8 Format: RSDS, guid, 1, D:\Jenkins\.jenkins\workspace\birdwp\360wpapp\Release\birdwp.pdb ( 12) 14 240f04 23fb04 ( 13) 3ec 240f18 23fb18 SECTION HEADER #3 .data name 3292C virtual size 255000 virtual address CE00 size of raw data 252E00 file pointer to raw data 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers C0000040 flags Initialized Data (no align specified) Read Write SECTION HEADER #4 .rsrc name 302078 virtual size 288000 virtual address 302200 size of raw data 25FC00 file pointer to raw data 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers 40000040 flags Initialized Data (no align specified) Read Only SECTION HEADER #5 .reloc name 19C38 virtual size 58B000 virtual address 19E00 size of raw data 561E00 file pointer to raw data 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers 42000040 flags Initialized Data Discardable (no align specified) Read Only |
文件头FILE HEADER VALUES
字段 | 含义 | 示例值 |
machine |
CPU 架构标识(如 14C = i386, 8664 = x64) |
14C |
number of sections |
节区数量(如代码、数据、资源等) | 5 |
time date stamp |
编译时间戳(16进制,可转换为时间) | 5348961E → 2014-04-12 09:25:50 |
characteristics |
文件特性(如可执行、支持 >2GB 地址) | Executable , 32 bit |
可选头OPTIONAL HEADER VALUES
字段 | 含义 | 示例值 |
magic |
文件类型标识(10B = 32位, 20B = 64位) |
10B |
address of entry point |
程序入口点相对地址(RVA) | CD8F8 |
image base |
默认加载基址 | 0f2b0000 |
section alignment |
内存对齐粒度(通常 0x1000 = 4KB) |
1000 |
file alignment |
文件对齐粒度(通常 0x200 = 512B) |
200 |
subsystem |
子系统类型(2 = GUI, 3 = CUI) |
2 |
DLL characteristics |
DLL 特性(如 ASLR 支持、DEP 保护) | Dynamic base , NX compatible |
节区头SECTION HEADER
- 常见权限标志
60000020
:代码段(可执行、可读)C0000040
:数据段(可读、可写)40000040
:资源段(只读
1 2 3 4 5 6 7 |
SECTION HEADER #1 .text name 638FFB virtual size # 内存中大小 1000 virtual address # 内存偏移(RVA) 639000 size of raw data # 文件中大小 400 file pointer to raw data # 文件偏移 60000020 flags # 权限(Code, Execute, Read) |
目录表DATA DIRECTORIES
- 作用
- 定位关键数据结构(如分析
DLL
导出函数或依赖项)
- 定位关键数据结构(如分析
1 2 3 |
9408 [ EDF] address [size] of Export Directory # 导出表地址及大小 64C7BC [ 8C] address [size] of Import Directory # 导入表地址及大小 650000 [ 504] address [size] of Resource Directory # 资源表地址及大小 |
对比lmi
!dh
:输出完整PE
头信息,适合深度分析!lmi
:仅显示模块摘要(路径、版本、时间戳),适合快速验证
声明:本文为原创文章,版权归Aet所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ Windbg:命令总览学习一04/06
- ♥ Windbg:命令实践详解二03/28
- ♥ Windbg关于死锁的简单调试分析总结09/13
- ♥ Windows调试相关简记12/13
- ♥ Dump分析:重复释放堆内存,死锁03/17
- ♥ Windbg:命令实践详解一03/27