当前位置:网站首页>Win32: dump file analysis of heap corruption
Win32: dump file analysis of heap corruption
2022-07-03 17:52:00 【What did you fix? Really】
- win32 Heap structure
Before solving practical problems , Let's first understand the related concepts
1. Heap structure
Pile up -> paragraph -> block
The heap consists of segments , Segments are made up of blocks , Block is the data structure of virtual memory that the user finally applies to the system .( At present, our user mode programs only need to understand blocks )
2. _HEAP_ENTRY structure
Each heap , Each segment , Each block will have a corresponding _HEAP_ENTRY structure , It describes the content of the area . Like block _HEAP_ENTRY Structure stores the heap to which it belongs , paragraph , Information such as the previous item size and current size .
- windbg Heap related commands
- View overview information of all heaps :!heap -s
- All segment and block information of a heap :!heap -a 0xXXXXXXXX
- Check the location of a memory address _HEAP_ENTRY Information :!heap -x 0xXXXXXXXX
- Count the overview information of a heap :!heap -stat -h 0xXXXXXXXX
- List all sizes X The block address of :!heap -flt s X
- View heap debugging support :!gflag
- View the contents of the memory block dc 0xXXXXXXXX
- Debugging of heap corruption
1. What is called heap destruction
Heap destruction is actually block destruction , Because of reading and writing to the space beyond the allocated address , Cause to destroy _HEAP_ENTRY structure ( If it is CRT Pile up , Just destroyed CRT Check the structure at the end of the heap , It even destroys the structure of the next block )
2. An example of heap corruption

Here is a deliberate operation beyond the boundary , Translate it into release edition , use windbg Hang up

Check it out. ptr Value

Check it out. ptr Where _HEAP_ENTRY structure , Discovery belongs to 00b30000 This pile , stay 00b34420 Inside this block


We see that the above blocks and subsequent blocks have been destroyed , So the characteristics of heap failure are basically like this . But this routine does not cause a crash .
3. Summarize the analysis ideas
a) Find the heap where the crashed block is located ( You can judge according to the address range ).
b) View all block information of the heap .
c) Find the corresponding information from the last block that has not been destroyed .( If the business logic is written from small to large , It will destroy the backward block , Otherwise, it is the opposite )
边栏推荐
- [combinatorics] generating function (shift property)
- [combinatorics] recursive equation (four cases where the non-homogeneous part of a linear non-homogeneous recursive equation with constant coefficients is the general solution of the combination of po
- Classroom attendance system based on face recognition tkinter+openpyxl+face_ recognition
- win32:堆破坏的dump文件分析
- Web-ui automated testing - the most complete element positioning method
- Stm32h7 Hal library SPI DMA transmission has been in busy solution
- 分布式的任务分发框架-Gearman
- Design limitations of structure type (struct)
- MySQL has been stopped in the configuration interface during installation
- [combinatorics] generating function (linear property | product property)
猜你喜欢

Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028

MySQL has been stopped in the configuration interface during installation

Interviewer: why is the value nil not equal to nil?

Internet Hospital his Management Platform source, online Inquiry, appointment Registration Smart Hospital Small program source

Draw some simple graphics with MFC

Vs2013 has blocked the installer, and ie10 needs to be installed

How to install PHP on Ubuntu 20.04

MySQL grouping query

Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code

STM32 realizes 74HC595 control
随机推荐
Talk about the design and implementation logic of payment process
[vscode] convert tabs to spaces
Introduction to SolidWorks gear design software tool geartrax
Automata and automatic line of non-standard design
Getting started with deops
PHP MySQL create database
Website with JS doesn't work in IE9 until the Developer Tools is activated
[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela
Notes on problems -- watching videos on edge will make the screen green
Design limitations of structure type (struct)
ArrayList分析3 : 删除元素
Records of long objects and long judgments in the stream of list
Tensorboard quick start (pytoch uses tensorboard)
Research Report on investment trends and development planning of China's thermal insulation material industry, 2022-2028
Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
Write a program to process a list container of string type. Find a special value in the container 9.27: and delete it if found. Rewrite the above procedure with deque container.
The gbase 8A database does not support the DB2 function value (column_name, 0) cluster syntax
Distributed task distribution framework gearman
WEB-UI自动化测试-最全元素定位方法
List的stream中Long对象与long判等问题记录