Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import struct, sys, os
- with open ("main.hal", 'rb') as hal:
- if not hal.read(4) == b'APUK':
- input("invalid file")
- sys.exit()
- os.makedirs("main")
- nument = struct.unpack('<L24x', hal.read(28))[0]
- entries = []
- for i in range(nument):
- entries.append(struct.unpack('<2L8x48s', hal.read(64)))
- for entry in entries:
- hal.seek(entry[1])
- content = hal.read(entry[0])
- name = entry[2].split(b'\00')[0].decode('ascii')
- with open ("main/"+name, 'wb') as output:
- output.write(content)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement