首页
社区
课程
招聘
[求助]如何获取进程的PE头信息,非磁盘文件
发表于: 2014-11-21 09:19 4303

[求助]如何获取进程的PE头信息,非磁盘文件

2014-11-21 09:19
4303
我直接读取磁盘文件上的,就是通过fopen.fread.读取某个可执行文件,可以正确获取,导入,导出directory.其他的Data_Directory也可以正确获取.
但是当我,进行对一个进程进行PE信息解析的时候,就发现我之前写的RVA->offset不行了.
当然,我已经通过hModule获取到了ntHeader等信息,但是要通过RVA得到信息的 时候,就不行了,具体来说,之前那个适用于磁盘文件的RVA转换公式不好用了,大牛们说下,我遗漏了哪些信息.
有人告诉我是重定位表 导致的,我看了下,这是修改那些全局变量,由于windows加载器没有按照建议装载地址装入内存导致的需要相对转换,跟这个 似乎没有关系.

For executable images, the address of the first byte of the section relative to the image base when the section is loaded into memory. For object files, this field is the address of the first byte before relocation is applied; for simplicity, compilers should set this to zero. Otherwise, it is an arbitrary value that is subtracted from offsets during relocation.
这是关于section header中的VirtualAddress官方解释,不是很懂 executable image 和 object file的意思 ,也 清大牛解释下

另外在解析执行中的 exe的pe的时候,rva转换之前 用的SizeOfRawData,我换成了 section header里的misc.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.

不是很懂,但是换成这个,同样不行

擦,,,,,,,这几天状态 不好  ,其实内存中的,哪里来的rva转换啊,,,问题 就此 解决

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

收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 1555
活跃值: (3032)
能力值: ( LV11,RANK:180 )
在线值:
发帖
回帖
粉丝
2
内存中的都对齐了吧,和文件组织不同吧。。。。  搞过一段时间的病毒。。。学的马马虎虎
2014-11-21 09:30
0
游客
登录 | 注册 方可回帖
返回
//