Created
January 4, 2012 07:41
-
-
Save feisuzhu/1558991 to your computer and use it in GitHub Desktop.
妖々剣戟夢想 bgm extractor
This file contains 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
#!/usr/bin/python2 | |
data = open("pack01.pak", "rb").read() | |
occurances = [] | |
next = 0 | |
while True: | |
next = data.find("Xiph.Org libVorbis", next+1) | |
if next == -1: break | |
occurances.append(next-113) | |
print occurances | |
for i, (start, end) in enumerate(zip(occurances, occurances[1:]+[len(data)])): | |
open("%d.ogg" % i, "wb").write(data[start:end]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment