Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # code.grv extractor for YinYangYo Comic Book of Dread
- input_file = open("code.grv","rb")
- head_pos = 0x19
- wrk = True
- while wrk:
- input_file.seek(head_pos)
- a = (ord(input_file.read(1))&0xFF) << 24
- b = (ord(input_file.read(1))&0xFF) << 16
- c = (ord(input_file.read(1))&0xFF) << 8
- d = ord(input_file.read(1))&0xFF
- FILE_POS = a|b|c|d
- a = (ord(input_file.read(1))&0xFF) << 24
- b = (ord(input_file.read(1))&0xFF) << 16
- c = (ord(input_file.read(1))&0xFF) << 8
- d = ord(input_file.read(1))&0xFF
- FILE_SIZE = a|b|c|d
- head_pos += 8
- a = []
- b = True
- while b:
- c = (ord(input_file.read(1))&0xFF)
- if c == 0:
- b = False
- head_pos += 5
- else:
- a.append(c)
- head_pos += 1
- a = bytes(a)
- output_file = open("output/"+a.decode("ascii"),"wb")
- input_file.seek(FILE_POS)
- a = input_file.read(FILE_SIZE)
- output_file.write(a)
- output_file.close()
- print(hex(head_pos))
- #wrk = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement