龙之谷—资源文件讲解(2)—资源结构
韩国3D新游戏的——“龙之谷”的三个资源文件(第一节已经讲过)的结构是一样的。
因此,本节就第三个文件作为讲解的内容。
用“Uedit32.exe”软件,将“Resource02.pak”打开,
00000000h: 45 79 65 64 65 6E 74 69 74 79 47 61 6D 65 73 20 ; EyedentityGames
00000010h: 50 61 63 6B 69 6E 67 20 46 69 6C 65 20 30 2E 31 ; Packing File 0.1
00000020h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
00000030h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
…………………
这是资源文件的开头部分,很明显,这个是一个资源文件的描述部分,
“EyedentityGames Packing File 0.1”(Eyedentity游戏打包文件0.1)。
这是资源文件的通常作风,通描述部分一般是作为文件标识来使用的,
即,用来判断文件的兼容性及版本等信息。
龙之谷的这个资源文件的描述部分,用了$100个字节即256个字节。
接下来,我们要看看这一段。
00000100h: 0B 00 00 00 39 22 00 00 8F 49 18 13 00 00 00 00 ; ….9″..廔……
00000110h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
00000120h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
00000130h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
这一段,是一段资源文件的另一个描述部分,
通常的游戏资源文件的结构是这样子的:
文件标识+附加信息+资源内容+检验信息
其中:
文件标识一般有两个部分,即文件标识=标识长度+标识内容
龙之谷的资源文件,采用了256的固定长度,所以,就没了“标识长度”这一部分。
附加信息:有很多种情况,比较常看的有:
附加信息=文件大小+虚拟文件的数量+索引地址
因此,我们来看看这一行,
00000100h: 0B 00 00 00 39 22 00 00 8F 49 18 13 00 00 00 00 ; ….9″..廔……
0B 00 00 00:很显然,这不是文件大小,所以,这个资源文件没有采用这一作法,
39 22 00 00 :转换一下等于$2239(数据是按低位先存的形式),
等于10进制的8761,这个应当就是虚拟文件的数量
再看一下
8F 49 18 13:转换一下等于$1318498F,用“搜索(S)”>“转到行/页(G)”>录入”0x1318498F”>”确定”
13184980h: E9 41 62 80 E9 E1 FA D7 C3 7F 00 18 72 0D 08 5C ; 锳b 獒 ?..r..\
13184990h: 72 65 73 6F 75 72 63 65 5C 73 6F 75 6E 64 5C 64 ; resource\sound\d
131849a0h: 6D 76 5C 71 5F 6D 61 6E 61 72 69 64 67 65 5F 64 ; mv\q_manaridge_d
131849b0h: 65 73 74 69 6E 79 67 69 72 6C 5F 30 31 5C 30 36 ; estinygirl_01\06
131849c0h: 5F 71 5F 6D 61 6E 61 72 69 64 67 65 5F 64 65 73 ; _q_manaridge_des
131849d0h: 74 69 6E 79 67 69 72 6C 5F 30 31 5F 64 65 73 74 ; tinygirl_01_dest
131849e0h: 72 6F 79 2E 6F 67 67 00 00 00 00 00 00 00 00 00 ; roy.ogg………
131849f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
很显然,这是就是虚拟文件的索引部分,
因此,“8F 49 18 13”是指向虚拟文件的索引地址
第一个文件名出来了,
\resource\sound\dmv\q_manaridge_destinygirl_01\06_q_manaridge_destinygirl_01_destroy.ogg
接下来就是要批量提取这些文件名了。
那么,游戏资源文件的文件索引,一般会遵循什么样的方式呢?
通常是这样子的:
单文件索引=文件名长度+文件名+文件信息
其中:文件信息包括:文件的大小,文件的地址,有时,还包含了文件类型,
有时还会出现文件名为索引号,指向另一个资源文件,这个以后再讲。
先来看看龙之谷的资源文件的虚拟文件的索引段内容
13184980h: E9 41 62 80 E9 E1 FA D7 C3 7F 00 18 72 0D 08 5C ; 锳b 獒 ?..r..\
13184990h: 72 65 73 6F 75 72 63 65 5C 73 6F 75 6E 64 5C 64 ; resource\sound\d
131849a0h: 6D 76 5C 71 5F 6D 61 6E 61 72 69 64 67 65 5F 64 ; mv\q_manaridge_d
131849b0h: 65 73 74 69 6E 79 67 69 72 6C 5F 30 31 5C 30 36 ; estinygirl_01\06
131849c0h: 5F 71 5F 6D 61 6E 61 72 69 64 67 65 5F 64 65 73 ; _q_manaridge_des
131849d0h: 74 69 6E 79 67 69 72 6C 5F 30 31 5F 64 65 73 74 ; tinygirl_01_dest
131849e0h: 72 6F 79 2E 6F 67 67 00 00 00 00 00 00 00 00 00 ; roy.ogg………
131849f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184a00h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184a10h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184a20h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184a30h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184a40h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184a50h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184a60h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184a70h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184a80h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E ; …………….
13184a90h: 5E 02 00 C5 62 02 00 1E 5E 02 00 00 04 00 00 0A ; ^..舃…^…….
13184aa0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184ab0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184ac0h: 00 00 00 00 00 00 00 00 00 00 00 5C 72 65 73 6F ; ………..\reso
13184ad0h: 75 72 63 65 5C 73 6F 75 6E 64 5C 64 6D 76 5C 71 ; urce\sound\dmv\q
13184ae0h: 5F 6D 61 6E 61 72 69 64 67 65 5F 64 65 73 74 69 ; _manaridge_desti
13184af0h: 6E 79 67 69 72 6C 5F 30 31 5C 76 6F 63 5F 30 31 ; nygirl_01\voc_01
13184b00h: 5F 71 5F 6D 61 6E 61 72 69 64 67 65 5F 64 65 73 ; _q_manaridge_des
13184b10h: 74 69 6E 79 67 69 72 6C 5F 30 31 5F 65 6D 6D 2E ; tinygirl_01_emm.
13184b20h: 6F 67 67 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ogg………….
在“\resource\”之前没有双字节或四字节,或单字节的一个长度描述,
所以可以判断,龙之谷的资源文件的索引段,是没有“文件名长度”这一部分的,
为什么呢,那还有另一种情况,就是所有的“单文件索引”的文件名本身就是固定长度的,
那么这个固定长度是多少呢,通常来说是256个字节或127个字节,
让我们来看看:
从0x1318498F至0x13184a8F刚好是256个字节,再看看下一个单文件索引段,
13184ac0h: 00 00 00 00 00 00 00 00 00 00 00 5C 72 65 73 6F ; ………..\reso
13184ad0h: 75 72 63 65 5C 73 6F 75 6E 64 5C 64 6D 76 5C 71 ; urce\sound\dmv\q
13184ae0h: 5F 6D 61 6E 61 72 69 64 67 65 5F 64 65 73 74 69 ; _manaridge_desti
13184af0h: 6E 79 67 69 72 6C 5F 30 31 5C 76 6F 63 5F 30 31 ; nygirl_01\voc_01
13184b00h: 5F 71 5F 6D 61 6E 61 72 69 64 67 65 5F 64 65 73 ; _q_manaridge_des
13184b10h: 74 69 6E 79 67 69 72 6C 5F 30 31 5F 65 6D 6D 2E ; tinygirl_01_emm.
13184b20h: 6F 67 67 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ogg………….
13184b30h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184b40h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184b50h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184b60h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184b70h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184b80h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184b90h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184ba0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184bb0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184bc0h: 00 00 00 00 00 00 00 00 00 00 00 B4 4B 00 00 FF ; ………..碖…
13184bd0h: 4E 00 00 B4 4B 00 00 1E 62 02 00 0A 00 00 00 00 ; N..碖…b…….
13184be0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184bf0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13184c00h: 00 00 00 00 00 00 00 5C 72 65 73 6F 75 72 63 65 ; …….\resource
结果很显然,也是一样的,
再随机查找一段,
13427b90h: 00 00 00 5C 72 65 73 6F 75 72 63 65 5C 73 6F 75 ; …\resource\sou
13427ba0h: 6E 64 5C 6E 70 63 5C 6E 70 63 5F 74 68 6F 6D 61 ; nd\npc\npc_thoma
13427bb0h: 73 5C 6E 70 63 5F 74 68 6F 6D 61 73 5F 73 70 5F ; s\npc_thomas_sp_
13427bc0h: 31 32 5F 63 2E 77 61 76 00 00 00 00 00 00 00 00 ; 12_c.wav……..
13427bd0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427be0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427bf0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c00h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c10h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c20h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c30h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c40h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c50h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c60h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c70h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c80h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427c90h: 00 00 00 F9 CC 03 00 E2 5A 04 00 F9 CC 03 00 9E ; … ..鈀.. ..?.
13427ca0h: DE F8 12 2A 00 00 00 00 00 00 00 00 00 00 00 00 ; 搌.*…………
13427cb0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; …………….
13427cc0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5C ; ……………\
13427cd0h: 72 65 73 6F 75 72 63 65 5C 73 6F 75 6E 64 5C 6E ; resource\sound\n
很显明,我们的猜测是正确的。
那么,龙之谷的资源文件中的虚拟文件的索引部分应为:
单文件索引=文件名+文件信息
接下来,我们要分析一下,这个文件信息了。
对比前面三个“单文件索引”,你会发现,在256的文件名长度后,还有60个字节的长度,
之后,就是指向下一个“单文件索引”,说明这个文件信息的长度为60个字节。
这样一下,我们的事情就好办了,
单文件索引的固定长度为256+60个字节,256为文件名的长度,
这样一来,取出这些虚拟文件的名称,就是小CASE了,。
暂无评论内容