#pragma once struct TROPUSRHeader { be_t magic; // 81 8F 54 AD be_t unk1; be_t tables_count; be_t unk2; char reserved[32]; }; struct TROPUSRTableHeader { be_t type; be_t entries_size; be_t unk1; // Seems to be 1 be_t entries_count; be_t offset; be_t reserved; }; struct TROPUSREntry4 { // Entry Header be_t entry_type; // Always 0x4 be_t entry_size; // Always 0x50 be_t entry_id; // Entry ID be_t entry_unk1; // Just zeroes? // Entry Contents be_t trophy_id; // Trophy ID be_t trophy_grade; // This seems interesting be_t unk5; // Seems to be FF FF FF FF char unk6[68]; // Just zeroes? }; struct TROPUSREntry6 { // Entry Header be_t entry_type; // Always 6 be_t entry_size; // Always 0x60 be_t entry_id; // Entry ID be_t entry_unk1; // Just zeroes? // Entry Contents be_t trophy_id; // Trophy ID be_t trophy_state; // Wild guess: 00 00 00 00 = Locked, 00 00 00 01 = Unlocked be_t unk4; // This seems interesting be_t unk5; // Just zeroes? be_t timestamp1; be_t timestamp2; char unk6[64]; // Just zeroes? }; class TROPUSRLoader { fs::file m_file; TROPUSRHeader m_header{}; std::vector m_tableHeaders; std::vector m_table4; std::vector m_table6; virtual bool Generate(const std::string& filepath, const std::string& configpath); virtual bool LoadHeader(); virtual bool LoadTableHeaders(); virtual bool LoadTables(); public: virtual bool Load(const std::string& filepath, const std::string& configpath); virtual bool Save(const std::string& filepath); virtual u32 GetTrophiesCount(); virtual u32 GetTrophyUnlockState(u32 id); virtual u64 GetTrophyTimestamp(u32 id); virtual bool UnlockTrophy(u32 id, u64 timestamp1, u64 timestamp2); };