PS3UPDAT.PUP installer (#2386)

* Add PUP loader

* Add .tar loader and update .pup loader

* Add extract method + offset to TAR loader

Also adds error checking + operator bool overload

* Add firmware decryption keys to key vault

* Initial seperation of SELFDecrypter

This seperates SELFDecrypter into itself and SCEDecrypter.
SCEDecrypter contains the logic to decrypt any file with an SCE Header.
SELFDecrypter inherits from SCEDecrypter and contains the code
specifically to do with ELF. DecryptData could be deduplicated more.

* Add "Install Firmware" option to tools menu

* SCEDecrypter: put each segment in own file

Also, const-correctness, adjusted buffer size and better error handling

* More SELFDecrypter refactoring

* Compile fix

* Add messageboxes to firmware install

* Add progress bar to firmware install
This commit is contained in:
Cornee Traas 2017-02-16 03:15:00 +01:00 committed by raven02
parent b1aa87b515
commit 458dbbd15d
11 changed files with 657 additions and 124 deletions

36
rpcs3/Loader/PUP.cpp Normal file
View file

@ -0,0 +1,36 @@
#include "stdafx.h"
#include "PUP.h"
pup_object::pup_object(const fs::file& file): m_file(file)
{
PUPHeader m_header;
m_file.read(m_header);
if (m_header.magic != "SCEUF\0\0\0"_u64)
{
isValid = false;
return;
}
m_file_tbl.resize(m_header.file_count);
m_file.read(m_file_tbl);
m_hash_tbl.resize(m_header.file_count);
m_file.read(m_hash_tbl);
}
fs::file pup_object::get_file(u64 entry_id)
{
if (!isValid) return fs::file();
for (PUPFileEntry file_entry : m_file_tbl)
{
if (file_entry.entry_id == entry_id)
{
std::vector<u8> file_buf(file_entry.data_length);
m_file.seek(file_entry.data_offset);
m_file.read(file_buf, file_entry.data_length);
return fs::make_stream(std::move(file_buf));
}
}
return fs::file();
};