当前位置:网站首页>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 .
边栏推荐
- [kali] Kali system, software update (with image source)
- 知识传播不能取代专业学习!
- RK356x U-Boot研究所(命令篇)3.2 help命令的用法
- 我如何才能保护我的私钥?
- Resource realization applet opening traffic main tutorial
- 华为帐号多端协同,打造美好互联生活
- (8) JMeter component detailed once only controller
- Postman automatically generates curl code snippets
- 【刷题篇】避免洪水泛滥
- 【Kubernetes系列】K8s设置MySQL8大小写不敏感
猜你喜欢
Introduction to two types of rxjs observable operators
Unity Animator 参数
半导体动态杂谈
On the simplification and acceleration of join operation
香港回归20余年,图扑数字孪生港珠澳大桥,超震撼
一条查询SQL是如何执行的
IM即时通讯应用开发中无法解决的“顽疾”
What is erdma as illustrated by Coptic cartoon?
可观测,才可靠:云上自动化运维CloudOps系列沙龙 第一弹
Postman automatically generates curl code snippets
随机推荐
Paper interpretation (AGC) attributed graph clustering via adaptive graph revolution
[Title brushing] heater
Multi terminal collaboration of Huawei accounts to create a better internet life
香港回归20余年,图扑数字孪生港珠澳大桥,超震撼
[kali] Kali system, software update (with image source)
“即服务”,企业数字化转型的必然选择
MySQL如何将列合并?
Intelligent operation and maintenance: visual management system based on BIM Technology
一次 Keepalived 高可用的事故,让我重学了一遍它!
嵌入式开发:5个可能不再被禁止的C特征
数据湖(十一):Iceberg表数据组织与查询
With the development of industrial Internet, the landing and application of the Internet has become wider
步骤详解 | 助您轻松提交 Google Play 数据安全表单
60 个神级 VS Code 插件!!
Basic syntax of unity script (4) - access to other game objects
Pytorch查看模型参数量和计算量
目录相关命令
深度长文探讨Join运算的简化和提速
用Unity实现Flat Shading
可觀測,才可靠:雲上自動化運維CloudOps系列沙龍 第一彈