[龙之谷专题]PAK资源打包器开发(移植)日志<已停止>

龙之谷PAK资源打包器开发进程表
功能
项目
开发(By greensea) 移植(by GPBeta)
读取 写入 Win32 UI界面
设计/D
实现/A
测试/T
开发状态 V2.2 下载    基本完成    遇到问题    未解决

前言

   龙之谷PAK资源文件打包程序(DNPacker)是由GS娘编写的一个小程序.故名思意,就是用于龙之谷资源修改后的重新打包的一个非常方便的工具.本程序仅用于学习研究之用,请勿用于商业用途,由此软件产生的商业纠纷软件作者一概不负责任.

使用说明

   "龙之谷PAK资源文件打包程序"是用于对网游 龙之谷 的游戏资源进行重新打包的工具,生成的 龙之谷 资源格式(*.pak)可以直接放到游戏根目录,游戏将按加载顺序对资源文件进行同名覆盖.

    使用方法:

  1. 把修改好的资源文件按照对应[文件索引]放到本程序目录下的 resource 或 mapdata文件夹.
  2. 双击运行程序目录下的pakpack.exe
  3. 选择程序界面的 mapdata 或 resource 复选框后,点击 打包 按钮即可生成pak文件.

资源链接

[note]PAK资源打包器V2.2 点击下载
程序作者发布页 点击跳转[/note]

资源结构

   PAK是《龙之谷》游戏的资源存放文件格式,本格式包含虚拟文件的数据及虚拟目录/文件的索引,游戏通过对程序目录下的*.pak后缀名的文件对资源包按顺序进行加载,并支持虚拟文件的同名覆盖(文件名须注明替换的包名,如:Resource01-test.pak).需要注意的是,在PAK包内的虚拟文件是被压缩(zlib方式,压缩级别1)后紧凑地存放在资源包的数据区的,因此从PAK提取后的文件需要经过解压才能使用.
以下是对PAK结构的猜想,以一个自制test.pak作范例:

文件头段: 占用256字节(00h-FFh),用于标识文件类型,只使用32字节(00h-20h).           
索引信息段: 占用16字节(100h-10Fh),用于指示索引信息及位置.                                    
0B 00 00 00: 占用4字节,固定为0B或0A两个数值                                                                
02 00 00 00: 占用4字节,表示虚拟文件数量                                                                          
00 05 00 00: 占用4字节,表示虚拟文件索引起始偏移地址                                                  
资源数据段: 不定长度,必须从400h处开始,用于存放虚拟文件数据,文件顺序紧凑存放.
78 01: 虚拟文件文件头,78为zlib标识,01表示压缩级别1                                                     
索引段: 不定长度,每个虚拟文件索引占316字节(13Ch),用于说明虚拟文件的相关信息.
500h-524h: 显而易见,这是一个包含完整虚拟目录信息的虚拟文件名,占用256字节      
20 00 00 00: 占用4字节,表示虚拟文件的大小                                                                      
20 00 00 00: 占用4字节,表示虚拟文件解压后的大小                                                          
                        (由于这是个例子文件,假设压缩前后大小不变)                                             
00 04 00 00: 占用4字节,表示虚拟文件的偏移地址                                                              
空白段: 无重大作用,对齐字节用意.

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 ; ................
00000040h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000050h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000060h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000070h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000080h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000090h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000000a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000000b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000000c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000000d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000000e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000000f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000100h: 0B 00 00 00 01 00 00 00 00 05 00 00 00 00 00 00 ; .........?......
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 ; ................
00000140h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000150h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000160h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000170h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000180h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000190h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000001f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000200h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000210h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000220h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000230h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000240h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000250h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000260h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000270h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000280h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000290h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000002f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000300h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000310h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000320h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000330h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000340h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000350h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000360h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000370h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000380h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000390h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000003f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000400h:  78 01  00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; x...............
00000410h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000420h:  78 01  00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; x...............
00000430h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000440h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000450h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000460h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000470h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000480h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000490h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000004a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000004b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000004c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000004d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000004e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000004f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000500h: 5C 6D 61 70 64 61 74 61 5C 72 65 73 6F 75 72 63 ; \mapdata\resourc
00000510h: 65 5C 73 6F 75 6E 64 5C 62 67 6D 5C 66 69 6C 65 ; e\sound\bgm\file
00000520h: 31 2E 6F 67 67 00 00 00 00 00 00 00 00 00 00 00 ; 1.ogg...........
00000530h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000540h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000550h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000560h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000570h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000580h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000590h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000005a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000005b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000005c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000005d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000005e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000005f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000600h: 20 00 00 00 20 00 00 00 20 00 00 00  00 04 00 00  ;  ... ... .......
00000610h: 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000620h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000630h: 00 00 00 00 00 00 00 00 00 00 00 00 5C 6D 61 70 ; ............\map
00000640h:  64 61 74 61 5C 72 65 73 6F 75 72 63 65 5C 73 6F  ; data\resource\so
00000650h:  75 6E 64 5C 62 67 6D 5C 66 69 6C 65 32 2E 6F 67  ; und\bgm\file2.og
00000660h: 67 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; g...............
00000670h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000680h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000690h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000006a0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000006b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000006c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000006d0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000006e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
000006f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000700h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000710h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000720h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000730h: 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 ; ............ ...
00000740h: 20 00 00 00 20 00 00 00  20 04 00 00  0A 00 00 00 ;  ... ... .......
00000750h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
00000760h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................

Change Log

2010.08.18 -V1.0.0
1.原始版本
2010.08.26 -V1.0.1
1.修正打包多于507个文件时,提示"无法访问Resource01-sp.pak"的BUG
2.更新zlib库到1.2.5
2010.09.04 -V2.0.0
1.修正在WindowsXP上使用本程序意外退出的问题
2.用纯WINAPI写了一个UI
2010.09.17 -V2.1.0
1.可选打包目录
2.优化消息传输
2011.01.16 -V2.2.0
1.UI界面支持视觉风格
2.修正复选框检测的BUG

  1. No comments yet.

  1. 02/01. 2015
    Trackback from : 龙之谷-pak分析 | NyKO



return top