Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libpietendo v0.6.0 Release #15

Merged
merged 7 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = libpietendo
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v0.5.0
PROJECT_NUMBER = v0.6.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
12 changes: 11 additions & 1 deletion include/pietendo/ctr/cci.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,20 @@ struct NcsdCommonHeader

struct GameCardExtendedHeader
{
struct CryptoType
{
byte_t enabled : 1;
byte_t value : 2;
byte_t reserved : 5;
};

// 0x90
std::array<tc::bn::le64<uint64_t>, kPartitionNum> partition_id;
// 0xD0
tc::bn::pad<0x30> reserved;
tc::bn::pad<0x2E> reserved;
// 0xFE
CryptoType crypto_type;
byte_t backup_security_version;
};

struct NandExtendedHeader
Expand Down
2 changes: 1 addition & 1 deletion src/ctr/ExeFsSnapshotGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pie::ctr::ExeFsSnapshotGenerator::ExeFsSnapshotGenerator(const std::shared_ptr<t
stream->seek(0, tc::io::SeekOrigin::Begin);
stream->read((byte_t*)(&hdr), sizeof(pie::ctr::ExeFsHeader));

if (hdr.file_table[0].name[0] == 0 || hdr.file_table[0].offset.unwrap() != 0 || hdr.hash_table[pie::ctr::ExeFsHeader::kFileNum - 1][0] == 0)
if (hdr.file_table[0].name[0] == 0 || hdr.file_table[0].offset.unwrap() != 0)
{
throw tc::ArgumentOutOfRangeException("pie::ctr::ExeFsSnapshotGenerator", "ExeFsHeader is corrupted (Bad first entry).");
}
Expand Down
4 changes: 2 additions & 2 deletions src/hac/NsoHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ void pie::hac::NsoHeader::fromBytes(const byte_t* data, size_t len)
mDataSegmentInfo.file_layout.size = hdr->data_file_size.unwrap();
mDataSegmentInfo.memory_layout.offset = hdr->data.memory_offset.unwrap();
mDataSegmentInfo.memory_layout.size = hdr->data.size.unwrap();
mDataSegmentInfo.is_compressed = hdr->flags.test((size_t)nso::HeaderFlags_RoCompress);
mDataSegmentInfo.is_hashed = hdr->flags.test((size_t)nso::HeaderFlags_RoHash);
mDataSegmentInfo.is_compressed = hdr->flags.test((size_t)nso::HeaderFlags_DataCompress);
mDataSegmentInfo.is_hashed = hdr->flags.test((size_t)nso::HeaderFlags_DataHash);
mDataSegmentInfo.hash = hdr->data_hash;

mModuleNameInfo.offset = hdr->module_name_offset.unwrap();
Expand Down