mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-23 17:10:51 +01:00
* 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
40 lines
869 B
C++
40 lines
869 B
C++
#pragma once
|
|
|
|
#include <map>
|
|
|
|
typedef struct {
|
|
char name[100];
|
|
char dontcare[24];
|
|
char size[12];
|
|
char mtime[12];
|
|
char chksum[8];
|
|
char filetype;
|
|
char linkname[100];
|
|
char magic[6];
|
|
char dontcare2[82];
|
|
char prefix[155];
|
|
char padding[12];
|
|
} TARHeader;
|
|
|
|
class tar_object
|
|
{
|
|
const fs::file& m_file;
|
|
|
|
int initial_offset;
|
|
int largest_offset; //we store the largest offset so we can continue to scan from there.
|
|
std::map<std::string, u64> m_map; //maps path to offset of header of that file, so we only need to scan the entire file once.
|
|
bool isValid = true;
|
|
|
|
TARHeader read_header(u64 offset);
|
|
|
|
public:
|
|
tar_object(const fs::file& file, size_t offset = 0);
|
|
|
|
operator bool() const { return isValid; };
|
|
|
|
std::vector<std::string> get_filenames();
|
|
|
|
fs::file get_file(std::string path);
|
|
|
|
bool extract(std::string path); // extract all files in archive to path
|
|
}; |