Skip to content

Commit

Permalink
chore: tidy up source code
Browse files Browse the repository at this point in the history
  • Loading branch information
CreepNT committed Nov 22, 2023
1 parent cbd6aff commit 1d8e09f
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 24 deletions.
4 changes: 1 addition & 3 deletions src/main/java/vitaloaderredux/analyzer/NIDAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,7 @@ public boolean accept(File pathname, GhidraFileChooserModel model) {
fileChooser.setFileFilter(yamlFilter);
fileChooser.setTitle("Choose the NID database file to use for this analysis");
fileChooser.setApproveButtonText("Use selected file");
fileChooser.setApproveButtonToolTipText(
"Use the selected file as the NID database file for this analysis");
// fileChooser.rescanCurrentDirectory();
fileChooser.setApproveButtonToolTipText("Use the selected file as the NID database file for this analysis");
databaseFile = fileChooser.getSelectedFile();
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
import ghidra.program.model.mem.MemoryAccessException;
import ghidra.program.model.mem.MemoryBlock;
import vitaloaderredux.elf.MalformedElfException;

import vitaloaderredux.loader.ArmElfPrxLoaderContext;

import vitaloaderredux.misc.BitfieldReader;
import vitaloaderredux.misc.Datatypes;
import vitaloaderredux.misc.Utils;
import vitaloaderredux.misc.ImportExportProperty.IEKind;
import vitaloaderredux.misc.ImportExportProperty.IEType;
import vitaloaderredux.misc.Utils;

public class ArmRelocator {

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/vitaloaderredux/elf/ElfEhdr.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
import ghidra.app.util.bin.BinaryReader;
import ghidra.app.util.bin.ByteProvider;
import ghidra.app.util.bin.StructConverter;
import ghidra.util.DataConverter;
import ghidra.util.LittleEndianDataConverter;
import ghidra.util.exception.DuplicateNameException;
import vitaloaderredux.misc.Datatypes;
import ghidra.app.util.bin.format.Writeable;
import ghidra.app.util.bin.format.elf.ElfConstants;
import ghidra.app.util.bin.format.elf.ElfProgramHeaderConstants;
Expand All @@ -21,6 +17,10 @@
import ghidra.program.model.data.StructureDataType;
import ghidra.program.model.data.UnsignedIntegerDataType;
import ghidra.program.model.data.UnsignedShortDataType;
import ghidra.util.DataConverter;
import ghidra.util.LittleEndianDataConverter;
import ghidra.util.exception.DuplicateNameException;
import vitaloaderredux.misc.Datatypes;

public class ElfEhdr implements StructConverter, Writeable {

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/vitaloaderredux/elf/ElfPhdr.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import java.io.IOException;

import ghidra.app.util.bin.BinaryReader;
import ghidra.app.util.bin.format.elf.ElfProgramHeaderConstants;
import ghidra.program.model.data.DataType;
import ghidra.program.model.data.EnumDataType;
import ghidra.program.model.data.StructureDataType;
import ghidra.program.model.data.UnsignedIntegerDataType;
import vitaloaderredux.misc.Datatypes;
import ghidra.app.util.bin.format.elf.ElfProgramHeaderConstants;

public class ElfPhdr {
//TODO: verify only those exist
Expand Down
1 change: 0 additions & 1 deletion src/main/java/vitaloaderredux/elf/ElfShdr.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import ghidra.program.model.data.EnumDataType;
import ghidra.program.model.data.StructureDataType;
import ghidra.program.model.data.UnsignedIntegerDataType;

import vitaloaderredux.misc.Datatypes;

public class ElfShdr {
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/vitaloaderredux/loader/ArmElfPrxLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import ghidra.app.util.MemoryBlockUtils;
import ghidra.app.util.Option;
Expand All @@ -26,7 +28,6 @@
import ghidra.program.model.address.AddressSpace;
import ghidra.program.model.data.ByteDataType;
import ghidra.program.model.data.DataType;

import ghidra.program.model.lang.LanguageCompilerSpecPair;
import ghidra.program.model.listing.CodeUnit;
import ghidra.program.model.listing.Data;
Expand All @@ -39,14 +40,12 @@
import ghidra.util.exception.CancelledException;
import ghidra.util.exception.DuplicateNameException;
import ghidra.util.task.TaskMonitor;

import vitaloaderredux.elf.ElfEhdr;
import vitaloaderredux.elf.ElfEhdr.ModInfoLocation;
import vitaloaderredux.elf.ElfPhdr;
import vitaloaderredux.elf.ElfShdr;
import vitaloaderredux.elf.MalformedElfException;
import vitaloaderredux.elf.UnsupportedElfException;

import vitaloaderredux.misc.Datatypes;
import vitaloaderredux.misc.HexOption;
import vitaloaderredux.misc.ImportExportProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import ghidra.program.model.listing.ContextChangeException;
import ghidra.program.model.listing.Data;
import ghidra.program.model.listing.Function;
import ghidra.program.model.listing.Function.FunctionUpdateType;
import ghidra.program.model.listing.FunctionManager;
import ghidra.program.model.listing.Listing;
import ghidra.program.model.listing.ParameterImpl;
import ghidra.program.model.listing.Program;
import ghidra.program.model.listing.ProgramContext;
import ghidra.program.model.listing.Variable;
import ghidra.program.model.listing.Function.FunctionUpdateType;
import ghidra.program.model.mem.Memory;
import ghidra.program.model.mem.MemoryAccessException;
import ghidra.program.model.mem.MemoryBlock;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/vitaloaderredux/scetypes/ILibent.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
import ghidra.program.model.data.TypedefDataType;
import ghidra.program.model.listing.Function;
import ghidra.program.model.symbol.Namespace;

import vitaloaderredux.elf.MalformedElfException;
import vitaloaderredux.loader.ArmElfPrxLoaderContext;
import vitaloaderredux.misc.Datatypes;
import vitaloaderredux.misc.sdt_probedesc_t;
import vitaloaderredux.misc.Utils;
import vitaloaderredux.misc.sdt_probedesc_t;

public abstract class ILibent {
// Library NID returned when it cannot be obtained.
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/vitaloaderredux/scetypes/ILibstub.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@

import ghidra.app.util.bin.BinaryReader;
import ghidra.program.model.address.Address;
import ghidra.program.model.symbol.Namespace;
import ghidra.program.model.data.DataType;
import ghidra.program.model.data.StructureDataType;
import ghidra.program.model.data.TerminatedStringDataType;
import ghidra.program.model.data.TypedefDataType;
import ghidra.program.model.listing.CodeUnit;
import ghidra.program.model.listing.Function;

import ghidra.program.model.symbol.Namespace;
import vitaloaderredux.loader.ArmElfPrxLoaderContext;
import vitaloaderredux.misc.Datatypes;
import vitaloaderredux.misc.Utils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import ghidra.program.model.data.TypedefDataType;
import ghidra.program.model.data.VoidDataType;
import ghidra.program.model.listing.Function;

import vitaloaderredux.elf.MalformedElfException;
import vitaloaderredux.loader.ArmElfPrxLoaderContext;
import vitaloaderredux.misc.Datatypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import ghidra.program.model.data.TypedefDataType;
import ghidra.program.model.data.VoidDataType;
import ghidra.program.model.listing.Function;

import vitaloaderredux.elf.MalformedElfException;
import vitaloaderredux.loader.ArmElfPrxLoaderContext;
import vitaloaderredux.misc.Datatypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import ghidra.program.model.data.TypedefDataType;
import ghidra.program.model.data.VoidDataType;
import ghidra.program.model.listing.Function;

import vitaloaderredux.elf.MalformedElfException;
import vitaloaderredux.loader.ArmElfPrxLoaderContext;
import vitaloaderredux.misc.Datatypes;
Expand Down

0 comments on commit 1d8e09f

Please sign in to comment.