Sfad extractor

Here it is!

It currently supports only bz2 compression and uncompressed files.

Sfadlib

The source to this release is provided. No executables yet and not all dependant libraries are included in the archive.

Advertisements

~ by ra1ndog on May 28, 2009.

14 Responses to “Sfad extractor”

  1. Hey trying to get your extractor working but running into issues (might be my lack of c++ uberness).

    Can you hit me up via email if you’re interested in helping w/ a project that uses the DF data?

  2. Are you still working on this? The link appears to be dead as well.

  3. Anyway you could put this up on a new link? or perhaps email it to me? Thanks

  4. any way you can rehost this?

  5. Raindog, it would be really great if you could rehost it! A lot of people want DF1 brought back online. Sadly AV has no plans of reviving DF1 and are going all in with DF2 which is, sad to say, an abomination.

    This could be a great starting point for the work needed to write a DF1 server emu!

    Thanks.

    • I understand it would be useful for sure, however, it is a really really easy file format that I’m sure could not possibly be a stumbling block for someone with the skill to implement a full on server.

      • I never said I had to the skill to implement a full on server. Might take me 5 years to get up to speed, but I’ll get it done. Unless somebody does it first.

  6. Ok I’m back. Stupid me didn’t see you had copypasted the sfad extractor python script from that ru site. Gave it a whirl on DF1 and ended up with a whole mess of encrypted files. Some were decrypted, but most were encrypted so I said fuck it and turned my attention to DF2. Made some modifications to the script and boom! Extracted 170k files (30gb), mostly unencrypted. The only things that ARE encrypted seems to be the important stuff like Class files, important xml files and gamelogic scripts are encrypted. I also noticed that all the DF1 files are within DF2’s archives. I’ve decided that a private server is outside my skillset, but there are other things I would like to do with the assets for the DF2 community. You obviously have noticed that AV created a lot of custom file formats:

    SFC = AA BB Tree Collision Scheme
    LVL = Object placement
    SFM = Map of some sort. Possibly normal maps, but there exists normal dds maps within the texture folders so…
    SFA = Animation
    SFAM = Animation Map
    SFVM = Vegetation Map
    SFV = Same as above
    TER = Terrain

    The games meshes are in Directx .X format so its easy to open and convert, but noticed the terrain doesn’t exist in .x but in the .ter files so I’m working on that.

    Also the new GUI is done in Flash, so theres a lot of SWF files and from my experience with AS3 GUI’s for games, there will need to communication between the engine, scripts and the gui and code to facilitate that communication. So I decompiled the swf’s and found some very interesting things. Probably more than I hoped.

    SFFileLoadManager class which manages file loads requested via
    SFFileLoadRequest which has code for requests such as:

    if (this.IsFileLoad)
                {
                    this.req = new URLRequest(this.URL + ":base64");
                    this.FileLoader = new URLLoader();
                    this.FileLoader.addEventListener(Event.COMPLETE, this.loadCompleted);
                    this.FileLoader.dataFormat = URLLoaderDataFormat.TEXT;
                    this.FileLoader.load(this.req);
                }
    

    and then further down the code I found a function loadCompleted
    with this excerpt:

    if (this.IsFileLoad)
                {
                    _loc_2 = SFBase64.decode(String(this.FileLoader.data));
                    this.Manager.fileLoadCompleted(this.URL);
                }
    

    And yes there exists an SFBase64 class which has the following very interesting function code:

    public static function decode(param1:String) : ByteArray
            {
                var _loc_4:* = 0;
                var _loc_5:* = 0;
                var _loc_6:* = 0;
                var _loc_7:* = 0;
                var _loc_8:* = 0;
                var _loc_2:* = new ByteArray();
                var _loc_3:* = 0;
                while (_loc_3 + 4 <= param1.length)
                {
                    
                    _loc_4 = lookupBase64Char(param1.charCodeAt(_loc_3));
                    _loc_5 = lookupBase64Char(param1.charCodeAt((_loc_3 + 1)));
                    _loc_6 = lookupBase64Char(param1.charCodeAt(_loc_3 + 2));
                    _loc_7 = lookupBase64Char(param1.charCodeAt(_loc_3 + 3));
                    if (_loc_4 != -1)
                    {
                        _loc_8 = _loc_4 << 2 | _loc_5 >> 4;
                        _loc_2.writeByte(_loc_8);
                        if (_loc_6 != -1)
                        {
                            _loc_8 = (_loc_5 & 15) << 4 | _loc_6 >> 2;
                            _loc_2.writeByte(_loc_8);
                            if (_loc_7 != -1)
                            {
                                _loc_8 = (_loc_6 & 3) << 6 | _loc_7;
                                _loc_2.writeByte(_loc_8);
                            }
                        }
                    }
                    _loc_3 = _loc_3 + 4;
                }
                _loc_2.endian = Endian.LITTLE_ENDIAN;
                _loc_2.position = 0;
                return _loc_2;
            }// end function
    

    Other classes that I found that look interesting are:

    SFXMLSerializable
    SFXMLSerializer
    SFJ2FWindow

    as well as TON of other classes to do with actual GUI stuff.

    I could of found absolutely nothing, but my experience tells me otherwise. Figured I’d run it by you and see what you thought.

    • Looks like you made good progress.

      Yeah, the new UI is done in flash for sure. decompiling them is fairly trivial as well, but I haven’t analyzed enough of them to modify any of them yet although it would seem to be trivial as well.

      Their design decisions to use C++, Java, and now Flash boggles the mind.

    • Also, hit me up on email, macrohmasheen __ gmail ___

  7. test@gmail.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: