淬火管理员
Lv3Getting Started with CascView and CascLib: How Do You Read and Export Blizzard Game Resources?
Friends often ask me how to find models, textures, or sounds in Blizzard games such as Warcraft III. CascView and CascLib are established solutions. First, let’s distinguish between the three names:
• CASC: a data format and organizational structure used by games to store resources.
• CascView: a resource viewing and exporting tool with a graphical interface, often called CASC Viewer. It is suitable for general users.
• CascLib: an open-source reading library for programs. CascView uses it to read CASC data.
Use CascView to find resources manually; use CascLib to write batch extraction programs.[1]
- How Do They Read Resources?
CASC stands for Content Addressable Storage Container. At its core, it manages data using identifiers calculated from file contents.
File paths need to be associated with data locations on the disk through internal records. A program first parses the version configuration and resource records, then locates and decompresses the data. If it encounters encrypted data, the corresponding keys are also required.
CKey identifies file contents, while EKey identifies encoded data. ROOT, ENCODING, and the indexes handle lookups at different stages. The structure varies between games, and some files can also be accessed by number or content identifier.[2][3]
Files such as data.000 generally cannot be opened on their own. When reading local resources, keep the complete data directory, configuration, and version information such as .build.info.[1]
- How Do You Use CascView?
Download and extract it from the author’s website[1], run CascView.exe, and use Warcraft III as an example:
- Click Open Storage, select the game installation directory, and preferably choose the level containing .build.info and Data.
- If the Choose Product dialog appears, select the version you want to read, such as live or test servers.
- Wait for it to finish loading, expand directories on the left, and view files on the right. Warcraft III resources can be found under war3.w3mod.
- Select a file or folder, click Extract, and choose an export location. For your first attempt, extract a single file and check the result.
Actual screenshot: CascView 2.3 opening Warcraft III resources. The interface may differ slightly in other versions.
You can search by purpose: units for unit resources, textures for textures, sound for sounds, and maps for maps. The available content depends on the current game version.
导出保留资源本身的格式:.blp does not automatically become PNG,.mdx, nor does it automatically become FBX. Viewing and converting it afterward requires a tool that supports the corresponding format.
- How Do You Use CascLib?
CascLib is written in C++ and provides a C-style interface, making it suitable for developing resource browsers, batch export programs, or automation tools. It is released under the MIT open-source license.[4]
Download and compile the source code, include CascLib.h in your project, and link against the corresponding library. If you use a DLL, you must also deploy a DLL matching the program’s bitness.
Basic call sequence:
- CascOpenStorage: open the resource storage.
- CascOpenFile: open a file inside the storage.
- CascReadFile: read the data in chunks.
- Save it to disk using your program’s own file-writing functionality.
- CascCloseFile and CascCloseStorage: close the file and storage.
Check the return value at every step and log an error message if reading fails.[5]
- Three Common Questions
Do you only see numbers or a long string of characters?
Some games do not store complete filenames, so an additional listfile (filename list) is needed to supply the names. It only provides name mappings; it does not contain the resources or fill in missing data.[1]
Can you see the files but fail to export them?
The local data may not have been downloaded completely, the configuration or data may be corrupted, the tool may not support the current format, or encrypted files may be missing their keys. First, make sure the installation is complete and try updating the tool.[3]
Can you write modified files directly back?
CascView does not provide CASC editing or write-back functionality, and CascLib’s public purpose is also reading. You need to determine separately what methods the game supports for loading modified resources.[1][4]
References and Downloads
[1] Author introduction, CascView download, and feature overview: http://www.zezula.net/en/casc/main.html
[2] File-opening interface: https://www.zezula.net/en/casc/casclib/cascopenfile.html
[3] Reading implementation: https://github.com/ladislav-zezula/CascLib/blob/master/src/CascReadFile.cpp
[4] Source code, license, and integration instructions: https://github.com/ladislav-zezula/CascLib
[5] Official interface and extraction example: http://www.zezula.net/en/casc/casclib.html