|
[求助]怎样辨别真假Microsoft Visual C++ 6.0 [Overlay]?
去汉化新世纪看看,虽然现在好像没落了! |
|
[求助]关于IMAGE_SECTION_HEADER的问题!
谢谢各位,看来应该自己动手试一下!估计只要有0结尾就行了!唔,我用1填充了节表最后的所有的0,结果程序还是可以运行的,不过只测试了一个程序!不知道最后的空结构有什么用,为添加新节预留空间吗? |
|
[求助]关于PE文件对齐的疑惑?
从向风一样自由的BLog上找到了一些资料: 由PE文件中IMAGE_SECTION_HEADER结构中的Misc.VirtualSize,SizeOfRawData,SizeOfImag之间的关系分析PE加载器的对区块的处理行为 //用来计算对齐数据后的大小 int alig(int size,unsigned int align) { if(size%align!=0) return (size/align+1)*align; else return size; } 假设align为文件或区块对齐函数 PE文件中IMAGE_OPTIONAL_HEADER结构中的SizeOfImage的值为最后一个区块的VirtualAddress与其alig(Misc.VirtualSize,SectionAlignment)的和,不论PE文件区块表中描述的Misc.VirtualSize与SizeOfRawData的大小关系如何,PE文件各区块分别被映射到内存后大小都为alig(Misc.VirtualSize,SectionAlignment)的值。但是按SectionAlignment对齐后区块中的数据来源又是怎么回事呢?我们明白:这些数据会来源于磁盘数据。但会出现下面三种情况:(windows 2000 sp4实现发现SizeOfRawData值不按FileAlignment对齐似乎也能被正常加载) 一,若当alig(Misc.VirtualSize,SectionAlignment)大于SizeOfRawData时,PE文件被映射到内存后数据会如何变化?windows200 sp4中实验发现,如alig(Misc.VirtualSize,SectionAlignment)大于SizeOfRawData时,则以PointerToRawData为偏移从磁盘中先读入alig(SizeOfRawData,FileAlignment)大小的数据,剩余的alig(Misc.VirtualSize,SectionAlignment)-alig(SizeOfRawData,FileAlignment)大小的数据以0填充 二,若当alig(Misc.VirtualSize,SectionAlignment)小于alig(SizeOfRawData,FileAlignment)时,PE文件被映射到内存时只读入则以PointerToRawData为偏移大小为alig(Misc.VirtualSize,SectionAlignment)的数据,剩余alig(SizeOfRawData,FileAlignment)-alig(Misc.VirtualSize,SectionAlignment)的数不会被映射。 三,若当alig(Misc.VirtualSize,SectionAlignment)等于alig(SizeOfRawData,FileAlignment)时, PE文件会把alig(Misc.VirtualSize,SectionAlignment)大小的数据全部映射到进程线性地址空间。(注意:此时Misc.VirtualSize<=alig(SizeOfRawData,FileAlignment),若此时在磁盘文件PointerToRawData+Misc.VirtualSize偏移处写入不大于alig(SizeOfRawData,FileAlignment)-Misc.VirtualSize的数据,PE文件在磁盘中的大小与映像大小都不会发生变化) |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值