当前位置:网站首页>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 .
边栏推荐
- More than 20 years after Hong Kong's return, Tupu digital twin Hong Kong Zhuhai Macao Bridge has shocked
- kaniko官方文档 - Build Images In Kubernetes
- 正则系列之断言Assertions
- Basic syntax of unity script (4) - access to other game objects
- MFQE 2.0: A New Approach for Multi-FrameQuality Enhancement on Compressed Video
- MySQL如何将列合并?
- 【刷题篇】供暖器
- 今日睡眠质量记录80分
- Open source of xinzhibao applet
- 60 个神级 VS Code 插件!!
猜你喜欢

How can I protect my private key?

Waving flags and shouting for basic language

Observable, reliable: the first shot of cloudops series Salon of cloud automation operation and maintenance

香港回归20余年,图扑数字孪生港珠澳大桥,超震撼
![【科研数据处理】[基础]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)](/img/70/8bf226964118efb324ca4d339df654.png)
【科研数据处理】[基础]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)

JMeter learning notes

SQL programming problem, test case failed

一篇文章读懂关于企业IM的所有知识点

Resource realization applet opening traffic main tutorial

防火墙基础之总部双机热备与分支基础配置
随机推荐
Prometheus 2.29.0 新特性
ABAP工具箱 V1.0(附实现思路)
Unity 频繁切换分支 结果模型出现莫名其妙的错误
用Unity实现Flat Shading
Resource realization applet opening wechat official small store tutorial
App wechat payment unicloud version of uniapp payment (with source code)
Embedded development: five C features that may no longer be prohibited
DNS resolution home network access public DNS practice
[the path of system analyst] Chapter V software engineering (software process improvement)
kaniko官方文档 - Build Images In Kubernetes
What is erdma as illustrated by Coptic cartoon?
The independent station is Web3.0. The national "14th five year plan" requires enterprises to build digital websites!
Goods and services - platform properties
为基础性语言摇旗呐喊
Paper interpretation (AGC) attributed graph clustering via adaptive graph revolution
Postman automatically generates curl code snippets
编程实战赛来啦!B站周边、高级会员等好礼送你啦!
Defi "where does the money come from"? A problem that most people don't understand
幸运哈希竞猜系统开发(源码部署)趣投哈希游戏玩法开发(案例需求)
This article explains the concepts of typed array, arraybuffer, typedarray, DataView, etc