#pragma once #include "util/types.hpp" #include "../../Utilities/File.h" #include struct PUPHeader { le_t magic; be_t package_version; be_t image_version; be_t file_count; be_t header_length; be_t data_length; }; struct PUPFileEntry { be_t entry_id; be_t data_offset; be_t data_length; u8 padding[8]; }; struct PUPHashEntry { be_t entry_id; u8 hash[20]; u8 padding[4]; }; class pup_object { const fs::file& m_file; bool isValid = true; std::vector m_file_tbl; std::vector m_hash_tbl; public: pup_object(const fs::file& file); explicit operator bool() const { return isValid; } fs::file get_file(u64 entry_id); bool validate_hashes(); };