mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
GP-0 dead code removal
This commit is contained in:
parent
1eb2e71734
commit
69d6990e05
1 changed files with 1 additions and 69 deletions
|
@ -48,6 +48,7 @@ public class PEUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
|
// ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -59,73 +60,4 @@ public class PEUtil {
|
||||||
program.getCompiler().equals(CompilerEnum.Clang.toString()));
|
program.getCompiler().equals(CompilerEnum.Clang.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove if not used
|
|
||||||
|
|
||||||
// static DataType getActualType(DataType dataType) {
|
|
||||||
// if (dataType instanceof TypeDef) {
|
|
||||||
// return getActualType(((TypeDef) dataType).getDataType());
|
|
||||||
// }
|
|
||||||
// return dataType;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// static boolean isValidPointer(Program program, Address addr) {
|
|
||||||
// Memory memory = program.getMemory();
|
|
||||||
// AddressFactory addressFactory = program.getAddressFactory();
|
|
||||||
// AddressSpace defaultSpace = addressFactory.getDefaultAddressSpace();
|
|
||||||
// try {
|
|
||||||
// int addrAsInt = memory.getInt(addr);
|
|
||||||
// Address pointedToAddr = addressFactory.getAddress(defaultSpace.getSpaceID(), addrAsInt);
|
|
||||||
// return memory.contains(pointedToAddr);
|
|
||||||
// }
|
|
||||||
// catch (MemoryAccessException e) {
|
|
||||||
// }
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// static boolean isValidGuidPointer(Program program, Address addr) {
|
|
||||||
// Memory memory = program.getMemory();
|
|
||||||
// AddressFactory addressFactory = program.getAddressFactory();
|
|
||||||
// AddressSpace defaultSpace = addressFactory.getDefaultAddressSpace();
|
|
||||||
// try {
|
|
||||||
// int addrAsInt = memory.getInt(addr);
|
|
||||||
// Address pointedToAddr = addressFactory.getAddress(defaultSpace.getSpaceID(), addrAsInt);
|
|
||||||
// if (memory.contains(pointedToAddr)) {
|
|
||||||
// GuidInfo guidInfo = GuidUtil.getKnownGuid(program, pointedToAddr);
|
|
||||||
// if (guidInfo != null) {
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// catch (MemoryAccessException e) {
|
|
||||||
// }
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// static long getBytesToEndOfBlock(Program program, Address addr) {
|
|
||||||
// Memory memory = program.getMemory();
|
|
||||||
// Address endAddr = memory.getBlock(addr).getEnd();
|
|
||||||
// return endAddr.subtract(addr);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// static long getBytesToNextReferredToAddress(Program program, Address addr) {
|
|
||||||
// AddressIterator refIter =
|
|
||||||
// program.getReferenceManager().getReferenceDestinationIterator(addr.add(1L), true);
|
|
||||||
// if (refIter.hasNext()) {
|
|
||||||
// Address nextAddr = refIter.next();
|
|
||||||
// if (nextAddr != null) {
|
|
||||||
// return nextAddr.subtract(addr);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// static long getBytesToNextRelocation(Program program, Address addr) {
|
|
||||||
// Address nextRelocAddr = program.getRelocationTable().getRelocationAddressAfter(addr);
|
|
||||||
// if (nextRelocAddr != null &&
|
|
||||||
// addr.getAddressSpace().equals(nextRelocAddr.getAddressSpace())) {
|
|
||||||
// return nextRelocAddr.subtract(addr);
|
|
||||||
// }
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue