Last active
August 29, 2015 14:07
-
-
Save Choonster/a2f1d117233d7791b616 to your computer and use it in GitHub Desktop.
Script to extract some files from WoW's CASC system. Dependencies: Penlight, LuaCASC (http://www.townlong-yak.com/casc/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Build: b052c744ab97188cc23b0097f349f39c http://dist.blizzard.com.edgesuite.net/tpr/wow 3a8b8002b73063d2377159f586b05e00 Handle: table: 0081FA10 | |
| No content for Sound/Item/Weapons/Gun/GunFire01.ogg | |
| No content for Sound/Item/Weapons/Gun/GunLoad01.ogg | |
| No content for Sound/Item/Weapons/Gun/GunFire02.ogg | |
| No content for Sound/Item/Weapons/Gun/GunLoad02.ogg | |
| No content for Sound/Item/Weapons/Gun/GunFire03.ogg | |
| No content for Sound/Item/Weapons/Gun/GunLoad03.ogg | |
| No content for tos.html | |
| No content for DBFilesClient/FileData.dbc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Script to extract some files from WoW's CASC system | |
| -- Dependencies: Penlight, LuaCASC (http://www.townlong-yak.com/casc/) | |
| local SAVE_PATH = "C:/Users/MyUser/Documents/NewWoWSounds/" | |
| local dir = require("pl.dir") | |
| local path = require("pl.path") | |
| local casc = require("casc") | |
| local buildKey, cdnBase, cdnKey = casc.localbuild("C:/Users/Public/Games/World of Warcraft/.build.info", casc.selectActiveBuild) | |
| if not buildKey then | |
| -- Could not select a local build; query the patch server instead | |
| buildKey, cdnBase, cdnKey = casc.cdnbuild("http://us.patch.battle.net/wow/", "us") | |
| end | |
| local handle = casc.open("C:/Users/Public/Games/World of Warcraft/Data/", buildKey, cdnBase, cdnKey) | |
| print("Build:", buildKey, cdnBase, cdnKey, "Handle:", handle) | |
| local function SaveFile(filepath) | |
| local content = handle:readFile(filepath) | |
| if not content then | |
| print("No content for " .. filepath) | |
| return | |
| end | |
| local fullpath = SAVE_PATH .. filepath | |
| dir.makepath((path.splitpath(fullpath))) | |
| local file = assert(io.open(fullpath, "wb")) | |
| file:write(content) | |
| file:close() | |
| print("Saved " .. filepath) | |
| end | |
| for i = 1, 3 do | |
| local basepath = "Sound/Item/Weapons/Gun/Gun" | |
| SaveFile(("%sFire%02d.ogg"):format(basepath, i)) | |
| SaveFile(("%sLoad%02d.ogg"):format(basepath, i)) | |
| end | |
| SaveFile("tos.html") | |
| SaveFile("DBFilesClient/FileData.dbc") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment