XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Thu Sep 20, 2018 3:14 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Maplestory 2
PostPosted: Sun May 27, 2018 3:33 am 
Offline
beginner
User avatar

Joined: Thu Dec 23, 2010 9:49 am
Posts: 29
Has thanked: 6 times
Have thanks: 16 times

Nif models are able to be opened and exportedin Noesis.
Image
Image

Image
Image

Image

You can make the ads go away by registering


_________________
Aka Wunkolo


Top
 Profile  
 
 Post subject: Re: Maplestory 2
PostPosted: Wed May 30, 2018 7:17 pm 
Offline
beginner
User avatar

Joined: Thu Dec 23, 2010 9:49 am
Posts: 29
Has thanked: 6 times
Have thanks: 16 times
Put all my code up on github.

Includes an expander and a flattener and works for all four file PackStream versions, including the elusive OS2F/PS2F.

https://github.com/Wunkolo/Maple2Tools

For reader's sake here's all the mapped out structures:

Code:
struct PackStreamVer1 // MS2F
{
public:
   std::uint32_t Pad;                    // Always zero

   std::uint64_t FATCompressedSize;      // DEFLATE length
   std::uint64_t FATEncodedSize;         // Base64 length

   std::uint64_t FileListSize;           // Uncompressed size
   std::uint64_t FileListCompressedSize; // DEFLATE length
   std::uint64_t FileListEncodedSize;    // Base64 length

   std::uint64_t TotalFiles;             // Total Files
   std::uint64_t FATSize;                // Uncompressed size
};
static_assert(
   sizeof(PackStreamVer1) == 0x3C,
   "sizeof(PackStreamVer1) != 0x3C"
);

struct PackStreamVer2 // NS2F
{
public:
   std::uint32_t TotalFiles;             // Total Files

   std::uint64_t FATCompressedSize;      // DEFLATE length
   std::uint64_t FATEncodedSize;         // Base64 length
   std::uint64_t FATSize;                // Uncompressed size

   std::uint64_t FileListCompressedSize; // DEFLATE length
   std::uint64_t FileListEncodedSize;    // Base64 length
   std::uint64_t FileListSize;           // Uncompressed size
};
static_assert(
   sizeof(PackStreamVer2) == 0x34,
   "sizeof(PackStreamVer2) != 0x34"
);

struct PackStreamVer3 // OS2F/PS2F
{
   std::uint32_t TotalFiles;             // Total Files
   std::uint32_t Pad;                    // Always Zero

   std::uint64_t FATCompressedSize;      // DEFLATE length
   std::uint64_t FATEncodedSize;         // Base64 length

   std::uint64_t FileListCompressedSize; // DEFLATE length
   std::uint64_t FileListEncodedSize;    // Base64 length
   std::uint64_t FileListSize;           // Uncompressed size

   std::uint64_t FATSize;                // Uncompressed size
};
static_assert(
   sizeof(PackStreamVer3) == 0x38,
   "sizeof(PackStreamVer3) != 0x38"
);

// Haven't verified these myself.
enum class CompressionType : std::uint32_t
{
   Deflate = 0xEE000009,
   Png     = 0xEE000000,
   Usm     = 0xFF000000
};

struct PackFileHeaderVer1 // MS2f
{
public:
   std::uint32_t Pad1;
   std::uint32_t FileIndex;
   CompressionType Compression;
   std::uint32_t Pad2;
   std::uint64_t Offset;
   std::uint64_t EncodedSize;
   std::uint64_t CompressedSize;
   std::uint64_t Size;
};
static_assert(
   sizeof(PackFileHeaderVer1) == 0x30,
   "sizeof(PackFileHeaderVer1) != 0x30"
);

struct PackFileHeaderVer2 // NS2F
{
public:
   CompressionType Compression;
   std::uint32_t FileIndex;
   std::uint32_t EncodedSize;
   std::uint64_t CompressedSize;
   std::uint64_t Size;
   std::uint64_t Offset;
};
static_assert(
   sizeof(PackFileHeaderVer2) == 0x24,
   "sizeof(PackFileHeaderVer2) != 0x24"
);

struct PackFileHeaderVer3 // OS2F/PS2F
{
public:
   CompressionType Compression;
   std::uint32_t FileIndex;
   std::uint32_t EncodedSize;
   std::uint32_t Pad;
   std::uint64_t CompressedSize;
   std::uint64_t Size;
   std::uint64_t Offset;
};
static_assert(
   sizeof(PackFileHeaderVer3) == 0x28,
   "sizeof(PackFileHeaderVer3) != 0x28"
);



_________________
Aka Wunkolo


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: Majestic-12 [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group