[extractor] Fix ISO extraction bug. (#3937)

Fix bug where files starting past 2^32 bytes were not extracted
correctly.

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
water111
2025-06-01 21:15:48 -04:00
committed by GitHub
parent 653604080f
commit c87469cf97
2 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -79,7 +79,7 @@ void add_from_dir(FILE* fp, u32 sector, u32 size, IsoFile::Entry* parent) {
} else {
entry.name.pop_back();
entry.name.pop_back();
entry.offset_in_file = SECTOR_SIZE * extent;
entry.offset_in_file = (u64)SECTOR_SIZE * (u64)extent;
entry.size = dir_or_file_size;
}
}
@@ -100,7 +100,8 @@ void unpack_entry(FILE* fp,
}
} else {
if (print_progress) {
lg::info("Extracting {}...", entry.name);
lg::info("Extracting {}, size 0x{:x} offset 0x{:x}...", entry.name, entry.size,
entry.offset_in_file);
}
std::vector<u8> buffer(entry.size);
if (fseek_64(fp, entry.offset_in_file, SEEK_SET)) {
+3 -3
View File
@@ -83,9 +83,9 @@ extractor_iso_database() {
{{18445016742498932084U, // hash of ELF
{"Jak II", // canonical name
GAME_TERRITORY_SCEA,
593, // number of files
{4835330407820245819U, 5223305410190549348U}, // iso hash
"ntsc_v1", // decompiler config
593, // number of files
{4835330407820245819U, 5223305410190549348U, 3212700152698192932}, // iso hash
"ntsc_v1", // decompiler config
"jak2",
{}}}}},
// Jak 2 PAL