当前位置:网站首页>Introduction to reverse commissioning - VA and RVA conversion in PE 04/07
Introduction to reverse commissioning - VA and RVA conversion in PE 04/07
2022-06-30 13:41:00 【51CTO】
Block characteristics :
1、 Properties of memory pages
2、 The offset address of the section
3、 Section size
4、 Sections that are not mapped
A section is actually a combination of the same attribute data .

The relationship between file and memory mapping
Formula for
RVA It's a relative virtual address (RelativeVirtualAddress) Abbreviation .RVA When PE After the file is loaded into memory , The offset of a data location from the file header .
Reference article :
In practice , We often come across... That will be accessed in code snippets RVA convert to PA, In this case, you need to read ⽂ To do the corresponding conversion .

The conversion process
The conversion ⼀ The general steps are :
1、 take exe⽂ Piece mapping ⼊ In the memory , Read Dos MZ Header, In this structure , We can get through e_lfanew To get NT⽂ The piece head is relative to Dos⽂ Offset of part head .

MZ Head

DOS The head is relative to PE Head offset
2、 Got it NT⽂ The address of the header ,NT⽂ The header contains two ⽂ Piece head ,⼀ Yes FILE⽂ Piece head ,⼀ Yes Optional Optional ⽂ Piece head , stay FILE⽂ In the header, we can read the number of segments , It's changing RVA At the address , We just need to get this amount .

The number of segments is 8
3、 take NT⽂ The piece head is followed by SECTION TABLE, This is the description header , In this paragraph description header , We ⼏ You can almost get the information of all the segments .
VritualAddress: This is ⼀ individual RVA Address , The meaning of representation is to tell PE Loader this segment exists in RVA The address is VritualAddress It's about

VA by 1000H
PointerToRawData: This is a ⼀ Physical offset addresses , tell PE The loader will physically ⽂ Piece offset PointerToRawData Data mapping at ⼊VritualAddress It's about
VirtualSize: Of this paragraph ⼤⼩
SizeOfRawData: The physics of this segment ⼤⼩. Due to alignment problems , So the ⼤⼩ Why not ⼩ On VirtualSize⼤⼩ Alignment of ⼤⼩ Integer multiple .
4. By traversing SECTION TABLE, Determine what to convert RVA Whether the address is in the... Of all segments RVA Address range . Of this paragraph RVA The scope is : VritualAddress + SizeOfRawData, More precisely, of course VirtualAddress + VirtualSize.
5. If it exists in the address range , Then we can use the RVA Address minus the... Of the segment VirtualAddress Calculate the offset relative to the segment
6. Add... To the offset PointerToRawData, You can work out the physical address .
The algorithm is complex .
We use OD Tools to analyze .

Let's look at the address 00400200

Sure enough, the address is code Code block for .
边栏推荐
- golang文件的写入、追加、读取、复制操作:bufio包的使用示例
- Basic syntax of unity script (3) - accessing game object components
- mysql拒绝访问、管理员身份打开的
- QQ 居然被盗了?原因在这......
- 为基础性语言摇旗呐喊
- Yousi College: Six Sigma is not just statistics!
- MFQE 2.0: A New Approach for Multi-FrameQuality Enhancement on Compressed Video
- Google Earth Engine(GEE)——GHSL:全球人类住区层,建成网格 1975-1990-2000-2015 (P2016) 数据集
- numpy 创建空数组 data = np.empty(shape=[1, 64,64,3])
- 优思学院:六西格玛不只是统计!
猜你喜欢

Basic syntax of unity script (1) - common operations of game objects
![[Title brushing] heater](/img/ee/70e122b1b1a406624aa7c6442fcdc1.png)
[Title brushing] heater
![【科研数据处理】[基础]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)](/img/70/8bf226964118efb324ca4d339df654.png)
【科研数据处理】[基础]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)

JS converts an array to a two-dimensional array based on the same value

Today's sleep quality record 80 points

Idea 2021.3 golang error: rning: undefined behavior version of delve is too old for go version 1.18

JMeter learning notes

Rk356x u-boot Institute (command section) 3.3 env related command usage

【观察】智能产业加速,为何AI算力要先行?
![[deep anatomy of C language] storage principle of float variable in memory & comparison between pointer variable and](/img/3d/5d7fafba4ff7903afbd51d6d58dcdf.png)
[deep anatomy of C language] storage principle of float variable in memory & comparison between pointer variable and "zero value"
随机推荐
This editor will open source soon!
【观察】智能产业加速,为何AI算力要先行?
一条查询SQL是如何执行的
Embedded development: five C features that may no longer be prohibited
(8)JMeter元件详解之 Once only Controller 仅一次控制器
一次 Keepalived 高可用的事故,让我重学了一遍它!
逆向调试入门-PE中的VA与RVA换算04/07
【科学文献计量】外文文献及中文文献关键词的挖掘与可视化
All the abnormal knowledge you want is here
Common UI components
Clearing TinyMCE rich text cache in elementui
Resource realization applet opening wechat official small store tutorial
SQL programming problem, test case failed
Resource realization applet opening traffic main tutorial
步骤详解 | 助您轻松提交 Google Play 数据安全表单
数据库表为什么写不进数据了
[kali] Kali system, software update (with image source)
Paper interpretation (AGC) attributed graph clustering via adaptive graph revolution
知识传播不能取代专业学习!
提权扫描工具