首页
社区
课程
招聘
未解决 [求助]关于PE中virtual size和size of raw data的疑惑
发表于: 2018-12-24 11:45 7515

未解决 [求助]关于PE中virtual size和size of raw data的疑惑

2018-12-24 11:45
7515
近日在《加密与解密》第四版注入技术时发现了一个以前的疑惑:
1. 一般virtual size通过file align之后得到size of raw data,所以前者是比后者小的。少数情况下前者比后者大,我查了一下发现没有得到很好的解释,希望大大们能讲解一下~

2. 另外如果有看过书中注入技术这章的朋友能告诉我一下452页中内存偏移为什么是virtual offset+size of raw data而不是virtual offset+virtual size呢?
该页内容如下



希望得到解答,谢谢~

[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 0
支持
分享
最新回复 (7)
雪    币: 5734
活跃值: (1737)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
2
VirtualSize        The total size of the section when loaded into memory. If this value is greater than SizeOfRawData, the section is zero-padded. This field is valid only for executable images and should be set to zero for object files.

SizeOfRawData        The size of the section (for object files) or the size of the initialized data on disk (for image files). For executable images, this must be a multiple of FileAlignment from the optional header. If this is less than VirtualSize, the remainder of the section is zero-filled. Because the SizeOfRawData field is rounded but the VirtualSize field is not, it is possible for SizeOfRawData to be greater than VirtualSize as well. When a section contains only uninitialized data, this field should be zero.

好好看手册 看这玩意有个卵用
2018-12-24 14:34
2
雪    币: 47
活跃值: (45)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
区段里的virtualsize 实际上是指初始化了的数据大小, 这些数据是肯定要放在文件里的, 所以一般情况比rawsize(向上对齐扇区大小)小
有的段( .bss)包含未初始化的数据, 没有必要存入文件, 但是有必要告诉os有这块数据, 这种情况 virtualsize就比rawsize大

2018-12-24 16:07
1
雪    币: 1161
活跃值: (67)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
frdGo 区段里的virtualsize 实际上是指初始化了的数据大小, 这些数据是肯定要放在文件里的, 所以一般情况比rawsize(向上对齐扇区大小)小有的段( .bss)包含未初始化的数据, 没有必要存入 ...
谢谢两位,回答的都很清楚~
2018-12-25 10:55
0
雪    币: 2998
活跃值: (2664)
能力值: ( LV2,RANK:15 )
在线值:
发帖
回帖
粉丝
5
小艾 VirtualSize The total size of the section when loaded into memory. If this value is greater than Siz ...
大哥您好,请问一下这手册叫什么?哪里可以下载
2019-11-19 09:27
0
雪    币: 5734
活跃值: (1737)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
6
. 大哥您好,请问一下这手册叫什么?哪里可以下载
http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx
2019-11-19 15:03
0
雪    币: 2998
活跃值: (2664)
能力值: ( LV2,RANK:15 )
在线值:
发帖
回帖
粉丝
7
小艾 http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx
谢谢
2019-11-20 09:33
0
雪    币: 220
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
8
也帮助了我,刚查其他问题的时候看到说vsize小于等于rawsize,然后看逆向核心里RVA转RAW的时候就碰到比rawsize大的...哈哈
2021-6-15 16:54
0
游客
登录 | 注册 方可回帖
返回
//