mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-04 07:15:01 +08:00
Merge remote-tracking branch 'origin/Ghidra_12.1'
This commit is contained in:
+5
@@ -89,9 +89,14 @@ public class ExportTrie {
|
|||||||
* @throws IOException if there was an IO-related error
|
* @throws IOException if there was an IO-related error
|
||||||
*/
|
*/
|
||||||
private void parseTrie() throws IOException {
|
private void parseTrie() throws IOException {
|
||||||
|
Set<Integer> visited = new HashSet<>();
|
||||||
|
visited.add(0);
|
||||||
LinkedList<Node> remainingNodes = parseNode("", 0);
|
LinkedList<Node> remainingNodes = parseNode("", 0);
|
||||||
while(!remainingNodes.isEmpty()) {
|
while(!remainingNodes.isEmpty()) {
|
||||||
Node parent = remainingNodes.removeFirst();
|
Node parent = remainingNodes.removeFirst();
|
||||||
|
if (!visited.add(parent.offset())) {
|
||||||
|
continue; // skip already-visited offsets
|
||||||
|
}
|
||||||
LinkedList<Node> children = parseNode(parent.name, parent.offset);
|
LinkedList<Node> children = parseNode(parent.name, parent.offset);
|
||||||
for (Node child : children) {
|
for (Node child : children) {
|
||||||
remainingNodes.add(new Node(parent.name + child.name, child.offset));
|
remainingNodes.add(new Node(parent.name + child.name, child.offset));
|
||||||
|
|||||||
@@ -159,17 +159,31 @@ public class BrowserLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String urlString = option.getUrlReplacementString();
|
String urlString = option.getUrlReplacementString();
|
||||||
|
String urlArg;
|
||||||
if (urlString.equals(ManualViewerCommandWrappedOption.HTTP_URL_REPLACEMENT_STRING) ||
|
if (urlString.equals(ManualViewerCommandWrappedOption.HTTP_URL_REPLACEMENT_STRING) ||
|
||||||
fileURL == null) {
|
fileURL == null) {
|
||||||
argumentList.add(url.toExternalForm());
|
urlArg = url.toExternalForm();
|
||||||
}
|
}
|
||||||
else if (urlString.equals(ManualViewerCommandWrappedOption.FILE_URL_REPLACEMENT_STRING)) {
|
else if (urlString.equals(ManualViewerCommandWrappedOption.FILE_URL_REPLACEMENT_STRING)) {
|
||||||
argumentList.add(fileURL.toExternalForm());
|
urlArg = fileURL.toExternalForm();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
argumentList.add(new File(fileURL.getFile()).getAbsolutePath());
|
urlArg = new File(fileURL.getFile()).getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If launching "cmd.exe /c start URL", surround the URL with double quotes to protect
|
||||||
|
// against special characters being misinterpreted by the shell.
|
||||||
|
// NOTE: If not already present, a double-quoted title must be inserted since the URL
|
||||||
|
// argument that follows will start with a double quote.
|
||||||
|
if (commandArguments.length >= 2 && commandArguments[0].equalsIgnoreCase("/c") &&
|
||||||
|
commandArguments[1].equalsIgnoreCase("start")) {
|
||||||
|
if (commandArguments.length == 2) {
|
||||||
|
argumentList.add("\"Title\"");
|
||||||
|
}
|
||||||
|
urlArg = '"' + urlArg + '"';
|
||||||
|
}
|
||||||
|
argumentList.add(urlArg);
|
||||||
|
|
||||||
return argumentList.toArray(new String[argumentList.size()]);
|
return argumentList.toArray(new String[argumentList.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user