Skip to content

Commit

Permalink
Merge pull request #31 from ethanarns/master
Browse files Browse the repository at this point in the history
Replaced deprecated API
  • Loading branch information
clienthax authored Oct 5, 2023
2 parents d2d14ae + 94c50e5 commit cb421e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
8 changes: 2 additions & 6 deletions ghidra_scripts/FnidUtils.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
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.nio.charset.Charset;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;

class FnidUtils {

Expand Down Expand Up @@ -42,7 +38,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,Charset.defaultCharset());
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 cb421e7

Please sign in to comment.