Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _PKG_H_
- #define _PKG_H_
- #include "libcore/types.h"
- typedef struct pkg_generation {
- uint32_t export_count;
- uint32_t name_count;
- uint32_t netobject_count;
- } pkg_generation_t;
- typedef struct pkg_compressed_chunk_block {
- uint32_t compressed_size;
- uint32_t uncompressed_size;
- } pkg_compressed_chunk_block_t;
- typedef struct pkg_compressed_chunk {
- // chunk description
- uint32_t uncompressed_offset;
- uint32_t uncompressed_size;
- uint32_t compressed_size;
- uint32_t compressed_offset;
- // chunk header
- uint32_t magic;
- uint32_t maxblocksize;
- uint32_t compressed_size2;
- uint32_t uncompressed_size2;
- // chunk blocks
- uint32_t nblocks;
- pkg_compressed_chunk_block_t *blocks;
- } pkg_compressed_chunk_t;
- typedef struct pkg {
- uint16_t version;
- uint16_t licensee;
- uint32_t unkf0;
- int32_t dirnamelen;
- uint8_t *dirname;
- uint32_t flags;
- // read if (flags & 8)
- uint32_t unkf1;
- uint32_t name_count;
- uint32_t name_offset;
- uint32_t export_count;
- uint32_t export_offset;
- uint32_t import_count;
- uint32_t import_offset;
- uint32_t unkf2;
- // read if version >= 623
- uint32_t unkf3;
- uint32_t unkf4;
- uint32_t unkf5;
- // read if version >= 584
- uint32_t unkf6;
- // guid
- uint32_t g0, g1, g2, g3;
- uint32_t ngenerations;
- pkg_generation_t *generations;
- uint32_t enginever;
- uint32_t cookerver;
- // read if 0 < licensee < 0x88
- uint32_t unkf7;
- // read if licensee > 0
- uint32_t unkf8;
- uint32_t unkf9;
- // read if 0 < licensee < 0x88
- uint32_t unkf10;
- uint32_t unkf11;
- // compression info
- uint32_t compression_flags;
- uint32_t ncompressed_chunks;
- pkg_compressed_chunk_t *compressed_chunks;
- uint32_t unkf12;
- // read if 0 <= licensee < 0x88
- uint32_t unkf13;
- } pkg_t;
- typedef enum {
- PKG_E_OK = 0,
- } pkg_error_t;
- pkg_error_t pkg_create(uint8_t *data, uint32_t size, pkg_t **pkgp);
- void pkg_destroy(pkg_t *pkg);
- #endif /* _PKG_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement