Skip to content

Commit

Permalink
Replaced deprecated API
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanarns committed Oct 3, 2023
1 parent d2d14ae commit bb1288d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
7 changes: 1 addition & 6 deletions ghidra_scripts/FnidUtils.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import ghidra.app.script.GhidraScript;
import ghidra.framework.Application;
import ghidra.framework.plugintool.dialog.ExtensionDetails;
import ghidra.framework.plugintool.dialog.ExtensionUtils;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;

class FnidUtils {

Expand Down Expand Up @@ -42,7 +37,7 @@ private static void loadFnids(GhidraScript script) throws Exception {
file = script.askFile("Locate nids.txt", "Load");
}

List<String> list = FileUtils.readLines(file);
List<String> list = FileUtils.readLines(file,"ascii");
for (String s : list) {
final String[] split = s.split(" ");
fnids.put(split[0], split[1]);
Expand Down
10 changes: 4 additions & 6 deletions ghidra_scripts/Ps3ElfUtils.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import ghidra.app.script.GhidraScript;
import ghidra.framework.plugintool.dialog.ExtensionDetails;
import ghidra.framework.plugintool.dialog.ExtensionException;
import ghidra.framework.plugintool.dialog.ExtensionUtils;
import ghidra.framework.project.extensions.ExtensionDetails;
import ghidra.framework.project.extensions.ExtensionUtils;
import ghidra.program.model.address.Address;
import ghidra.program.model.data.ArrayDataType;
import ghidra.program.model.data.DataType;
Expand All @@ -10,7 +9,6 @@
import ghidra.program.model.listing.Program;
import ghidra.program.model.mem.MemoryBlock;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -160,13 +158,13 @@ public void applyDataForce(DataType data, String name, Address address) throws E
public static String getExtensionInstallDataPath(String extensionName) {
final List<ExtensionDetails> ps3GhidraScripts;
try {
ps3GhidraScripts = ExtensionUtils.getInstalledExtensions(false)
ps3GhidraScripts = ExtensionUtils.getInstalledExtensions()
.stream()
.filter(extension -> extension.getName().equals(extensionName))
.collect(Collectors.toList());
final ExtensionDetails extensionDetails = ps3GhidraScripts.get(0);
return extensionDetails.getInstallPath();
} catch (ExtensionException e) {
} catch (Exception e) {
e.printStackTrace();
}

Expand Down

0 comments on commit bb1288d

Please sign in to comment.