Initial D Arcade Stage 6AA *.xaf

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
black_racer
Posts: 22
Joined: Thu Jun 04, 2015 1:05 pm

Initial D Arcade Stage 6AA *.xaf

Post by black_racer »

Hello)).
I need your help again, this is the archive from Initial D Arcade Stage 6AA. It has a folders and file structure within itself, help me find a way to look at it?

Example *.xaf file:
https://www.dropbox.com/s/xrrawtxh45fzp ... A.xaf?dl=0
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Initial D Arcade Stage 6AA *.xaf

Post by aluigi »

Unfortunately it's an unknown compression algorithm (magic is "YS" followed by 02 00) so the script is totally useless:
http://aluigi.org/bms/initial_d_xaf.bms
black_racer
Posts: 22
Joined: Thu Jun 04, 2015 1:05 pm

Re: Initial D Arcade Stage 6AA *.xaf

Post by black_racer »

This is bad news for me, I will look for a way to decompress

It seems that there is Unpacker but I can not compile it ...

https://github.com/refint/assamUnpack
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Initial D Arcade Stage 6AA *.xaf

Post by aluigi »

That tool does not decompress the file so it's totally useless
skys215
Posts: 1
Joined: Sat Dec 23, 2017 3:03 pm

Re: Initial D Arcade Stage 6AA *.xaf

Post by skys215 »

I recently unpack the .xaf file according to a fork of the above-mentioned repo: https://github.com/neos7/assamUnpack.
Since I don't have C# environment and I don't want to install it, I rewrote with python.

Code: Select all

import os
import struct

basePath = "E:\\MyDocuments\\initiald6\\" #the path to place unpacked files

f = open("G:\\Games\\Initial D 6AA\\data\\COURSE.xaf","rb") # the xaf file
fileLists = []
class fileinfo(object):
    name = ''
    isFile = ''
    parent = ''
    nextSibling = ''
    firstChild = ''
    unknown1 = ''
    length = ''
    unknown2 = ''
    blockOffset = ''
    unknown3 = ''
    """docstring for fileinfo"""
    def __init__(self, arg):
        super(fileinfo, self).__init__()
        self.name = arg['name']
        self.isFile = arg['isFile']
        self.parent = arg['parent']
        self.nextSibling = arg['nextSibling']
        self.firstChild = arg['firstChild']
        self.unknown1 = arg['unknown1']
        self.length = arg['length']
        self.unknown2 = arg['unknown2']
        self.blockOffset = arg['blockOffset']
        self.unknown3 = arg['unknown3']
    def __str__(self):
        return str(self.name)

try:
    header_descripter,header_version,header_alignment,header_numFiles,header_unknown1,header_title,header_author,header_unknown2 = struct.unpack('4siii32s64s64s80s', f.read(256))

    for i in range(0,header_numFiles):
        file = {}
        file['name'],file['isFile'],file['parent'],file['nextSibling'],file['firstChild'],file['unknown1'],file['length'],file['unknown2'],file['blockOffset'],file['unknown3'] = struct.unpack('128siiii8si4si12s',f.read(176))

        fileLists.append( fileinfo(file) )

    for i in range(0, header_numFiles):
        filepath = ''
        if(int(fileLists[i].isFile) != 0):
            p = i
            filepath = "\\" + fileLists[p].name.rstrip(b'\x00').decode('utf-8') + filepath #should use os.path to join parentFolder for different os compability
            p = int(fileLists[p].parent)
            while(p!=-1): #since python has no do...while structure, need do the same thing before while structure
                filepath = "\\" + fileLists[p].name.rstrip(b'\x00').decode('utf-8') + filepath
                p = int(fileLists[p].parent)
            filepath = basePath + filepath

            if os.path.isdir(os.path.dirname(filepath)) == False:
                try:
                    os.makedirs(os.path.dirname(filepath))
                except OSError as exc:  # Python >2.5
                    if exc.errno == errno.EEXIST and os.path.isdir(filepath):
                        pass
                    else:
                        raise
            fileOffset = fileLists[i].blockOffset * header_alignment
            f.seek(fileOffset)
            content = f.read(fileLists[i].length)
            try:
                n = open(filepath,'wb')
                n.write(content)
            finally:
                n.close()
finally:
    f.close()



One strange thing is, there's some .ini file in the package, but after extract, it has the YS header as file descriptor, which it is the file descriptor of .efo file.
Though I've got the .efo file, but I have no experience with 3d modeling.
So I have completly no idea how to open this file.