2018-08-07 09:31:06 +00:00
|
|
|
#pragma once
|
2018-04-07 08:03:01 +00:00
|
|
|
#include <fnd/types.h>
|
2018-08-07 08:35:03 +00:00
|
|
|
#include <fnd/sha.h>
|
2018-10-22 13:30:49 +00:00
|
|
|
#include <nn/hac/define/macro.h>
|
2018-04-07 08:03:01 +00:00
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
namespace nn
|
|
|
|
{
|
|
|
|
namespace hac
|
2018-04-07 08:03:01 +00:00
|
|
|
{
|
|
|
|
namespace pfs
|
|
|
|
{
|
2018-06-29 07:10:10 +00:00
|
|
|
static const uint32_t kPfsStructMagic = _MAKE_STRUCT_MAGIC_U32("PFS0");
|
|
|
|
static const uint32_t kHashedPfsStructMagic = _MAKE_STRUCT_MAGIC_U32("HFS0");
|
2018-04-15 02:41:29 +00:00
|
|
|
static const size_t kHeaderAlign = 64;
|
2018-04-07 08:03:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#pragma pack(push,1)
|
|
|
|
struct sPfsHeader
|
|
|
|
{
|
2018-06-26 04:23:40 +00:00
|
|
|
le_uint32_t st_magic;
|
2018-04-07 08:03:01 +00:00
|
|
|
le_uint32_t file_num;
|
2018-04-21 09:38:26 +00:00
|
|
|
le_uint32_t name_table_size;
|
|
|
|
byte_t padding[4];
|
2018-04-07 08:03:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sPfsFile
|
|
|
|
{
|
|
|
|
le_uint64_t data_offset;
|
|
|
|
le_uint64_t size;
|
|
|
|
le_uint32_t name_offset;
|
|
|
|
byte_t padding[4];
|
|
|
|
}; // sizeof(0x18)
|
|
|
|
|
|
|
|
struct sHashedPfsFile
|
|
|
|
{
|
|
|
|
le_uint64_t data_offset;
|
|
|
|
le_uint64_t size;
|
|
|
|
le_uint32_t name_offset;
|
|
|
|
le_uint32_t hash_protected_size;
|
|
|
|
byte_t padding[8];
|
2018-08-07 08:35:03 +00:00
|
|
|
fnd::sha::sSha256Hash hash;
|
2018-04-07 08:03:01 +00:00
|
|
|
}; // sizeof(0x40)
|
|
|
|
#pragma pack(pop)
|
|
|
|
}
|
2018-08-07 07:17:51 +00:00
|
|
|
}
|