Skip to content

Commit

Permalink
make_arc add sloppy hash detection
Browse files Browse the repository at this point in the history
  • Loading branch information
PredatorCZ committed Sep 28, 2024
1 parent 651b624 commit e0092bf
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions toolset/arc_conv/make_arc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,22 @@ struct ArcMakeContext : AppPackContext {
return;
}

uint32 hash = 0;

if (hashes.size() > 1) {
printwarning("Skipped (multiple classes from extension): " << path);
return;
for (auto &h : hashes) {
if (revil::GetExtension(h, settings.title, settings.platform) ==
extension) {
if (hash) {
printwarning("Skipped (multiple classes from extension): " << path);
return;
}

hash = h;
}
}
} else {
hash = hashes.front();
}

auto noExt = path.substr(0, extPos);
Expand Down Expand Up @@ -168,7 +181,7 @@ struct ArcMakeContext : AppPackContext {
auto &streamStore = tStream->streamStore;
AFile curFile;
curFile.offset = streamStore.Tell();
curFile.hash = hashes.front();
curFile.hash = hash;
curFile.uSize = streamSize;
curFile.path = noExt;

Expand Down

0 comments on commit e0092bf

Please sign in to comment.