debasishm89
February 15th, 2015, 13:06
Hello All,
Using windbg if we try to dump heap of a win32 processes(Win7) (Mostly in process which has high heap memory consumption like IE ) using !heap -a 03dc0000 I often find multiple segments of a particular heap like ,
My questions is how can I find the total number of segments (of any particular heap) and their base addresses from process memory manually??
I know we need to parse some singly Linked list (possibly located @ heap_handle +0x010 offset ) to get all the segments but not sure exactly how I should parse it.
THANKS,
Using windbg if we try to dump heap of a win32 processes(Win7) (Mostly in process which has high heap memory consumption like IE ) using !heap -a 03dc0000 I often find multiple segments of a particular heap like ,
Code:
0:029> !heap -a 03dc0000
Index Address Name Debugging options enabled
8: 03dc0000
Segment at 03dc0000 to 03dd0000 (00010000 bytes committed)
Segment at 036b0000 to 037b0000 (00100000 bytes committed)
Segment at 04ff0000 to 051f0000 (00200000 bytes committed)
Segment at 05b50000 to 05f50000 (00160000 bytes committed)
My questions is how can I find the total number of segments (of any particular heap) and their base addresses from process memory manually??
I know we need to parse some singly Linked list (possibly located @ heap_handle +0x010 offset ) to get all the segments but not sure exactly how I should parse it.
Code:
0:029> dt _heap 03dc0000
ntdll!_HEAP
+0x000 Entry : _HEAP_ENTRY
+0x008 SegmentSignature : 0xffeeffee
+0x00c SegmentFlags : 0
+0x010 SegmentListEntry : _LIST_ENTRY [ 0x36b0010 - 0x3dc00a8 ]
+0x018 Heap : 0x03dc0000 _HEAP
+0x01c BaseAddress : 0x03dc0000 Void
+0x020 NumberOfPages : 0x10
+0x024 FirstEntry : 0x03dc0588 _HEAP_ENTRY
+0x028 LastValidEntry : 0x03dd0000 _HEAP_ENTRY
+0x02c NumberOfUnCommittedPages : 0
+0x030 NumberOfUnCommittedRanges : 1
+0x034 SegmentAllocatorBackTraceIndex : 0
+0x036 Reserved : 0
+0x038 UCRSegmentList : _LIST_ENTRY [ 0x3dcfff0 - 0x3dcfff0 ]
+0x040 Flags : 0x1002
+0x044 ForceFlags : 0
+0x048 CompatibilityFlags : 0
+0x04c EncodeFlagMask : 0x100000
+0x050 Encoding : _HEAP_ENTRY
+0x058 PointerKey : 0x57eb514f
+0x05c Interceptor : 0
+0x060 VirtualMemoryThreshold : 0xfe00
+0x064 Signature : 0xeeffeeff
+0x068 SegmentReserve : 0x800000
+0x06c SegmentCommit : 0x2000
+0x070 DeCommitFreeBlockThreshold : 0x800
+0x074 DeCommitTotalFreeThreshold : 0x2000
+0x078 TotalFreeSize : 0x2a7e6
+0x07c MaximumAllocationSize : 0x7ffdefff
+0x080 ProcessHeapsListIndex : 8
THANKS,