Skip to content

Instantly share code, notes, and snippets.

@nike4613
Last active August 7, 2018 19:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nike4613/1b5fd6b7bb5cc5dc94cd to your computer and use it in GitHub Desktop.
Save nike4613/1b5fd6b7bb5cc5dc94cd to your computer and use it in GitHub Desktop.
using namespace std;
bool unpack(char* fc){
int pos = 0;
char[48] name = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
char[4] inta = "\x00\x00\x00\x00";
int intb = 0;
}
f = open("vvvvvvmusic.vvv", 'rb')
fld = f.read()
Files = []
st = end = -1
olst = olend = -1
while True:
st = fld.find("data/",end)+5
end = fld.find("\x00\x00\x00",st)
olst = st
olend = end
print fld[st:end]
end = fld.find("\x01\x01\x01\x01",end)+4
byt = fld[end:fld.find("\x01\x01\x01\x01",end)]
print byt
ibyt=[0,0,0,0]
ibyt[0] = ord(byt[0])-1
ibyt[1] = ord(byt[1])
ibyt[2] = ord(byt[2])
ibyt[3] = ord(byt[3])
num = (ibyt[3])
num = (num << 8) + ibyt[2]
num = (num << 8) + ibyt[1]
num = (num << 8) + ibyt[0]
print num
Files.append({"name":fld[olst:olend],"len":num})
import os
f = open("vvvvvvmusic.vvv", 'rb')
q = f.read()
FILE_NAMES = []
s = e = -1
Os = -1
nul = str(chr(0))
while True:
Os = s
s = q.find("data/",Os+1) + 5
e = q.find(nul, s+1)
if Os >= s:
break
if e == -2:
e = len(q) - 1
FILE_NAMES.append(q[s:e])
startAt = endAt = -1
musStartAt = musEndAt = -1
currentMus = 0
while True:
oldStartAt = startAt
startAt = q.find("OggS", oldStartAt + 1)
endAt = q.find("OggS", startAt + 1) - 1
if oldStartAt >= startAt:
break
if endAt == -2:
endAt = len(q) - 1
sB = ord(q[startAt+5])
if sB == 2:
musStartAt = startAt
elif sB == 4:
musEndAt = endAt
print "Found entire Ogg between",musStartAt,musEndAt
print "Filename: ",FILE_NAMES[currentMus]
if not os.path.exists(os.path.dirname(FILE_NAMES[currentMus])):
os.makedirs(os.path.dirname(FILE_NAMES[currentMus]))
f2 = open(FILE_NAMES[currentMus], 'wb')
f2.write(q[musStartAt:musEndAt])
f2.close()
currentMus += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment