魔兽世界 MPQ(MoPaQ) 文件相关资料

维基百科:http://en.wikipedia.org/wiki/MPQ 

维基百科下面的外部链接也是个好东西

 

 

MPQ Archives

Overview

原文出处:http://www.zezula.net/en/mpq/main.html


 

MPQ Archives

MPQ (MoPaQ) is an archive format developed by the Blizzard Entertainment company, intended for storing data files, images, sounds, music and videos for their games:

  • Diablo
  • StarCraft
  • Warcraft II (Battle.net Edition)
  • Diablo II
  • Warcraft III
  • World of Warcraft

They are also used in games Lords of Magic and Hellfire from Sierra. Name MoPaQ comes from the author of the format, Mike O'Brien (Mike O'brien PaCK).

 

Previous versions of archives

Before the game of Diablo was released, Blizzard used WAR format (Warcraft ARchive) for their stuff. This format was used with the game of Warcraft II (maybe also Warcraft I). This format was very simple, and average hacker was able to hack it in quite short time. Although it was not so great problem in Warcraft II, the newly coming game of Diablo needed to use a better archive format.

Requirements

A few main requirements were given onto newly developed format:

  • Security. Blizzard didn't want people to access their files and thus hack their games. Archive format has to support data encryption.
  • Fast access. It was necessary to access archived data as fast as possible, in realtime.
  • Compression. Blizzard decided to store sound files, including music, in the WAV format. Uncompressed size of these files is very large and archive must support their compression. For compdession and decompression, they decided to use PKWARE Data Compression Library, zlib and BZip2, together with special compression method used for storing WAV files, probably developed by Blizzard itself.
  • Expandability. Archive format must support later changes of the way how the files are stored in the archive. With new games released, the MPQ format is being extended. All the later changes are backward-compatible with older versions.
  • Multilanguage. Blizzard planned to release its games worldwide, in various language versions. The archive format must support storing multiple files with different languages.

MPQ archives can be stored also as part of EXE or other files. For example game patches are self-extracting MPQ archives.

MPQ patches

For the possibility of patching existing games, Blizzard does not change existing MPQ archives (which are on CD in some games). Instead of this, patching app creates a file Patch_rt.mpq (War3patch.mpq). When opening archive, the game first tries to open a file from the patch archive (Patch_rt.mpq). When it fails, the game looks for data in the original archive. With the Warcraft III game is also possible to make the game use, locally stored (unarchived) files when you change this setting in the registry:

 
注意一下以上这段加粗的话,wow的mpq就是这么运作的。上文的出处http://www.zezula.net/,该站点值得一看
 
 
http://shadowflare.samods.org/inside_mopaq/
这是一个相对比较全面讲解mpq文件的站点,但部分不全,主体部分中对几个重要函数的注释已经过时了,例如SFileOpenArchive函数
优先值和flag字段没有讲,看最后索引部分的内容比较新。
 
 
资料就写那么多,能找到的基本上都在这了,剩下的可以去玻璃渣内部偷- -!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值