mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-07-30 07:18:37 -09:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
@@ -97,7 +97,8 @@ public abstract class AbstractOrdinalSupportLoader extends AbstractLibrarySuppor
|
||||
log.appendMsg("Created exports file: " + newExportsFile);
|
||||
}
|
||||
catch (IOException e) {
|
||||
log.appendMsg("Unable to create exports file for " + libFsrl);
|
||||
log.appendMsg(
|
||||
"Unable to create exports file for %s: %s".formatted(libFsrl, e.getMessage()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -19,6 +19,9 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import org.jdom2.IllegalDataException;
|
||||
import org.jdom2.IllegalNameException;
|
||||
|
||||
import generic.jar.ResourceFile;
|
||||
import ghidra.app.util.bin.format.pe.ResourceDataDirectory;
|
||||
import ghidra.app.util.importer.MessageLog;
|
||||
@@ -173,7 +176,12 @@ public class LibraryLookupTable {
|
||||
Msg.warn(LibraryLookupTable.class, "Can't write to installation directory");
|
||||
}
|
||||
else {
|
||||
symTab.write(f, new File(program.getExecutablePath()), version);
|
||||
try {
|
||||
symTab.write(f, new File(program.getExecutablePath()), version);
|
||||
}
|
||||
catch (IllegalNameException | IllegalDataException e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return file;
|
||||
|
||||
@@ -485,7 +485,8 @@ class LibrarySymbolTable {
|
||||
//}
|
||||
}
|
||||
|
||||
void write(File output, File input, String lversion) throws IOException {
|
||||
void write(File output, File input, String lversion)
|
||||
throws IOException, IllegalNameException, IllegalDataException {
|
||||
Element root = new Element("LIBRARY");
|
||||
|
||||
root.setAttribute("NAME", tableName);
|
||||
@@ -515,16 +516,12 @@ class LibrarySymbolTable {
|
||||
root.addContent(export);
|
||||
}
|
||||
|
||||
FileOutputStream fos = new FileOutputStream(output);
|
||||
try {
|
||||
try (FileOutputStream fos = new FileOutputStream(output)) {
|
||||
Document doc = new Document(root);
|
||||
|
||||
XMLOutputter xmlout = GenericXMLOutputter.getInstance();
|
||||
xmlout.output(doc, fos);
|
||||
}
|
||||
finally {
|
||||
fos.close();
|
||||
}
|
||||
|
||||
//StringBuffer buffer = new StringBuffer();
|
||||
//Iterator iter = exportList.iterator();
|
||||
|
||||
Reference in New Issue
Block a user