Jump to content

Moorhuhn Winter Edition .dat archive


MaxBOOST
Go to solution Solved by LinkOFF,

Recommended Posts

  • Engineer
  • Solution
import struct
import io
import os

class Entry:
    def __init__(self, f):
        self.filepath = str(f.read(48), 'utf-8').strip('\0')
        self.offset, self.size, self.pad1, self.pad2 = struct.unpack('4i', f.read(16))

def extract(file):
    f = open(file, 'rb')
    sign = str(f.read(48)).strip('\0')
    datastart, unk1, unk2, unk3 = struct.unpack('4i', f.read(16))
    entries = []
    while(True):
        check = f.read(4)
        if check == b'\x2A'*4:
            break
        f.seek(-4, io.SEEK_CUR)
        entries.append(Entry(f))
    for entry in entries:
        print('Extracting: %s' % entry.filepath)
        f.seek(entry.offset)
        data = f.read(entry.size)
        dirname = os.path.dirname(entry.filepath)
        if not os.path.exists(dirname):
            os.makedirs(dirname)
        r = open(entry.filepath, 'wb')
        r.write(data)
        r.close()
    f.close()
    
extract('moorhuhnwinter.dat')

You can extract the archive with that python script

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...