mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-29 23:41:19 -06:00
- Added a trophy viewer (right click on game ==> trophy viewer) - Enabled Run button. - Switched gui settings to toml. - Added recent files (6 max) - Applied @raphaelthegreat suggestions and corrections (Thanks a lot). - Fixed several bugs and crashes. - Full screen should disabled by default. - Added region in list mode. - Added a simple temp elf list widget. - Added messages when extracting pkg (ex: installing a patch before the game...etc)
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <vector>
|
|
#include "common/endian.h"
|
|
#include "common/io_file.h"
|
|
#include "common/types.h"
|
|
#include "core/crypto/crypto.h"
|
|
|
|
struct TrpHeader {
|
|
u32_be magic; // (0xDCA24D00)
|
|
u32_be version;
|
|
u64_be file_size; // size of full trp file
|
|
u32_be entry_num; // num entries
|
|
u32_be entry_size; // size of entry
|
|
u32_be dev_flag; // 1: dev
|
|
unsigned char digest[20]; // sha1 hash
|
|
u32_be key_index; // 3031300?
|
|
unsigned char padding[44];
|
|
};
|
|
|
|
struct TrpEntry {
|
|
char entry_name[32];
|
|
u64_be entry_pos;
|
|
u64_be entry_len;
|
|
u32_be flag; // 3 = CONFIG/ESFM , 0 = PNG
|
|
unsigned char padding[12];
|
|
};
|
|
|
|
class TRP {
|
|
public:
|
|
TRP();
|
|
~TRP();
|
|
bool Extract(std::filesystem::path trophyPath);
|
|
void GetNPcommID(std::filesystem::path trophyPath, int index);
|
|
|
|
private:
|
|
Crypto crypto;
|
|
std::vector<u8> NPcommID = std::vector<u8>(12);
|
|
std::array<u8, 16> np_comm_id{};
|
|
std::array<u8, 16> esfmIv{};
|
|
std::filesystem::path trpFilesPath;
|
|
static constexpr int iv_len = 16;
|
|
}; |