rpcsx/rpcs3/Loader/PUP.h
Cornee Traas 458dbbd15d 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
2017-02-16 10:15:00 +08:00

43 lines
767 B
C++

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