mirror of
https://github.com/cemu-project/GhidraRPXLoader.git
synced 2024-11-25 02:26:57 +01:00
Fix some compiler warnings.
This commit is contained in:
parent
088a2ca0ed
commit
dc715cfb81
@ -134,8 +134,6 @@ public class Cafe_ElfExtension extends ElfExtension {
|
|||||||
|
|
||||||
private void processRplExports(ElfLoadHelper elfLoadHelper, ElfSectionHeader sectionHeader) {
|
private void processRplExports(ElfLoadHelper elfLoadHelper, ElfSectionHeader sectionHeader) {
|
||||||
String sectionName = sectionHeader.getNameAsString();
|
String sectionName = sectionHeader.getNameAsString();
|
||||||
Address loadAddress = elfLoadHelper.findLoadAddress(sectionHeader, 0);
|
|
||||||
Memory memory = elfLoadHelper.getProgram().getMemory();
|
|
||||||
boolean isDataExports = sectionName.contentEquals(".dexports");
|
boolean isDataExports = sectionName.contentEquals(".dexports");
|
||||||
if (!isDataExports) {
|
if (!isDataExports) {
|
||||||
// Function exports are already in symbol table
|
// Function exports are already in symbol table
|
||||||
@ -148,11 +146,11 @@ public class Cafe_ElfExtension extends ElfExtension {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
int count = reader.readNextInt();
|
int count = reader.readNextInt();
|
||||||
int signature = reader.readNextInt();
|
/* int signature = */ reader.readNextInt();
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
int value = reader.readNextInt();
|
int value = reader.readNextInt();
|
||||||
int nameOffset = reader.readNextInt();
|
int nameOffset = reader.readNextInt();
|
||||||
boolean isTlsExport = (nameOffset & 0x80000000) != 0;
|
/* boolean isTlsExport = (nameOffset & 0x80000000) != 0; */
|
||||||
String name = reader.readAsciiString(sectionHeader.getOffset() + (nameOffset & 0x7FFFFFFF));
|
String name = reader.readAsciiString(sectionHeader.getOffset() + (nameOffset & 0x7FFFFFFF));
|
||||||
elfLoadHelper.createSymbol(elfLoadHelper.getDefaultAddress(value), name, true, false, null);
|
elfLoadHelper.createSymbol(elfLoadHelper.getDefaultAddress(value), name, true, false, null);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ import ghidra.util.Msg;
|
|||||||
import ghidra.util.exception.InvalidInputException;
|
import ghidra.util.exception.InvalidInputException;
|
||||||
import ghidra.util.exception.NotFoundException;
|
import ghidra.util.exception.NotFoundException;
|
||||||
import ghidra.program.model.symbol.ExternalLocation;
|
import ghidra.program.model.symbol.ExternalLocation;
|
||||||
import ghidra.program.model.symbol.ExternalLocationIterator;
|
|
||||||
import ghidra.program.model.symbol.RefType;
|
import ghidra.program.model.symbol.RefType;
|
||||||
import ghidra.program.model.symbol.SourceType;
|
import ghidra.program.model.symbol.SourceType;
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ import ghidra.app.util.bin.format.elf.ElfException;
|
|||||||
import ghidra.app.util.bin.format.elf.ElfSectionHeader;
|
import ghidra.app.util.bin.format.elf.ElfSectionHeader;
|
||||||
import ghidra.app.util.bin.format.elf.ElfSectionHeaderConstants;
|
import ghidra.app.util.bin.format.elf.ElfSectionHeaderConstants;
|
||||||
import ghidra.app.util.bin.format.elf.RplSectionHeader;
|
import ghidra.app.util.bin.format.elf.RplSectionHeader;
|
||||||
import ghidra.util.exception.CancelledException;
|
|
||||||
import ghidra.util.task.TaskMonitor;
|
import ghidra.util.task.TaskMonitor;
|
||||||
import ghidra.util.*;
|
import ghidra.util.*;
|
||||||
|
|
||||||
@ -30,7 +29,7 @@ public class RplConverter {
|
|||||||
public static final byte ELFOSABI_VERSION_CAFE = (byte) 0xFE;
|
public static final byte ELFOSABI_VERSION_CAFE = (byte) 0xFE;
|
||||||
|
|
||||||
public static byte[] convertRpl(ByteProvider byteProvider, TaskMonitor monitor)
|
public static byte[] convertRpl(ByteProvider byteProvider, TaskMonitor monitor)
|
||||||
throws ElfException, IOException, CancelledException, DataFormatException {
|
throws ElfException, IOException, DataFormatException {
|
||||||
// Read elf header
|
// Read elf header
|
||||||
RplHeader elfHeader = RplHeader.createRplHeader(RethrowContinuesFactory.INSTANCE, byteProvider);
|
RplHeader elfHeader = RplHeader.createRplHeader(RethrowContinuesFactory.INSTANCE, byteProvider);
|
||||||
BinaryReader reader = elfHeader.getReader();
|
BinaryReader reader = elfHeader.getReader();
|
||||||
|
@ -14,7 +14,6 @@ import ghidra.app.util.Option;
|
|||||||
import ghidra.app.util.bin.ByteArrayProvider;
|
import ghidra.app.util.bin.ByteArrayProvider;
|
||||||
import ghidra.app.util.bin.ByteProvider;
|
import ghidra.app.util.bin.ByteProvider;
|
||||||
import ghidra.app.util.bin.format.elf.ElfException;
|
import ghidra.app.util.bin.format.elf.ElfException;
|
||||||
import ghidra.app.util.bin.format.elf.ElfHeader;
|
|
||||||
import ghidra.app.util.importer.MessageLog;
|
import ghidra.app.util.importer.MessageLog;
|
||||||
import ghidra.app.util.importer.MessageLogContinuesFactory;
|
import ghidra.app.util.importer.MessageLogContinuesFactory;
|
||||||
import ghidra.program.model.lang.LanguageCompilerSpecPair;
|
import ghidra.program.model.lang.LanguageCompilerSpecPair;
|
||||||
@ -54,12 +53,11 @@ public class CafeLoader extends ElfLoader {
|
|||||||
@Override
|
@Override
|
||||||
public void load(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program,
|
public void load(ByteProvider provider, LoadSpec loadSpec, List<Option> options, Program program,
|
||||||
TaskMonitor monitor, MessageLog log) throws IOException {
|
TaskMonitor monitor, MessageLog log) throws IOException {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
GenericFactory factory = MessageLogContinuesFactory.create(log);
|
GenericFactory factory = MessageLogContinuesFactory.create(log);
|
||||||
byte[] data = RplConverter.convertRpl(provider, monitor);
|
byte[] data = RplConverter.convertRpl(provider, monitor);
|
||||||
RplHeader rpl = RplHeader.createRplHeader(factory, new ByteArrayProvider(data));
|
RplHeader rpl = RplHeader.createRplHeader(factory, new ByteArrayProvider(data));
|
||||||
ElfProgramBuilder.loadElf((ElfHeader)rpl, program, options, log, monitor);
|
ElfProgramBuilder.loadElf(rpl, program, options, log, monitor);
|
||||||
} catch (ElfException e) {
|
} catch (ElfException e) {
|
||||||
throw new IOException(e.getMessage());
|
throw new IOException(e.getMessage());
|
||||||
} catch (CancelledException e) {
|
} catch (CancelledException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user