Skip to content

Instantly share code, notes, and snippets.

@feisuzhu
Created January 4, 2012 07:41
Show Gist options
  • Save feisuzhu/1558991 to your computer and use it in GitHub Desktop.
Save feisuzhu/1558991 to your computer and use it in GitHub Desktop.
妖々剣戟夢想 bgm extractor
#!/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