Merge remote-tracking branch 'origin/GP-254_dev747368_update_7zip_libs' into Ghidra_9.2

This commit is contained in:
ghidra1
2020-10-27 17:54:24 -04:00
2 changed files with 11 additions and 3 deletions

View File

@@ -23,10 +23,10 @@ dependencies {
compile 'org.smali:dexlib:1.4.0'
compile 'org.smali:util:1.4.0'
compile 'net.sf.sevenzipjbinding:sevenzipjbinding:9.20-2.00beta'
compile 'net.sf.sevenzipjbinding:sevenzipjbinding:16.02-2.01'
compile ':AXMLPrinter2'
runtime 'net.sf.sevenzipjbinding:sevenzipjbinding-all-platforms:9.20-2.00beta'
runtime 'net.sf.sevenzipjbinding:sevenzipjbinding-all-platforms:16.02-2.01'
helpPath project(path: ":Base", configuration: 'helpPath')

View File

@@ -18,6 +18,8 @@ package ghidra.file.formats.sevenzip;
import java.io.*;
import java.util.*;
import org.apache.commons.io.FilenameUtils;
import ghidra.formats.gfilesystem.*;
import ghidra.formats.gfilesystem.annotations.FileSystemInfo;
import ghidra.util.Msg;
@@ -70,7 +72,13 @@ public class SevenZipFileSystem implements GFileSystem {
throw new CancelledException();
}
fsIndexHelper.storeFile(item.getPath(), item.getItemIndex(), item.isFolder(),
String itemPath = item.getPath();
if (items.length == 1 && itemPath.isBlank()) {
// special case when there is a single unnamed file.
// use the name of the 7zip file itself, minus the extension
itemPath = FilenameUtils.getBaseName(fsrl.getContainer().getName());
}
fsIndexHelper.storeFile(itemPath, item.getItemIndex(), item.isFolder(),
getSize(item), item);
}
preCacheAll(monitor);