[PE结构分析] 11.资源表结构
资源表是一个树形结构,可以设置成2的31次方的层数,Windows 使用了3级:
类型->名称->语言

其中涉及到四个结构:
|
Data |
Description |
|
Resource Directory Tables (and Resource Directory Entries) |
A series of tables, one for each group of nodes in the tree. All top-level (Type) nodes are listed in the first table. Entries in this table point to second-level tables. Each second-level tree has the same Type ID but different Name IDs. Third-level trees have the same Type and Name IDs but different Language IDs. Each individual table is immediately followed by directory entries, in which each entry has a name or numeric identifier and a pointer to a data description or a table at the next lower level. |
|
Resource Directory Strings |
Two-byte-aligned Unicode strings, which serve as string data that is pointed to by directory entries. |
|
Resource Data Description |
An array of records, pointed to by tables, that describe the actual size and location of the resource data. These records are the leaves in the resource-description tree. |
|
Resource Data |
Raw data of the resource section. The size and location information in the Resource Data Descriptions field delimit the individual regions of resource data. |
Resource Directory Table
Each resource directory table has the following format. This data structure should be considered the heading of a table because the table actually consists of directory entries (described in section 6.9.2, "Resource Directory Entries") and this structure:
| Offset | Size | Field | Description |
| 0 | 4 | Characteristics | Resource flags. This field is reserved for future use. It is currently set to zero. |
| 4 | 4 | Time/Date Stamp | The time that the resource data was created by the resource compiler. |
| 8 | 2 | Major Version | The major version number, set by the user. |
| 10 | 2 | Minor Version | The minor version number, set by the user. |
| 12 | 2 | Number of Name Entries | The number of directory entries immediately following the table that use strings to identify Type, Name, or Language entries (depending on the level of the table). |
| 14 | 2 | Number of ID Entries | The number of directory entries immediately following the Name entries that use numeric IDs for Type, Name, or Language entries. |
Resource Directory Entries
The directory entries make up the rows of a table. Each resource directory entry has the following format. Whether the entry is a Name or ID entry is indicated by the resource directory table, which indicates how many Name and ID entries follow it (remember that all the Name entries precede all the ID entries for the table). All entries for the table are sorted in ascending order: the Name entries by case-sensitive string and the ID entries by numeric value. Offsets are relative to the address in the IMAGE_DIRECTORY_ENTRY_RESOURCE DataDirectory.
|
Offset |
Size |
Field |
Description |
|
0 |
4 |
Name Offset |
The offset of a string that gives the Type, Name, or Language ID entry, depending on level of table. |
|
0 |
4 |
Integer ID |
A 32-bit integer that identifies the Type, Name, or Language ID entry. |
|
4 |
4 |
Data Entry Offset |
High bit 0. Address of a Resource Data entry (a leaf). |
|
4 |
4 |
Subdirectory Offset |
High bit 1. The lower 31 bits are the address of another resource directory table (the next level down). |
Resource Directory String
The resource directory string area consists of Unicode strings, which are word-aligned. These strings are stored together after the last Resource Directory entry and before the first Resource Data entry. This minimizes the impact of these variable-length strings on the alignment of the fixed-size directory entries. Each resource directory string has the following format:
|
Offset |
Size |
Field |
Description |
|
0 |
2 |
Length |
The size of the string, not including length field itself. |
|
2 |
variable |
Unicode String |
The variable-length Unicode string data, word-aligned. |
Resource Data Entry
Each Resource Data entry describes an actual unit of raw data in the Resource Data area. A Resource Data entry has the following format:
|
Offset |
Size |
Field |
Description |
|
0 |
4 |
Data RVA |
The address of a unit of resource data in the Resource Data area. |
|
4 |
4 |
Size |
The size, in bytes, of the resource data that is pointed to by the Data RVA field. |
|
8 |
4 |
Codepage |
The code page that is used to decode code point values within the resource data. Typically, the code page would be the Unicode code page. |
|
12 |
4 |
Reserved, must be 0. |
|
[PE结构分析] 11.资源表结构的更多相关文章
- [PE结构分析] 8.输入表结构和输入地址表(IAT)
在 PE文件头的 IMAGE_OPTIONAL_HEADER 结构中的 DataDirectory(数据目录表) 的第二个成员就是指向输入表的.每个被链接进来的 DLL文件都分别对应一个 IMAGE_ ...
- Windows PE资源表编程(枚举资源树)
资源枚举 写一个例子,枚举一个PE文件的资源表.首先说下资源相关的作为铺垫. 1.资源类型也是PE可选头中数据目录的一种.位于第三个类型. 2.资源目录分为三层.第四层是描述文件相关的.这些结构是按照 ...
- activti表结构
1.结构设计 1.1. 逻辑结构设计 Activiti使用到的表都是ACT_开头的. ACT_RE_*: ’RE’表示repository(存储),RepositoryService接口所操作的 ...
- activiti数据库表结构剖析
1.结构设计 1.1. 逻辑结构设计 Activiti使用到的表都是ACT_开头的. ACT_RE_*: ’RE’表示repository(存储),RepositoryService接口所操作的 ...
- Apache activiti5.13工作流框架的表结构详解
1.结构设计 1.1. 逻辑结构设计 Activiti使用到的表都是ACT_开头的. ACT_RE_*: ’RE’表示repository(存储),RepositoryService接口所操作的 ...
- activiti 5.22 表结构解析及清空流程运行测试数据
1.结构设计 1.1. 逻辑结构设计 Activiti使用到的表都是ACT_开头的. ACT_RE_*: 'RE'表示repository(存储),RepositoryService接口所操作的 ...
- WindowsPE 第七章 资源表
资源表 在程序设计中,总会设计一些数据.这些数据可能是源代码内部需要用到的常量,菜单选项.界面描述等:也可能是源代码外部的,比如程序的图标文件.北京音乐文件.配置文件等,以上这些数据统称为资源.按照程 ...
- activiti5.13 框架 数据库表结构说明
1.结构设计 1.1. 逻辑结构设计 Activiti使用到的表都是ACT_开头的. ACT_RE_*: 'RE'表示repository(存储),RepositoryService接口所操作的 ...
- PE格式第九讲,资源表解析
PE格式第九讲,资源表解析 一丶熟悉Windows管理文件的方法 首先,为什么标题是这个,主要是为了下边讲解资源方便,因为资源结构体很乱.如果直接拿出来讲解,那么就会很晕. 1.windows管理文件 ...
随机推荐
- PD16 Generate Datebase For Sql2008R2时报脚本错误“对象名sysproperties无效”
PowerDesinger16创建数据库表到SQL2008R2时,执行报“对象名sysproperties无效”错误. 主要是在建模时我们对表.列增加了些说明注释,而Sql2005之后系统表syspr ...
- TSPL学习笔记(4):数组相关练习
最近研究函数式编程,都是haskell和scheme交互着看的,所以笔记中两种语言的内容都有,练习一般也都用两种语言分别实现. 本篇练习一些数组有关的问题,之所以与数组相关是因为在命令式编程中以下问题 ...
- 配置Tomcat的访问日志格式化输出
博客搬家,本文新地址:http://www.zicheng.net/article/9 本文描述如何配置tomcat的访问日志,按我们的要求输出指定的日志格式. 且在Nginx+Tomcat的配置 ...
- c#如何读取相机手机的拍摄时间
/// 获中的照片拍摄日期 /// </summary> /// <param name="fileName">文件名</param> /// ...
- iOS 数据持久化(扩展知识:模糊背景效果和密码保护功能)
本篇随笔除了介绍 iOS 数据持久化知识之外,还贯穿了以下内容: (1)自定义 TableView,结合 block 从 ViewController 中分离出 View,轻 ViewControll ...
- Unix sed实用教程系列目录[已完成]
本系列文章已经译完了,译自awk-sed@theunixschool,收获颇丰,作者没有讲明白的我做了补充,并且尝试讲的更清楚,整理成系列索引,方便学习,开篇非译文,是我为了方便后面的理解写的一篇,感 ...
- php网页切图/js切图
PhantomJS抓取网站页面信息以及网站截图 http://phantomjs.org/download.html PHP imagegrabscreen和imagegrabwindow(截取网站缩 ...
- JRE和JDK
转自:http://www.cnblogs.com/myitm/archive/2011/05/03/2035942.html 很多程序员已经干了一段时间java了依然不明白jdk与jre的区别. ...
- 让我们一起Go(十二)
前言: 上篇中,我们讲到了在Go语言中如何定义方法,今天,我们将进一步深入Go语言的面向对象编程. 一.Go语言中的接口 首先来看一个最基本的接口: 和定义一个结构体类似,只不过将struct换成了i ...
- 搭建WebRtc环境
0.前言 这次的需求,准备做的是一个类似与QQ视频一样的点对点视频聊天.这几天了解了一些知识后,决定使用HTML5新支持的WebRtc来作为视频通讯.客户端使用支持HTML5浏览器即可.服务器段需要提 ...