Packfile format for SR4

Discussion in 'Guides and Tutorials' started by [V] Knobby, Jul 31, 2013.

  1. [V] Knobby

    [V] Knobby Volition Staff

    Packfile version is now 10 and the descriptor is still 0x51890ACE.

    Code (Text):

    // header for the packfile itself
    struct v_packfile_file_data {
        et_uint32       descriptor;     // packfile descriptor used to validate data
        et_uint32       version;        // version number of packfile
        et_uint32       header_checksum;    // checksum of the header(after this field)
        et_uint32       file_size;      // physical size (in bytes) of the source vpp file

        et_uint32       flags;          // packfile flags
        et_uint32       num_files;      // number of files in *data section
        et_uint32       dir_size;       // number of bytes in directory section
        et_uint32       filename_size;      // number of bytes in filename section

        et_uint32       data_size;      // number of uncompressed bytes in data files
        et_uint32       compressed_data_size;   // number of compressed bytes in *data section
    };
     
    Code (Text):
    struct v_packfile_entry_file_data {
        char            *filename;
        et_uint32       start;          // offset from start of v_packfile::data (if data is valid)
        et_uint32       size;           // file size
        et_uint32       compressed_size;    // compressed file size
        et_uint16       flags;          // flags for this file
        et_uint16       alignment;      // alignment requirement of this file
    };
     
    Flag data:
    Code (Text):

    // packfile flags
    #define PFF_COMPRESSED      (1<<0)  // packfile data is compressed
    #define PFF_CONDENSED       (1<<1)  // packfile data is run together
                        // NOTE: the data of multiple files is recieved in a single read

    // Packfile entry flags
    #define PFEF_COMPRESSED     (1<<0)  // this file is compressed
     
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice