mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 22:47:03 +00:00
Crypto/PKG installer: Fix potential RAM shortage when extracing EDAT files
This commit is contained in:
parent
596e671973
commit
a6c2e995af
5 changed files with 286 additions and 50 deletions
|
|
@ -139,7 +139,16 @@ usz decrypt_binaries_t::decrypt(std::string klic_input)
|
|||
|
||||
if (fs::file new_file{new_path, fs::rewrite})
|
||||
{
|
||||
new_file.write(elf_file.to_string());
|
||||
// 16MB buffer
|
||||
std::vector<u8> buffer(std::min<usz>(elf_file.size(), 1u << 24));
|
||||
|
||||
elf_file.seek(0);
|
||||
|
||||
while (usz read_size = elf_file.read(buffer.data(), buffer.size()))
|
||||
{
|
||||
new_file.write(buffer.data(), read_size);
|
||||
}
|
||||
|
||||
dec_log.success("Decrypted %s -> %s", old_path, new_path);
|
||||
std::cout << "Decrypted " << old_path << " -> " << new_path << std::endl; // For CLI
|
||||
m_index++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue