当前位置:Gxlcms > 数据库问题 > windbg heap

windbg heap

时间:2021-07-01 10:21:17 帮助过:133人阅读

 

完全页堆时,申请的内存粒度为0x1000(4K),且在申请的内存块后面再加个4K的栏栅内存。
完全页堆时,HEAP_ENTRY变为DPH_HEAP_BLOCK,且不跟用户内存连续:

(heap -p -h xx部分输出结果)Busy allocations
DPH_HEAP_BLOCK : UserAddr UserSize - VirtAddr VirtSize
00151634 : 00198fd8 00000024 - 00198000 00002000
MSCTF!CSharedBlockNT::`vftable‘
0015183c : 0017eff8 00000008 - 0017e000 00002000
001534d4 : 01efafe0 00000020 - 01efa000 00002000
00153074 : 01f57ff0 0000000c - 01f57000 00002000
001531dc : 01f3bf88 00000074 - 01f3b000 00002000
00152a0c : 01f24f88 00000074 - 01f24000 00002000
00152c3c : 01f20f88 00000074 - 01f20000 00002000


heap -p -h heap_handle,输出heap中的所有entry
heap -i heap_entry指针,打印(_heap_entry)结构体内容,共8字节,需要注意的是,这里的size单位为8字节

+ust时,用户申请的内存指针前是0x20字节的dph_block_information,再往上是heap_entry,否则直接是heap_entry
dph_block_information,dph_heap_block, heap -p -a都可以输出stacktrace
heap -p -a 内存地址,开启页堆(完全或常规)时,报访问错误输出不了call stack,不开启时relase又输出不完整;只有debug下才有用。

heap-p-a访问失败示例:
0:001> !heap -p -a 0218ef20
ReadMemory error for address eeddccee
Use `!address eeddccee‘ to check validity of the address.

heap -l fullpage 不可用, normal page正常, debug正常
heap -x fullpage 无输出, noraml page正常, debug正常
heap -flt / -p -h 中第一项在full heap page时,是dph heap block,在normal heap page时,是heap entry

normal page时,!heap -x输出示例:
0:001> !heap -x 02140180
Entry User Heap Segment Size PrevSize Unused Flags
-----------------------------------------------------------------------------
02140158 02140160 01df0000 02140000 118 118 14 busy extra
其中:118: 包含14字节填充空间,8字节heap_entry,0x20字节_dph_block_information

windbg heap

标签:

人气教程排行