From e9d24e429765a882cf78bcbe017f91ec7a92adfa Mon Sep 17 00:00:00 2001 From: jakcron Date: Sat, 21 Apr 2018 17:38:26 +0800 Subject: [PATCH] [nx] misc --- lib/libnx/include/nx/pfs.h | 3 ++- lib/libnx/include/nx/romfs.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 lib/libnx/include/nx/romfs.h diff --git a/lib/libnx/include/nx/pfs.h b/lib/libnx/include/nx/pfs.h index d0d79d0..2375d44 100644 --- a/lib/libnx/include/nx/pfs.h +++ b/lib/libnx/include/nx/pfs.h @@ -17,7 +17,8 @@ namespace nx { char signature[4]; le_uint32_t file_num; - le_uint64_t name_table_size; + le_uint32_t name_table_size; + byte_t padding[4]; }; struct sPfsFile diff --git a/lib/libnx/include/nx/romfs.h b/lib/libnx/include/nx/romfs.h new file mode 100644 index 0000000..ab34c01 --- /dev/null +++ b/lib/libnx/include/nx/romfs.h @@ -0,0 +1,35 @@ +#pragma once +#include +#include +#include +#include +#include + +namespace nx +{ + namespace romfs + { + enum HeaderSectionIndex + { + DIR_HASHMAP_TABLE, + DIR_NODE_TABLE, + FILE_HASHMAP_TABLE, + FILE_NODE_TABLE, + + SECTION_NUM + }; + } + +#pragma pack(push,1) + struct sRomfsHeader + { + le_uint64_t header_size; + struct sSection + { + le_uint64_t offset; + le_uint64_t size; + } sections[romfs::SECTION_NUM]; + le_uint64_t data_offset; + }; +#pragma pack(pop) +}