Home Gallery Resources The Team Rules chat Login Register
Pages:  1 [2] 3 4 5 ... 9
Author Topic: - — File Parsing Boot Camp — - (Some file structures added)  (Read 37111 times)
0 Members and 1 Guest are viewing this topic.
DSX8
Stage/Character Importer
Never Gonna Give You Up
*
Offline Offline

Posts: 9288


meow~

  • Awards Good Citizen >9000 King for a Day Heart Container

  • View Profile Awards
    « Reply #15 on: January 24, 2012, 04:30:39 AM »


    lol TCLL... this is only for helping BJ with PAT0, REFF, the Physics from Havok, and SHP0 data... lol

    but since u have data on REFF... sure give us a hand on that smexy data Wink

    and welcome aboard 404
    Logged

    Follow me on facebook and Twitter!!!
    https://www.facebook.com/DMNSLYRX8              https://twitter.com/Demonslayerx8

    3DS Friend Code: 0705-6436-8834              NNID: Demonslayerx8              PSN: Demonslayerx8



    DarkPikachu
    Angel Kitten
    ***
    Offline Offline

    Posts: 3069


    complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #16 on: January 24, 2012, 04:38:35 AM »


    Homer: ooooooooooohh why can't I share the lime light with Xiggah X(
    lol
    Logged


    Quote: Friedslick6
    you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
    But the coolest part was that you didn't stop working on it despite that.

    Quote: Internet Explorer
    you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

    quote: Greg
    You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

    pikazz
    Heroic Kitten
    **
    Offline Offline

    Posts: 2286


    Machinimator!

  • Awards Renowned Hacker Good Citizen Pin Collector Helping Hand

  • View Profile Awards
    « Reply #17 on: January 24, 2012, 04:55:35 AM »


    okay, here we goes:

    Header:
    0x00 (4) PAT0
    0x04 (4) String Offset Table
    0x08 (4) Version
    0x0C (4) Unknown1
    0x10 (4) Pipeline offset
    0x14 (4) "Texture Reference" (will describe this later)
    0x18 (4) Unknown2, one offset that leading to a emtpy space
    0x1C (4) Unknown3, often the same as Unknown2
    0x20 (4) String Offset Table (Copy)
    0x24 (4) Name of animation Offset
    0x28 (4) Unknown4
    0x2C (2) Frames
    0x2E (2) NumEntries/Materials
    0x30 (2) How many Textures (String Entries1)
    0x32 (2) String Entries 2, often set as "00"
    0x34 (4) Unknown5

    PipeLine:
    0x00 (4) How long PipeLine is
    0x04 (4) How many Entries/IDs
    0x08-1C IDs thingy
    dont exactly know how the ID's working but this is importiant:
    0x20 (4) It's name in String Offset (Pipelines offset + this offset = string offset)
    0x24 (4) "link" offset (Pipeline offset + this offset = "Link" offset)
    and the ID and Stirng/pattern offsets repeat on each entries

    "Link" Offset:
    0x00 (4) String Offset, linked to Materials name
    0x04 (2) What Texture it will using if Flag is set on "7". if the flag is "5" this is set on "00"
    0x06 (2) Flag: 5 using Pattern, 7 is Frozen
    0x08 (4) Pattern Animation Offset (Link Offset + this = Pattern Offset). this is set on "00" if the Flag is set on "7"

    Pattern Animation offset
    0x00 (2) Unknown, possibly flag
    0x02 (2) Unknown
    0x04 (4)  unknown, Possible many flags in "bits"
    0x08 (4) unknown, always(?) set on 00
    0x0C (2) Which Texture will be shown
    0x0E (2) Unknown, always(?) set on 00
    0x10 (2) Which frame and possible with a flag with it (if it saying 41B8, the 4 is a flag and 1B8 is frame)

    Repeat from 0x0C to 0x10 on how many frames

    "Texture refserence" Offset
    here is special and hard to explain, the textures here comes in order thanks by the "link" offset and it's the order the Pattern Animation in their "texture"

    0x00 (4) Offset to their texture name in String Offset

    String Table Offset:
    well, all the names are in here, always in the end of the PAT0s

    This is my work and I have done this in more than a year Im srs here
    « Last Edit: January 24, 2012, 04:59:25 AM by pikazz » Logged

    Stupid Tinypic :C

    Sky Grounder
    Lol Kitten
    *********
    Offline Offline

    Posts: 978


  • Awards Heart Container Tutorial Writer

  • View Profile Awards
    « Reply #18 on: January 24, 2012, 06:23:41 AM »


    I'm aboard, though I will mostly help with stage/SSE files.

    SCLA:
    All stages have a SCLA file, most have an index of MiscData[30].
    Here's the ones that have a different index:

    STGJUNGLE.pac       MiscData[100]
    STGPICTCHAT_xx.pac  MiscData[8]
    STGDXBIGBLUE.pac    MiscData[70]
    STGEDIT_0.pac       MiscData[903]
    STGEDIT_1.pac       MiscData[1903]
    STGEDIT_2.pac       MiscData[2903]
    STGTARGETLV1.pac    MiscData[50]
    STGTARGETLV2.pac    MiscData[50]
    STGTARGETLv3.pac    MiscData[50]
    STGTARGETLv4.pac    MiscData[50]
    STGTARGETLv5.pac    MiscData[50]

    *STGCHARAROLL_xx.pac doesn't have any.

    There's also a SCLA in adventure_common_en.pac (MiscData[0]).

    -----

    The size of all SCLA files are 2832 (0xB10) bytes.

    -----

    Format:

    Header: 0x0F (16 bytes)

    0x00(4) - SCLA
    0x04(4) - # of Entries (Always 0x20 (32))
    0x08(4) - Nulls?
    0x0C(4) - Nulls?

    Offsets (based on # of Entries)
    The offsets come right after the header.
    Each offset is 4 bytes.
    4 * 32 = 128 bytes (0x80)

    After the offsets is the entries.
    Each offset is 0x54 (84) bytes long.

    I still haven't tried to find out what the values
    in the entries do though.

    BLOC:
    BLOC is a file container (like BRRES) that contain other files.
    But way more simple.
    It appears in SSE files.

    Format:

    0x00(4) - BLOC
    0x04(4) - # of entries
    0x08(4) - Unknown
    0x0C(4) - Nulls?

    Offsets (starts at 0x10)
    4 bytes * # of entries = size of string table


    Formats BLOC can contain: GDOR GLOK GET1 GFSR GMOV GMOT GFT2 GENC GEPT GITM etc.
    Logged

    3DS FC: 5370-0958-4818
    Wii U NNID: Doraleus

    Spex130
    Holy Kitten
    *
    Offline Offline

    Posts: 1958


    So very Spexcellent.

  • Awards Super Saiyan Topic Starstormer Hyperactive Contributor Renowned Hacker

  • View Profile Awards
    « Reply #19 on: January 24, 2012, 09:29:52 AM »


    Holy crap. This thread actually went and happened. Wonderful!

    I still need to know how I can help, though.

    Edit: Ah. Nevermind. Found the tutorial.
    « Last Edit: January 24, 2012, 09:30:56 AM by Spex130 » Logged


    Xiggah
    Supreme Kitten
    ********
    Offline Offline

    Posts: 648

  • Awards Super Saiyan Topic Heart Container

  • View Profile WWW Awards
    « Reply #20 on: January 24, 2012, 01:22:30 PM »


    Holy crap. This thread actually went and happened. Wonderful!

    I still need to know how I can help, though.

    Edit: Ah. Nevermind. Found the tutorial.

    Don't worry, I'll up and make more tutorials as soon as I find the best way to identify structures myself... gotta find those old posts explaining these things.

    Also, I'll try to include brief explanations of each file type so people can easily take an interest to different filetypes.
    Logged


    DSX8
    Stage/Character Importer
    Never Gonna Give You Up
    *
    Offline Offline

    Posts: 9288


    meow~

  • Awards Good Citizen >9000 King for a Day Heart Container

  • View Profile Awards
    « Reply #21 on: January 24, 2012, 02:14:32 PM »


    hmm wat else could i take a good look into.... i guess ill look back into SCN0 data
    Logged

    Follow me on facebook and Twitter!!!
    https://www.facebook.com/DMNSLYRX8              https://twitter.com/Demonslayerx8

    3DS Friend Code: 0705-6436-8834              NNID: Demonslayerx8              PSN: Demonslayerx8



    Xiggah
    Supreme Kitten
    ********
    Offline Offline

    Posts: 648

  • Awards Super Saiyan Topic Heart Container

  • View Profile WWW Awards
    « Reply #22 on: January 24, 2012, 02:18:31 PM »


    SCN0 data is a good example. We should put together all of the undefined files that have looked into so far. Now where did all those file definitions run off too...

    EDIT: Skygrounder, where did you find those file types anyways?
    « Last Edit: January 24, 2012, 02:24:10 PM by Xiggah » Logged


    Sky Grounder
    Lol Kitten
    *********
    Offline Offline

    Posts: 978


  • Awards Heart Container Tutorial Writer

  • View Profile Awards
    « Reply #23 on: January 24, 2012, 03:55:22 PM »


    SCN0 data is a good example. We should put together all of the undefined files that have looked into so far. Now where did all those file definitions run off too...

    EDIT: Skygrounder, where did you find those file types anyways?
    The SCLA file is found within every stage file, it's just never been talked about. (I don't know what purpose it serves though.)
    As for the BLOC, it's found within SSE stages, and contain formats such as the ones I listed in the previous post (which might have something to do with auto-movement, doors, itemboxes, hitboxes, etc.
    Logged

    3DS FC: 5370-0958-4818
    Wii U NNID: Doraleus

    BlackJax96
    Brawl Mod God
    Moderator
    ****
    Offline Offline

    Posts: 4612


  • Awards KCMM Veteran Sniper King for a Day Featured

  • View Profile Awards
    « Reply #24 on: January 24, 2012, 03:55:53 PM »


    I guess you could say I'm a part of this by default.
    I'm just gonna post my stuff in C# code... no point reformatting it.

    Btw, please don't call the Resource Group "Pipelines" >.>
    Really, "relocation table" or "resource group" is a much better name for it...
    We have to use like terms.

    PAT0 parsing and rebuilding is done.
    The only thing that needs to be fully figured out is the secondary flags. Im srs here
    I need to update Bero's code so it works better.

    Anway, SHP0:
    unsafe struct SHP0
        {
            public BRESCommonHeader _header;
            public bint _dataOffset;
            public bint _stringListOffset; //List of vertex node strings
            public bint _stringOffset;
            public bint _unk1; //0
            public bshort _numFrames;
            public bshort _numEntries;
            public bint _unk2; //0x00, 0x01

    unsafe struct SHP0Entry
        {
            public bint _numEntries; //entries + 1 index part
            public bint _stringOffset;
            public bint _numIndices;
            public bint _unk;
            public bint _indiciesOffset;

    I'm pretty sure the keyframes are I12 Keyframe Entries except with no frame scale.

        public unsafe struct I12Header
        {
            public bushort _numFrames;
            public bushort _unk;
            public bfloat _frameScale; //This is the value that isn't present in SHP0

    public unsafe struct I12Entry
        {
            public bfloat _index;
            public bfloat _value;
            public bfloat _tangent;

    Also, REFF definitely controls REFT images. It's not SRT0 but REFF that makes some of the images go together like a GIF. (like animated fire or a spinning coin)

    Havok Physics:
    public unsafe struct PhysicsHeader
        {
            public const uint Tag1 = 0x57E0E057;
            public const uint Tag2 = 0x10C0C010;

            public uint _tag1; //0x57E0E057
            public uint _tag2; //0x10C0C010
            public bint _unk2; //0
            public bint _unk3; //4

            public byte _unk4; //4
            public bshort _unk5; //1
            public byte _unk6; //1
            public bint _unk7; //3
            public bint _unk8; //1
            public bint _unk9; //0

            public bint _unk10; //0
            public buint _unk11; //Size/Offset

            //Three sections of offsets:
            //__classnames__
            //__data__
            //__types__

            public OffsetSection ClassNames;
            public OffsetSection Data;
            public OffsetSection Types;

            public String Name { get { return new String((sbyte*)Address + 0x28); } }
            
            public VoidPtr ClassNamesData { get { return Address + *(buint*)(Address + 0x54); } }
            public VoidPtr DataData { get { return Address + *(buint*)(Address + 0x84); } }
            public VoidPtr TypesData { get { return Address + *(buint*)(Address + 0xB4); } }
    }

    public unsafe struct OffsetSection
        {
            public fixed byte name[0x10];

            public bint _unk0; //-1
            public buint _dataOffset; //Main header is the base
            
            //Offsets to indices struct. _dataOffset is the base for everything.
            public buint _dataOffset1;
            public buint _dataOffset2;
            public buint _dataOffset3;
            public buint _dataOffset4;
            public buint _dataOffset5;
            public buint _dataOffset6;

            //When offsets begin to repeat, stop reading
            //Indices count is ((next data offset) - (current data offset)) / 2
            //Indices are padded to 0x10 with 0xFF

            public String Name { get { return new String((sbyte*)Address); } }
        }

    public unsafe struct IndexGroup
        {
            //Base is the offset sections's _dataOffset
            //Still not sure exactly how these are used, but they're definitely a datalength or offset
            
            public buint _dataOffset; //Not necessarily...
            public buint _stringOffset; //Not necessarily...

    Also, SCN0 is almost rebuildable. I finished STPM too.
    SCN0 definitely needs more research, especially since it has a frame count. Im srs here
    Logged

    Sky Grounder
    Lol Kitten
    *********
    Offline Offline

    Posts: 978


  • Awards Heart Container Tutorial Writer

  • View Profile Awards
    « Reply #25 on: January 24, 2012, 04:06:49 PM »


    While we're talking about SCN0 + frames, I tried to port a SSE stage to final destination some time ago, and the result of the SceneData was that it kept shifting between light and dark.
    I *think* this was the file:
    http://www.mediafire.com/?6e0nwrebfid5hv2
    Logged

    3DS FC: 5370-0958-4818
    Wii U NNID: Doraleus

    Spex130
    Holy Kitten
    *
    Offline Offline

    Posts: 1958


    So very Spexcellent.

  • Awards Super Saiyan Topic Starstormer Hyperactive Contributor Renowned Hacker

  • View Profile Awards
    « Reply #26 on: January 24, 2012, 04:18:56 PM »


    Does that animation count have anything to do with the lighting system on Battlefield?
    Logged


    DSX8
    Stage/Character Importer
    Never Gonna Give You Up
    *
    Offline Offline

    Posts: 9288


    meow~

  • Awards Good Citizen >9000 King for a Day Heart Container

  • View Profile Awards
    « Reply #27 on: January 24, 2012, 04:23:01 PM »


    Does that animation count have anything to do with the lighting system on Battlefield?
    yes it does... battlefields lighting has a framecount of 10800
    Logged

    Follow me on facebook and Twitter!!!
    https://www.facebook.com/DMNSLYRX8              https://twitter.com/Demonslayerx8

    3DS Friend Code: 0705-6436-8834              NNID: Demonslayerx8              PSN: Demonslayerx8



    Xiggah
    Supreme Kitten
    ********
    Offline Offline

    Posts: 648

  • Awards Super Saiyan Topic Heart Container

  • View Profile WWW Awards
    « Reply #28 on: January 24, 2012, 04:42:03 PM »


    yes it does... battlefields lighting has a framecount of 10800
    Framecount of 10800, going off of memory here isn't that the same framecount for Battlefields stage animation? Seems like a typical light animation to me.

    Anyways, I'll be adding the file structs to the first post.
    Logged


    SonicBrawler
    Magical Girl
    Overlord Kitten
    ******
    Offline Offline

    Posts: 6977


    Bae

  • Awards Star Hacker Active Contributor Renowned Hacker Heart Container

  • View Profile WWW Awards
    « Reply #29 on: January 24, 2012, 04:48:34 PM »


    I will keep an eye on this...
    Logged

    Quotes:
    Not all people have the luxury of being able to buy things whenever they want.

    Some people are barely scraping by in the economy.
    Modding has made you guys so spoiled.

    Pages:  1 [2] 3 4 5 ... 9
    Print
    Jump to: