当前位置:网站首页>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] recursive equation (special solution example 1 Hannover tower complete solution process | special solution example 2 special solution processing when the characteristic root is 1)
- How to deploy applications on kubernetes cluster
- Interviewer: why is the value nil not equal to nil?
- link preload prefetch
- Ssl/bio of OpenSSL_ get_ fd
- Distributed task distribution framework gearman
- 问题随记 —— 在 edge 上看视频会绿屏
- Web-ui automated testing - the most complete element positioning method
- A. Berland Poker &1000【简单数学思维】
猜你喜欢

Codeforces Round #803 (Div. 2) C. 3SUM Closure

Global and Chinese pediatric palliative care drug market development research and investment planning recommendations report 2022-2028

PHP MySQL inserts data

模块九作业

POM in idea XML graying solution

Applet setting multi account debugging

鸿蒙第三次培训

聊聊支付流程的设计与实现逻辑

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

Golang unit test, mock test and benchmark test
随机推荐
Design limitations of structure type (struct)
面试官:值为 nil 为什么不等于 nil ?
Hongmeng fourth training
1164 Good in C
Vs2013 has blocked the installer, and ie10 needs to be installed
The gbase 8A database does not support the DB2 function value (column_name, 0) cluster syntax
1164 Good in C
自动渗透测试工具核心功能简述
MinGW compile boost library
Postfix 技巧和故障排除命令
Mathematical formula (test)
SQL injection database operation foundation
PHP processing - watermark images (text, etc.)
Classroom attendance system based on face recognition tkinter+openpyxl+face_ recognition
PR second time
Market demand survey and marketing strategy analysis report of global and Chinese pet milk substitutes 2022-2028
模块九作业
Kotlin的协程:上下文
Fedora 21 installs lamp host server
ArrayList分析3 : 删除元素