unself: rename AppInfo to program_identification_header

This commit is contained in:
Megamouse 2023-04-19 20:27:01 +02:00
parent e171f3af41
commit a770eaf500
4 changed files with 24 additions and 24 deletions

View File

@ -192,21 +192,21 @@ void WriteShdr(const fs::file& f, Elf32_Shdr& shdr)
}
void AppInfo::Load(const fs::file& f)
void program_identification_header::Load(const fs::file& f)
{
authid = Read64(f);
vendor_id = Read32(f);
self_type = Read32(f);
version = Read64(f);
program_authority_id = Read64(f);
program_vendor_id = Read32(f);
program_type = Read32(f);
program_sceversion = Read64(f);
padding = Read64(f);
}
void AppInfo::Show() const
void program_identification_header::Show() const
{
self_log.notice("AuthID: 0x%llx", authid);
self_log.notice("VendorID: 0x%08x", vendor_id);
self_log.notice("SELF type: 0x%08x", self_type);
self_log.notice("Version: 0x%llx", version);
self_log.notice("AuthID: 0x%llx", program_authority_id);
self_log.notice("VendorID: 0x%08x", program_vendor_id);
self_log.notice("SELF type: 0x%08x", program_type);
self_log.notice("Version: 0x%llx", program_sceversion);
}
void SectionInfo::Load(const fs::file& f)
@ -888,11 +888,11 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info)
// Read the APP INFO.
self_f.seek(m_ext_hdr.program_identification_hdr_offset);
app_info.Load(self_f);
m_prog_id_hdr.Load(self_f);
if (out_info)
{
out_info->app_info = app_info;
out_info->prog_id_hdr = m_prog_id_hdr;
}
// Read ELF header.
@ -1027,7 +1027,7 @@ void SELFDecrypter::ShowHeaders(bool isElf32)
self_log.notice("----------------------------------------------------");
self_log.notice("APP INFO");
self_log.notice("----------------------------------------------------");
app_info.Show();
m_prog_id_hdr.Show();
self_log.notice("----------------------------------------------------");
self_log.notice("ELF header");
self_log.notice("----------------------------------------------------");
@ -1150,7 +1150,7 @@ bool SELFDecrypter::LoadMetadata(u8* klic_key)
self_f.read(metadata_headers.get(), metadata_headers_size);
// Find the right keyset from the key vault.
SELF_KEY keyset = key_v.FindSelfKey(app_info.self_type, sce_hdr.se_flags, app_info.version);
SELF_KEY keyset = key_v.FindSelfKey(m_prog_id_hdr.program_type, sce_hdr.se_flags, m_prog_id_hdr.program_sceversion);
// Set klic if given
if (klic_key)

View File

@ -11,12 +11,12 @@
LOG_CHANNEL(self_log, "SELF");
struct AppInfo
struct program_identification_header
{
u64 authid;
u32 vendor_id;
u32 self_type;
u64 version;
u64 program_authority_id;
u32 program_vendor_id;
u32 program_type;
u64 program_sceversion;
u64 padding;
void Load(const fs::file& f);
@ -338,7 +338,7 @@ struct SelfAdditionalInfo
{
bool valid = false;
std::vector<ControlInfo> ctrl_info;
AppInfo app_info;
program_identification_header prog_id_hdr;
};
class SCEDecrypter
@ -377,7 +377,7 @@ class SELFDecrypter
// SCE, SELF and APP headers.
SceHeader sce_hdr{};
ext_hdr m_ext_hdr{};
AppInfo app_info{};
program_identification_header m_prog_id_hdr{};
// ELF64 header and program header/section header arrays.
Elf64_Ehdr elf64_hdr{};

View File

@ -1925,7 +1925,7 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar)
}
ppu_loader.notice("SELF header information found: ctrl_flags1=0x%x, authid=0x%llx",
g_ps3_process_info.ctrl_flags1, g_ps3_process_info.self_info.app_info.authid);
g_ps3_process_info.ctrl_flags1, g_ps3_process_info.self_info.prog_id_hdr.program_authority_id);
}
// Load other programs

View File

@ -83,7 +83,7 @@ error_code sys_ss_access_control_engine(u64 pkg_id, u64 a2, u64 a3)
sys_ss.todo("sys_ss_access_control_engine(pkg_id=0x%llx, a2=0x%llx, a3=0x%llx)", pkg_id, a2, a3);
const u64 authid = g_ps3_process_info.self_info.valid ?
g_ps3_process_info.self_info.app_info.authid : 0;
g_ps3_process_info.self_info.prog_id_hdr.program_authority_id : 0;
switch (pkg_id)
{