Fix warnings: Remove unused decryption code

This commit is contained in:
Megamouse 2024-02-28 10:26:24 +01:00
parent 75ef154c12
commit 18983f5476
5 changed files with 11 additions and 33 deletions

View file

@ -862,7 +862,7 @@ bool package_reader::fill_data(std::map<std::string, install_entry*>& all_instal
return true;
}
fs::file DecryptEDAT(const fs::file& input, const std::string& input_file_name, int mode, u8 *custom_klic, bool verbose = false);
fs::file DecryptEDAT(const fs::file& input, const std::string& input_file_name, int mode, u8 *custom_klic);
void package_reader::extract_worker(thread_key thread_data_key)
{
@ -947,27 +947,6 @@ void package_reader::extract_worker(thread_key thread_data_key)
{
bool extract_success = true;
auto read_op = [&](usz pos, usz size) -> std::span<const char>
{
if (pos >= entry.file_size)
{
return {};
}
// Because that is the length of the buffer at the moment
const u64 block_size = std::min<u64>(BUF_SIZE, entry.file_size - pos);
const std::span<const char> data_span = decrypt(entry.file_offset + pos, block_size, is_psp ? PKG_AES_KEY2 : m_dec_key.data(), thread_data_key);
if (data_span.size() != block_size)
{
extract_success = false;
pkg_log.error("Failed to extract file %s (data_span.size=%d, block_size=%d)", path, data_span.size(), block_size);
}
return data_span;
};
struct pkg_file_reader : fs::file_base
{
const std::function<u64(u64, void*, u64)> m_read_func;
@ -1128,7 +1107,7 @@ void package_reader::extract_worker(thread_key thread_data_key)
if (is_buffered)
{
final_data = DecryptEDAT(in_data, name, 1, reinterpret_cast<u8*>(&m_header.klicensee), true);
final_data = DecryptEDAT(in_data, name, 1, reinterpret_cast<u8*>(&m_header.klicensee));
}
else
{