当前位置:网站首页>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 )
边栏推荐
- 毕业总结
- Analyse ArrayList 3: suppression d'éléments
- Postfix 技巧和故障排除命令
- QT adjust win screen brightness and sound size
- Where is the monitoring page of RDS database?
- i++与++i的区别:通俗易懂的讲述他们的区别
- MinGW compile boost library
- 模块九作业
- How to install PHP on Ubuntu 20.04
- Internet hospital his management platform source code, online consultation, appointment registration smart hospital applet source code
猜你喜欢
The third day of writing C language by Yabo people
Type conversion, variable
模块九作业
TCP congestion control details | 3 design space
Codeforces Round #803 (Div. 2) C. 3SUM Closure
Tensorboard quick start (pytoch uses tensorboard)
聊聊支付流程的設計與實現邏輯
Notes on problems -- watching videos on edge will make the screen green
聊聊支付流程的设计与实现逻辑
STM32实现74HC595控制
随机推荐
Investigation on the operation prospect of the global and Chinese Anti enkephalinase market and analysis report on the investment strategy of the 14th five year plan 2022-2028
QT adjust win screen brightness and sound size
c# .net 工具生态
解决Zabbix用snmp监控网络流量不准的问题
[combinatorics] recursive equation (the non-homogeneous part is an exponential function and the bottom is the characteristic root | example of finding a special solution)
QT learning diary 9 - dialog box
Research on Swift
AcWing 4489. 最长子序列
Hongmeng third training
鸿蒙第四次培训
Analyse ArrayList 3: suppression d'éléments
问题随记 —— 在 edge 上看视频会绿屏
Life perception 1
win32:堆破坏的dump文件分析
Vs2013 has blocked the installer, and ie10 needs to be installed
Loop through JSON object list
Interviewer: why is the value nil not equal to nil?
PHP MySQL inserts data
Design limitations of structure type (struct)
Postfix 技巧和故障排除命令