mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-31 09:26:32 +08:00
GP-2974: Fixing warnings
This commit is contained in:
+1
-1
@@ -263,7 +263,7 @@ public class IsfDataTypeWriter {
|
|||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
for (String key : keylist) {
|
for (String key : keylist) {
|
||||||
DataType dataType = map.get(key);
|
DataType dataType = map.get(key);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (key.contains(".conflict")) {
|
if (key.contains(".conflict")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -68,7 +68,7 @@ public class DebuggerCopyPlan {
|
|||||||
byte[] buf = new byte[4096];
|
byte[] buf = new byte[4096];
|
||||||
AddressRangeChunker chunker = new AddressRangeChunker(fromRange, buf.length);
|
AddressRangeChunker chunker = new AddressRangeChunker(fromRange, buf.length);
|
||||||
for (AddressRange chunk : chunker) {
|
for (AddressRange chunk : chunker) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = chunk.getMinAddress();
|
Address addr = chunk.getMinAddress();
|
||||||
int len = (int) chunk.getLength();
|
int len = (int) chunk.getLength();
|
||||||
from.getMemory().getBytes(addr, buf, 0, len);
|
from.getMemory().getBytes(addr, buf, 0, len);
|
||||||
@@ -124,7 +124,7 @@ public class DebuggerCopyPlan {
|
|||||||
Listing intoListing = into.getListing();
|
Listing intoListing = into.getListing();
|
||||||
for (Instruction ins : from.getListing()
|
for (Instruction ins : from.getListing()
|
||||||
.getInstructions(new AddressSet(fromRange), true)) {
|
.getInstructions(new AddressSet(fromRange), true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (!ins.getPrototype().getLanguage().equals(into.getLanguage())) {
|
if (!ins.getPrototype().getLanguage().equals(into.getLanguage())) {
|
||||||
// Filter out "guest" instructions
|
// Filter out "guest" instructions
|
||||||
continue;
|
continue;
|
||||||
@@ -148,7 +148,7 @@ public class DebuggerCopyPlan {
|
|||||||
Listing intoListing = into.getListing();
|
Listing intoListing = into.getListing();
|
||||||
for (Data data : from.getListing()
|
for (Data data : from.getListing()
|
||||||
.getDefinedData(new AddressSet(fromRange), true)) {
|
.getDefinedData(new AddressSet(fromRange), true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long off = data.getMinAddress().subtract(fromRange.getMinAddress());
|
long off = data.getMinAddress().subtract(fromRange.getMinAddress());
|
||||||
Address dest = intoAddress.add(off);
|
Address dest = intoAddress.add(off);
|
||||||
DataType dt = data.getDataType();
|
DataType dt = data.getDataType();
|
||||||
@@ -170,7 +170,7 @@ public class DebuggerCopyPlan {
|
|||||||
Listing intoListing = into.getListing();
|
Listing intoListing = into.getListing();
|
||||||
for (Data data : from.getListing()
|
for (Data data : from.getListing()
|
||||||
.getDefinedData(new AddressSet(fromRange), true)) {
|
.getDefinedData(new AddressSet(fromRange), true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long off = data.getMinAddress().subtract(fromRange.getMinAddress());
|
long off = data.getMinAddress().subtract(fromRange.getMinAddress());
|
||||||
Address dest = intoAddress.add(off);
|
Address dest = intoAddress.add(off);
|
||||||
DataType dt = data.getDataType();
|
DataType dt = data.getDataType();
|
||||||
@@ -187,7 +187,7 @@ public class DebuggerCopyPlan {
|
|||||||
SymbolTable intoTable = into.getSymbolTable();
|
SymbolTable intoTable = into.getSymbolTable();
|
||||||
for (Symbol label : from.getSymbolTable()
|
for (Symbol label : from.getSymbolTable()
|
||||||
.getSymbols(new AddressSet(fromRange), SymbolType.LABEL, true)) {
|
.getSymbols(new AddressSet(fromRange), SymbolType.LABEL, true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (label.getSource() == SourceType.DEFAULT) {
|
if (label.getSource() == SourceType.DEFAULT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -222,7 +222,7 @@ public class DebuggerCopyPlan {
|
|||||||
for (TraceBreakpoint bpt : from.getTrace()
|
for (TraceBreakpoint bpt : from.getTrace()
|
||||||
.getBreakpointManager()
|
.getBreakpointManager()
|
||||||
.getBreakpointsIntersecting(Lifespan.at(from.getSnap()), fromRange)) {
|
.getBreakpointsIntersecting(Lifespan.at(from.getSnap()), fromRange)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long off = bpt.getMinAddress().subtract(fromRange.getMinAddress());
|
long off = bpt.getMinAddress().subtract(fromRange.getMinAddress());
|
||||||
Address dest = intoAddress.add(off);
|
Address dest = intoAddress.add(off);
|
||||||
ProgramBreakpoint pb =
|
ProgramBreakpoint pb =
|
||||||
@@ -245,7 +245,7 @@ public class DebuggerCopyPlan {
|
|||||||
Iterator<Bookmark> bit =
|
Iterator<Bookmark> bit =
|
||||||
from.getBookmarkManager().getBookmarksIterator(fromRange.getMinAddress(), true);
|
from.getBookmarkManager().getBookmarksIterator(fromRange.getMinAddress(), true);
|
||||||
while (bit.hasNext()) {
|
while (bit.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Bookmark bm = bit.next();
|
Bookmark bm = bit.next();
|
||||||
if (bm.getAddress().compareTo(fromRange.getMaxAddress()) > 0) {
|
if (bm.getAddress().compareTo(fromRange.getMaxAddress()) > 0) {
|
||||||
break;
|
break;
|
||||||
@@ -270,7 +270,7 @@ public class DebuggerCopyPlan {
|
|||||||
ReferenceManager intoRefs = into.getReferenceManager();
|
ReferenceManager intoRefs = into.getReferenceManager();
|
||||||
for (Reference ref : from.getReferenceManager()
|
for (Reference ref : from.getReferenceManager()
|
||||||
.getReferenceIterator(fromRange.getMinAddress())) {
|
.getReferenceIterator(fromRange.getMinAddress())) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (ref.getFromAddress().compareTo(fromRange.getMaxAddress()) > 0) {
|
if (ref.getFromAddress().compareTo(fromRange.getMaxAddress()) > 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -304,7 +304,7 @@ public class DebuggerCopyPlan {
|
|||||||
Listing intoListing = into.getListing();
|
Listing intoListing = into.getListing();
|
||||||
for (Address addr : fromListing.getCommentAddressIterator(new AddressSet(fromRange),
|
for (Address addr : fromListing.getCommentAddressIterator(new AddressSet(fromRange),
|
||||||
true)) {
|
true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long off = addr.subtract(fromRange.getMinAddress());
|
long off = addr.subtract(fromRange.getMinAddress());
|
||||||
Address dest = intoAddress.add(off);
|
Address dest = intoAddress.add(off);
|
||||||
// Ugly, but there's not MAX/MIN_COMMENT_TYPE
|
// Ugly, but there's not MAX/MIN_COMMENT_TYPE
|
||||||
|
|||||||
+1
-1
@@ -305,7 +305,7 @@ public abstract class AbstractQueryTableModel<T> extends ThreadedTableModel<T, T
|
|||||||
}
|
}
|
||||||
for (T t : (Iterable<T>) streamRows(trace, query, span)::iterator) {
|
for (T t : (Iterable<T>) streamRows(trace, query, span)::iterator) {
|
||||||
accumulator.add(t);
|
accumulator.add(t);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -129,7 +129,7 @@ public class ObjectNode extends GTreeSlowLoadingNode { //extends GTreeNode
|
|||||||
List<GTreeNode> children = children();
|
List<GTreeNode> children = children();
|
||||||
monitor = new TreeTaskMonitor(monitor, children.size());
|
monitor = new TreeTaskMonitor(monitor, children.size());
|
||||||
for (GTreeNode child : children) {
|
for (GTreeNode child : children) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += child.loadAll(monitor);
|
count += child.loadAll(monitor);
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -762,7 +762,7 @@ public class DebuggerStaticMappingServicePlugin extends Plugin
|
|||||||
protected static void doAddMappings(Trace trace, Collection<MapEntry<?, ?>> entries,
|
protected static void doAddMappings(Trace trace, Collection<MapEntry<?, ?>> entries,
|
||||||
TaskMonitor monitor, boolean truncateExisting) throws CancelledException {
|
TaskMonitor monitor, boolean truncateExisting) throws CancelledException {
|
||||||
for (MapEntry<?, ?> ent : entries) {
|
for (MapEntry<?, ?> ent : entries) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
try {
|
try {
|
||||||
DebuggerStaticMappingUtils.addMapping(ent, truncateExisting);
|
DebuggerStaticMappingUtils.addMapping(ent, truncateExisting);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -244,7 +244,7 @@ public class UnwindAnalysis {
|
|||||||
public void executeSet(SymPcodeExecutor exec, AddressSetView set)
|
public void executeSet(SymPcodeExecutor exec, AddressSetView set)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
for (Instruction i : program.getListing().getInstructions(set, true)) {
|
for (Instruction i : program.getListing().getInstructions(set, true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
exec.execute(PcodeProgram.fromInstruction(i, true), PcodeUseropLibrary.nil());
|
exec.execute(PcodeProgram.fromInstruction(i, true), PcodeUseropLibrary.nil());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -312,7 +312,7 @@ public abstract class AbstractBaseDBTraceDefinedUnitsView<T extends AbstractDBTr
|
|||||||
cacheForSequence.invalidate();
|
cacheForSequence.invalidate();
|
||||||
for (T unit : mapSpace.reduce(
|
for (T unit : mapSpace.reduce(
|
||||||
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (unit.getStartSnap() < startSnap) {
|
if (unit.getStartSnap() < startSnap) {
|
||||||
Lifespan oldSpan = unit.getLifespan();
|
Lifespan oldSpan = unit.getLifespan();
|
||||||
if (clearContext) {
|
if (clearContext) {
|
||||||
|
|||||||
+1
-1
@@ -491,7 +491,7 @@ public class DBTraceCodeManager extends AbstractDBTraceSpaceBasedManager<DBTrace
|
|||||||
monitor.setMaximum(protoStore.getRecordCount());
|
monitor.setMaximum(protoStore.getRecordCount());
|
||||||
for (Iterator<DBTraceCodePrototypeEntry> it = protoStore.asMap().values().iterator(); it
|
for (Iterator<DBTraceCodePrototypeEntry> it = protoStore.asMap().values().iterator(); it
|
||||||
.hasNext();) {
|
.hasNext();) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
DBTraceCodePrototypeEntry protoEnt = it.next();
|
DBTraceCodePrototypeEntry protoEnt = it.next();
|
||||||
if (protoEnt.prototype.getLanguage() != guest.getLanguage()) {
|
if (protoEnt.prototype.getLanguage() != guest.getLanguage()) {
|
||||||
|
|||||||
+2
-2
@@ -188,7 +188,7 @@ public class DBTraceCodeSpace implements TraceCodeSpace, DBTraceSpaceBased {
|
|||||||
|
|
||||||
for (DBTraceInstruction instruction : instructionMapSpace.reduce(
|
for (DBTraceInstruction instruction : instructionMapSpace.reduce(
|
||||||
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
if (instruction.platform != guest) {
|
if (instruction.platform != guest) {
|
||||||
continue;
|
continue;
|
||||||
@@ -200,7 +200,7 @@ public class DBTraceCodeSpace implements TraceCodeSpace, DBTraceSpaceBased {
|
|||||||
monitor.setMaximum(dataMapSpace.size()); // This is OK
|
monitor.setMaximum(dataMapSpace.size()); // This is OK
|
||||||
for (DBTraceData dataUnit : dataMapSpace.reduce(
|
for (DBTraceData dataUnit : dataMapSpace.reduce(
|
||||||
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
TraceAddressSnapRangeQuery.intersecting(range, span)).values()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
if (dataUnit.platform != guest) {
|
if (dataUnit.platform != guest) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
+1
-1
@@ -658,7 +658,7 @@ public abstract class AbstractDBTraceProgramViewListing implements TraceProgramV
|
|||||||
AddressSet result = new AddressSet();
|
AddressSet result = new AddressSet();
|
||||||
for (AddressRange range : getUndefinedRangeIterator(set, true)) {
|
for (AddressRange range : getUndefinedRangeIterator(set, true)) {
|
||||||
result.add(range);
|
result.add(range);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -153,7 +153,7 @@ public class DBTraceProgramViewBookmarkManager implements TraceProgramViewBookma
|
|||||||
Collection<DBTraceBookmark> bookmarks = bookmarkManager.getBookmarksByType(type);
|
Collection<DBTraceBookmark> bookmarks = bookmarkManager.getBookmarksByType(type);
|
||||||
monitor.initialize(bookmarks.size());
|
monitor.initialize(bookmarks.size());
|
||||||
for (DBTraceBookmark bm : bookmarks) {
|
for (DBTraceBookmark bm : bookmarks) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
if (!bm.getLifespan().contains(program.snap)) {
|
if (!bm.getLifespan().contains(program.snap)) {
|
||||||
continue;
|
continue;
|
||||||
@@ -171,7 +171,7 @@ public class DBTraceProgramViewBookmarkManager implements TraceProgramViewBookma
|
|||||||
try (LockHold hold = program.trace.lockWrite()) {
|
try (LockHold hold = program.trace.lockWrite()) {
|
||||||
monitor.initialize(set.getNumAddresses());
|
monitor.initialize(set.getNumAddresses());
|
||||||
for (AddressRange rng : set) {
|
for (AddressRange rng : set) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(rng.getLength());
|
monitor.incrementProgress(rng.getLength());
|
||||||
DBTraceBookmarkSpace space =
|
DBTraceBookmarkSpace space =
|
||||||
bookmarkManager.getBookmarkSpace(rng.getAddressSpace(), false);
|
bookmarkManager.getBookmarkSpace(rng.getAddressSpace(), false);
|
||||||
@@ -180,7 +180,7 @@ public class DBTraceProgramViewBookmarkManager implements TraceProgramViewBookma
|
|||||||
}
|
}
|
||||||
for (TraceBookmark bm : space.getBookmarksIntersecting(Lifespan.at(program.snap),
|
for (TraceBookmark bm : space.getBookmarksIntersecting(Lifespan.at(program.snap),
|
||||||
rng)) {
|
rng)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (!bm.getLifespan().contains(program.snap)) {
|
if (!bm.getLifespan().contains(program.snap)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -269,7 +269,7 @@ public class DBTraceProgramViewFunctionManager implements FunctionManager {
|
|||||||
Iterator<? extends DBTraceFunctionSymbol> it =
|
Iterator<? extends DBTraceFunctionSymbol> it =
|
||||||
getFunctionsInRange(new AddressRangeImpl(startAddr, endAddr), true);
|
getFunctionsInRange(new AddressRangeImpl(startAddr, endAddr), true);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
it.next().delete();
|
it.next().delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ public class DBTraceProgramViewListing extends AbstractDBTraceProgramViewListing
|
|||||||
for (AddressRange range : program.getAddressFactory()
|
for (AddressRange range : program.getAddressFactory()
|
||||||
.getAddressSet(startAddr,
|
.getAddressSet(startAddr,
|
||||||
endAddr)) {
|
endAddr)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
codeOperations.definedUnits()
|
codeOperations.definedUnits()
|
||||||
.clear(Lifespan.at(program.snap), range, clearContext, monitor);
|
.clear(Lifespan.at(program.snap), range, clearContext, monitor);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -122,7 +122,7 @@ public interface Scheduler {
|
|||||||
emuThread.finishInstruction();
|
emuThread.finishInstruction();
|
||||||
}
|
}
|
||||||
for (int i = 0; i < slice.tickCount; i++) {
|
for (int i = 0; i < slice.tickCount; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
emuThread.stepInstruction();
|
emuThread.stepInstruction();
|
||||||
completedTicks++;
|
completedTicks++;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ public class SkipStep extends AbstractStep {
|
|||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
for (int i = 0; i < tickCount; i++) {
|
for (int i = 0; i < tickCount; i++) {
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
stepper.skip(emuThread);
|
stepper.skip(emuThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ public class TickStep extends AbstractStep {
|
|||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
for (int i = 0; i < tickCount; i++) {
|
for (int i = 0; i < tickCount; i++) {
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
stepper.tick(emuThread);
|
stepper.tick(emuThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ public abstract class DBDomainObjectSupport extends DomainObjectAdapterDB {
|
|||||||
|
|
||||||
protected <T> T createManager(String managerName, ManagerSupplier<T> supplier)
|
protected <T> T createManager(String managerName, ManagerSupplier<T> supplier)
|
||||||
throws CancelledException, IOException {
|
throws CancelledException, IOException {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.setMessage("Creating " + managerName);
|
monitor.setMessage("Creating " + managerName);
|
||||||
try {
|
try {
|
||||||
return supplier.create(openMode, monitor);
|
return supplier.create(openMode, monitor);
|
||||||
|
|||||||
+1
-1
@@ -94,7 +94,7 @@ public class FunctionStartClassifier {
|
|||||||
results = classifyQ.waitForResults();
|
results = classifyQ.waitForResults();
|
||||||
}
|
}
|
||||||
catch (InterruptedException e) {
|
catch (InterruptedException e) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Msg.error(this, "Exception while classifying functions: " + e.getMessage());
|
Msg.error(this, "Exception while classifying functions: " + e.getMessage());
|
||||||
}
|
}
|
||||||
long end = System.nanoTime();
|
long end = System.nanoTime();
|
||||||
|
|||||||
+1
-1
@@ -303,7 +303,7 @@ public class FunctionStartRFParams {
|
|||||||
funcEntries = new AddressSet();
|
funcEntries = new AddressSet();
|
||||||
funcInteriors = new AddressSet();
|
funcInteriors = new AddressSet();
|
||||||
while (fIter.hasNext()) {
|
while (fIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Function func = fIter.next();
|
Function func = fIter.next();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
if (func.getBody().getNumAddresses() < minFuncSize) {
|
if (func.getBody().getNumAddresses() < minFuncSize) {
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ public class GetAddressesToClassifyTask extends Task {
|
|||||||
monitor.initialize(prog.getFunctionManager().getFunctionCount());
|
monitor.initialize(prog.getFunctionManager().getFunctionCount());
|
||||||
FunctionIterator fIter = prog.getFunctionManager().getFunctions(true);
|
FunctionIterator fIter = prog.getFunctionManager().getFunctions(true);
|
||||||
while (fIter.hasNext()) {
|
while (fIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
Function func = fIter.next();
|
Function func = fIter.next();
|
||||||
execNonFunc = execNonFunc.subtract(func.getBody());
|
execNonFunc = execNonFunc.subtract(func.getBody());
|
||||||
|
|||||||
+4
-4
@@ -116,7 +116,7 @@ public class ModelTrainingUtils {
|
|||||||
TaskMonitor monitor) throws CancelledException {
|
TaskMonitor monitor) throws CancelledException {
|
||||||
AddressSet following = new AddressSet();
|
AddressSet following = new AddressSet();
|
||||||
for (Address addr : addresses.getAddresses(true)) {
|
for (Address addr : addresses.getAddresses(true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
CodeUnit cu = program.getListing().getCodeUnitAfter(addr);
|
CodeUnit cu = program.getListing().getCodeUnitAfter(addr);
|
||||||
if (cu == null) {
|
if (cu == null) {
|
||||||
continue;
|
continue;
|
||||||
@@ -149,7 +149,7 @@ public class ModelTrainingUtils {
|
|||||||
TaskMonitor monitor) throws CancelledException {
|
TaskMonitor monitor) throws CancelledException {
|
||||||
AddressSet preceding = new AddressSet();
|
AddressSet preceding = new AddressSet();
|
||||||
for (Address addr : addresses.getAddresses(true)) {
|
for (Address addr : addresses.getAddresses(true)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
CodeUnit cu = program.getListing().getCodeUnitBefore(addr);
|
CodeUnit cu = program.getListing().getCodeUnitBefore(addr);
|
||||||
if (cu == null) {
|
if (cu == null) {
|
||||||
continue;
|
continue;
|
||||||
@@ -182,7 +182,7 @@ public class ModelTrainingUtils {
|
|||||||
program.getListing().getDefinedData(program.getMemory().getExecuteSet(), true);
|
program.getListing().getDefinedData(program.getMemory().getExecuteSet(), true);
|
||||||
AddressSet definedData = new AddressSet();
|
AddressSet definedData = new AddressSet();
|
||||||
for (Data d : dataIter) {
|
for (Data d : dataIter) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
definedData.add(
|
definedData.add(
|
||||||
new AddressRangeImpl(d.getAddress(), d.getAddress().add(d.getLength() - 1)));
|
new AddressRangeImpl(d.getAddress(), d.getAddress().add(d.getLength() - 1)));
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ public class ModelTrainingUtils {
|
|||||||
monitor.initialize(source.getNumAddresses());
|
monitor.initialize(source.getNumAddresses());
|
||||||
Iterator<Address> addressIter = source.getAddresses(true);
|
Iterator<Address> addressIter = source.getAddresses(true);
|
||||||
while (addressIter.hasNext()) {
|
while (addressIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = addressIter.next();
|
Address addr = addressIter.next();
|
||||||
monitor.incrementProgress(1L);
|
monitor.incrementProgress(1L);
|
||||||
List<Feature> trainingVector =
|
List<Feature> trainingVector =
|
||||||
|
|||||||
+4
-4
@@ -338,7 +338,7 @@ public class RandomForestTrainingTask extends Task {
|
|||||||
|
|
||||||
List<CARTClassificationTrainer> trainers = new ArrayList<>();
|
List<CARTClassificationTrainer> trainers = new ArrayList<>();
|
||||||
for (int i = 0; i < NUM_TREES; ++i) {
|
for (int i = 0; i < NUM_TREES; ++i) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
//Integer.MAX_VALUE: unlimited depth
|
//Integer.MAX_VALUE: unlimited depth
|
||||||
trainers.add(new CARTClassificationTrainer(Integer.MAX_VALUE, featureFraction,
|
trainers.add(new CARTClassificationTrainer(Integer.MAX_VALUE, featureFraction,
|
||||||
ThreadLocalRandom.current().nextLong()));
|
ThreadLocalRandom.current().nextLong()));
|
||||||
@@ -371,7 +371,7 @@ public class RandomForestTrainingTask extends Task {
|
|||||||
new VotingCombiner());
|
new VotingCombiner());
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Msg.error(this, "Exception while training model: " + e.getMessage());
|
Msg.error(this, "Exception while training model: " + e.getMessage());
|
||||||
}
|
}
|
||||||
return randomForest;
|
return randomForest;
|
||||||
@@ -411,7 +411,7 @@ public class RandomForestTrainingTask extends Task {
|
|||||||
RandomForestFunctionFinderPlugin.FUNC_START, errors);
|
RandomForestFunctionFinderPlugin.FUNC_START, errors);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Msg.error(this,
|
Msg.error(this,
|
||||||
"Exception while evaluating model on known function starts: " + e.getMessage());
|
"Exception while evaluating model on known function starts: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -430,7 +430,7 @@ public class RandomForestTrainingTask extends Task {
|
|||||||
RandomForestFunctionFinderPlugin.NON_START, errors);
|
RandomForestFunctionFinderPlugin.NON_START, errors);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Msg.error(this,
|
Msg.error(this,
|
||||||
"Exception while evaluating model on known function interiors: " + e.getMessage());
|
"Exception while evaluating model on known function interiors: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ public class RandomSubsetUtils {
|
|||||||
int addressesVisited = 0;
|
int addressesVisited = 0;
|
||||||
int listIndex = 0;
|
int listIndex = 0;
|
||||||
while (iter.hasNext() && addressesAdded < k) {
|
while (iter.hasNext() && addressesAdded < k) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = iter.next();
|
Address addr = iter.next();
|
||||||
if (sortedRandom.get(listIndex) == addressesVisited) {
|
if (sortedRandom.get(listIndex) == addressesVisited) {
|
||||||
randomAddresses.add(addr);
|
randomAddresses.add(addr);
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ public class BasicBlockCounterFunctionAlgorithm implements FunctionAlgorithm {
|
|||||||
|
|
||||||
int blockCount = 0;
|
int blockCount = 0;
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
iterator.next();
|
iterator.next();
|
||||||
blockCount++;
|
blockCount++;
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ public class ReferenceFunctionAlgorithm implements FunctionAlgorithm {
|
|||||||
AddressIterator iterator = referenceManager.getReferenceSourceIterator(body, true);
|
AddressIterator iterator = referenceManager.getReferenceSourceIterator(body, true);
|
||||||
int referenceCount = 0;
|
int referenceCount = 0;
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address address = iterator.next();
|
Address address = iterator.next();
|
||||||
Reference[] referencesFrom = referenceManager.getReferencesFrom(address);
|
Reference[] referencesFrom = referenceManager.getReferencesFrom(address);
|
||||||
referenceCount += referencesFrom.length;
|
referenceCount += referencesFrom.length;
|
||||||
|
|||||||
+1
-2
@@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -35,7 +34,7 @@ public class SampleSearcher {
|
|||||||
monitor.initialize(program.getFunctionManager().getFunctionCount());
|
monitor.initialize(program.getFunctionManager().getFunctionCount());
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
if (monitor.isCancelled()) {
|
if (monitor.isCancelled()) {
|
||||||
monitor.clearCanceled(); //otherwise the partial results won't be shown
|
monitor.clearCancelled(); //otherwise the partial results won't be shown
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Function fun = it.next();
|
Function fun = it.next();
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class CompareSleighExternal extends GhidraScript {
|
|||||||
|
|
||||||
long align = currentProgram.getLanguage().getInstructionAlignment();
|
long align = currentProgram.getLanguage().getInstructionAlignment();
|
||||||
while (addresses.hasNext()) {
|
while (addresses.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address addr = addresses.next();
|
Address addr = addresses.next();
|
||||||
|
|
||||||
completed++;
|
completed++;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class ConsistencyCheck extends GhidraScript {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (!df.canSave() || !currentProgram.hasExclusiveAccess()) {
|
if (!df.canSave() || !currentProgram.hasExclusiveAccess()) {
|
||||||
popup("Program database is NOT consistent!\nRebuild requires exclusive checkout.");
|
popup("Program database is NOT consistent!\nRebuild requires exclusive checkout.");
|
||||||
@@ -72,7 +72,7 @@ public class ConsistencyCheck extends GhidraScript {
|
|||||||
|
|
||||||
programMgr.closeProgram(currentProgram, true);
|
programMgr.closeProgram(currentProgram, true);
|
||||||
|
|
||||||
monitor.clearCanceled(); // compensate for Script Manager cancelling task on program close
|
monitor.clearCancelled(); // compensate for Script Manager cancelling task on program close
|
||||||
|
|
||||||
dbh = program.getDBHandle();
|
dbh = program.getDBHandle();
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -98,7 +97,7 @@ public class MoveMemoryRangeContents extends GhidraScript {
|
|||||||
monitor.setMessage("Clearing old symbols...");
|
monitor.setMessage("Clearing old symbols...");
|
||||||
SymbolIterator symIter = program.getSymbolTable().getSymbolIterator(destStart, true);
|
SymbolIterator symIter = program.getSymbolTable().getSymbolIterator(destStart, true);
|
||||||
while (symIter.hasNext()) {
|
while (symIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Symbol sym = symIter.next();
|
Symbol sym = symIter.next();
|
||||||
if (sym.getAddress().compareTo(destEnd) > 0) {
|
if (sym.getAddress().compareTo(destEnd) > 0) {
|
||||||
break;
|
break;
|
||||||
@@ -118,7 +117,7 @@ public class MoveMemoryRangeContents extends GhidraScript {
|
|||||||
Address srcAddr = srcStart;
|
Address srcAddr = srcStart;
|
||||||
Address destAddr = destStart;
|
Address destAddr = destStart;
|
||||||
while (true) {
|
while (true) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
int cnt = program.getMemory().getBytes(srcAddr, bytes, 0, Math.min(len, bytes.length));
|
int cnt = program.getMemory().getBytes(srcAddr, bytes, 0, Math.min(len, bytes.length));
|
||||||
currentProgram.getMemory().setBytes(destAddr, bytes, 0, cnt);
|
currentProgram.getMemory().setBytes(destAddr, bytes, 0, cnt);
|
||||||
len -= cnt;
|
len -= cnt;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class AssociateExternalPELibrariesScript extends GhidraScript {
|
|||||||
String[] externalLibraryNames = externalManager.getExternalLibraryNames();
|
String[] externalLibraryNames = externalManager.getExternalLibraryNames();
|
||||||
|
|
||||||
for (String name : externalLibraryNames) {
|
for (String name : externalLibraryNames) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
List<DomainFile> ciLibraries = getProgramsCaseInsensitive(name, libraries);
|
List<DomainFile> ciLibraries = getProgramsCaseInsensitive(name, libraries);
|
||||||
if (ciLibraries.isEmpty()) {
|
if (ciLibraries.isEmpty()) {
|
||||||
@@ -83,7 +83,7 @@ public class AssociateExternalPELibrariesScript extends GhidraScript {
|
|||||||
List<DomainFile> matchingFiles = new ArrayList<DomainFile>();
|
List<DomainFile> matchingFiles = new ArrayList<DomainFile>();
|
||||||
|
|
||||||
for (DomainFile file : projectFiles) {
|
for (DomainFile file : projectFiles) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (!file.getName().equalsIgnoreCase(name)) {
|
if (!file.getName().equalsIgnoreCase(name)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class CallotherCensusScript extends GhidraScript {
|
|||||||
|
|
||||||
InstructionIterator instIter = currentProgram.getListing().getInstructions(true);
|
InstructionIterator instIter = currentProgram.getListing().getInstructions(true);
|
||||||
while (instIter.hasNext()) {
|
while (instIter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Instruction inst = instIter.next();
|
Instruction inst = instIter.next();
|
||||||
for (PcodeOp op : inst.getPcode()) {
|
for (PcodeOp op : inst.getPcode()) {
|
||||||
if (op.getOpcode() == PcodeOp.CALLOTHER) {
|
if (op.getOpcode() == PcodeOp.CALLOTHER) {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class CreateHelpTemplateScript extends GhidraScript {
|
|||||||
printWriter.println("<blockquote>");
|
printWriter.println("<blockquote>");
|
||||||
List<DockingActionIf> actions = getActions(tool, plugin);
|
List<DockingActionIf> actions = getActions(tool, plugin);
|
||||||
for (DockingActionIf action : actions) {
|
for (DockingActionIf action : actions) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
printWriter.println("\t" + "<h3><A name=\"" + action.getName().replace(' ', '_') +
|
printWriter.println("\t" + "<h3><A name=\"" + action.getName().replace(' ', '_') +
|
||||||
"\"></A>" + action.getName() + "</h3>");
|
"\"></A>" + action.getName() + "</h3>");
|
||||||
printWriter.println("\t\t" + "<blockquote>");
|
printWriter.println("\t\t" + "<blockquote>");
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class CreateRelocationBasedOperandReferences extends GhidraScript {
|
|||||||
int refCount = 0;
|
int refCount = 0;
|
||||||
|
|
||||||
while (relocations.hasNext()) {
|
while (relocations.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Relocation r = relocations.next();
|
Relocation r = relocations.next();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class EditBytesScript extends GhidraScript {
|
|||||||
boolean containedInBlock = false;
|
boolean containedInBlock = false;
|
||||||
|
|
||||||
while (containedInBlock == false) {
|
while (containedInBlock == false) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
newBytes = askBytes("Replace Bytes", "Replace bytes at cursor with:");
|
newBytes = askBytes("Replace Bytes", "Replace bytes at cursor with:");
|
||||||
endAddr = currentLocation.getByteAddress().add(newBytes.length - 1);
|
endAddr = currentLocation.getByteAddress().add(newBytes.length - 1);
|
||||||
activeAddr = currentLocation.getByteAddress();
|
activeAddr = currentLocation.getByteAddress();
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class ExportProgramScript extends GhidraScript {
|
|||||||
RelocationTable relocTable = currentProgram.getRelocationTable();
|
RelocationTable relocTable = currentProgram.getRelocationTable();
|
||||||
Iterator<Relocation> iter = relocTable.getRelocations();
|
Iterator<Relocation> iter = relocTable.getRelocations();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Relocation reloc = iter.next();
|
Relocation reloc = iter.next();
|
||||||
Address relocStart = reloc.getAddress();
|
Address relocStart = reloc.getAddress();
|
||||||
@@ -102,7 +102,7 @@ public class ExportProgramScript extends GhidraScript {
|
|||||||
// the original
|
// the original
|
||||||
for (long i = 0; i < size; i++) {
|
for (long i = 0; i < size; i++) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
byte originalByte = fileBytes.getOriginalByte(i);
|
byte originalByte = fileBytes.getOriginalByte(i);
|
||||||
byte currentByte = fileBytes.getModifiedByte(i);
|
byte currentByte = fileBytes.getModifiedByte(i);
|
||||||
@@ -158,7 +158,7 @@ public class ExportProgramScript extends GhidraScript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Address address : list) {
|
for (Address address : list) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (set.contains(address)) {
|
if (set.contains(address)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class ExtractELFDebugFilesScript extends GhidraScript {
|
|||||||
void processDir(GFile dir, File destDir) throws IOException, CancelledException {
|
void processDir(GFile dir, File destDir) throws IOException, CancelledException {
|
||||||
List<GFile> listing = dir.getListing();
|
List<GFile> listing = dir.getListing();
|
||||||
for (GFile file : listing) {
|
for (GFile file : listing) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ public class ExtractELFDebugFilesScript extends GhidraScript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (GFile file : listing) {
|
for (GFile file : listing) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
processDir(file, destDir);
|
processDir(file, destDir);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
String newCategoryName = new String();
|
String newCategoryName = new String();
|
||||||
while (index < categoryName.length()) {
|
while (index < categoryName.length()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (categoryName.substring(index).startsWith("::") && !insideBrackets) {
|
if (categoryName.substring(index).startsWith("::") && !insideBrackets) {
|
||||||
newCategoryName = newCategoryName.concat("/");
|
newCategoryName = newCategoryName.concat("/");
|
||||||
@@ -453,7 +453,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
SymbolIterator symbols = symbolTable.getSymbolIterator("*" + string1 + "*", true);
|
SymbolIterator symbols = symbolTable.getSymbolIterator("*" + string1 + "*", true);
|
||||||
|
|
||||||
while (symbols.hasNext()) {
|
while (symbols.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Symbol symbol = symbols.next();
|
Symbol symbol = symbols.next();
|
||||||
Address symbolAddress = symbol.getAddress();
|
Address symbolAddress = symbol.getAddress();
|
||||||
|
|
||||||
@@ -483,7 +483,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
|
|
||||||
SymbolIterator symbols = symbolTable.getSymbols(symbolName);
|
SymbolIterator symbols = symbolTable.getSymbols(symbolName);
|
||||||
while (symbols.hasNext()) {
|
while (symbols.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Symbol symbol = symbols.next();
|
Symbol symbol = symbols.next();
|
||||||
if (symbol.getParentNamespace().getName().equals(namespaceName)) {
|
if (symbol.getParentNamespace().getName().equals(namespaceName)) {
|
||||||
Namespace namespace = symbol.getParentNamespace();
|
Namespace namespace = symbol.getParentNamespace();
|
||||||
@@ -519,7 +519,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
Iterator<Symbol> typeinfoIterator = typeinfoSymbols.iterator();
|
Iterator<Symbol> typeinfoIterator = typeinfoSymbols.iterator();
|
||||||
while (typeinfoIterator.hasNext()) {
|
while (typeinfoIterator.hasNext()) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Symbol typeinfoSymbol = typeinfoIterator.next();
|
Symbol typeinfoSymbol = typeinfoIterator.next();
|
||||||
Address typeinfoAddress = typeinfoSymbol.getAddress();
|
Address typeinfoAddress = typeinfoSymbol.getAddress();
|
||||||
@@ -696,7 +696,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
Iterator<Symbol> vtableIterator = listOfVtableSymbols.iterator();
|
Iterator<Symbol> vtableIterator = listOfVtableSymbols.iterator();
|
||||||
while (vtableIterator.hasNext()) {
|
while (vtableIterator.hasNext()) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Symbol vtableSymbol = vtableIterator.next();
|
Symbol vtableSymbol = vtableIterator.next();
|
||||||
Namespace vtableNamespace = vtableSymbol.getParentNamespace();
|
Namespace vtableNamespace = vtableSymbol.getParentNamespace();
|
||||||
@@ -949,7 +949,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
try {
|
try {
|
||||||
while (index < numZeros) {
|
while (index < numZeros) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (getByte(address.add(index)) != 0x00) {
|
if (getByte(address.add(index)) != 0x00) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1220,7 +1220,7 @@ public class GccRttiAnalysisScript extends GhidraScript {
|
|||||||
SymbolIterator symbols = symbolTable.getSymbols(addressSet, SymbolType.LABEL, true);
|
SymbolIterator symbols = symbolTable.getSymbols(addressSet, SymbolType.LABEL, true);
|
||||||
|
|
||||||
while (symbols.hasNext()) {
|
while (symbols.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Symbol symbol = symbols.next();
|
Symbol symbol = symbols.next();
|
||||||
if (exact && symbol.getName().equals(symbolName)) {
|
if (exact && symbol.getName().equals(symbolName)) {
|
||||||
symbolsInSet.add(symbol);
|
symbolsInSet.add(symbol);
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ public class GraphClassesScript extends GhidraScript {
|
|||||||
private void getClassStructures(Category[] categories) throws CancelledException {
|
private void getClassStructures(Category[] categories) throws CancelledException {
|
||||||
|
|
||||||
for (Category category : categories) {
|
for (Category category : categories) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
DataType[] dataTypes = category.getDataTypes();
|
DataType[] dataTypes = category.getDataTypes();
|
||||||
for (DataType dataType : dataTypes) {
|
for (DataType dataType : dataTypes) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (dataType.getName().equals(category.getName()) &&
|
if (dataType.getName().equals(category.getName()) &&
|
||||||
dataType instanceof Structure) {
|
dataType instanceof Structure) {
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ public class GraphClassesScript extends GhidraScript {
|
|||||||
|
|
||||||
for (Structure classStructure : classStructures) {
|
for (Structure classStructure : classStructures) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
String description = classStructure.getDescription();
|
String description = classStructure.getDescription();
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ public class GraphClassesScript extends GhidraScript {
|
|||||||
DataTypeComponent[] components = childStructure.getComponents();
|
DataTypeComponent[] components = childStructure.getComponents();
|
||||||
for (DataTypeComponent component : components) {
|
for (DataTypeComponent component : components) {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
DataType componentDataType = component.getDataType();
|
DataType componentDataType = component.getDataType();
|
||||||
if (componentDataType instanceof Structure &&
|
if (componentDataType instanceof Structure &&
|
||||||
componentDataType.getName().equals(parentName)) {
|
componentDataType.getName().equals(parentName)) {
|
||||||
@@ -291,7 +291,7 @@ public class GraphClassesScript extends GhidraScript {
|
|||||||
|
|
||||||
List<Structure> parentStructures = new ArrayList<>();
|
List<Structure> parentStructures = new ArrayList<>();
|
||||||
for (Structure classStructure : classStructures) {
|
for (Structure classStructure : classStructures) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
if (classStructure.getName().equals(parentName)) {
|
if (classStructure.getName().equals(parentName)) {
|
||||||
parentStructures.add(classStructure);
|
parentStructures.add(classStructure);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class MarkCallOtherPcode extends GhidraScript {
|
|||||||
|
|
||||||
InstructionIterator instructions = currentProgram.getListing().getInstructions(set, true);
|
InstructionIterator instructions = currentProgram.getListing().getInstructions(set, true);
|
||||||
while (instructions.hasNext()) {
|
while (instructions.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Instruction instr = instructions.next();
|
Instruction instr = instructions.next();
|
||||||
|
|
||||||
PcodeOp[] pcode = instr.getPcode();
|
PcodeOp[] pcode = instr.getPcode();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class MarkUnimplementedPcode extends GhidraScript {
|
|||||||
|
|
||||||
InstructionIterator instructions = currentProgram.getListing().getInstructions(set, true);
|
InstructionIterator instructions = currentProgram.getListing().getInstructions(set, true);
|
||||||
while (instructions.hasNext()) {
|
while (instructions.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Instruction instr = instructions.next();
|
Instruction instr = instructions.next();
|
||||||
|
|
||||||
PcodeOp[] pcode = instr.getPcode();
|
PcodeOp[] pcode = instr.getPcode();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class ProgressExampleScript extends GhidraScript {
|
|||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
// Note: any script wishing to be responsive to a cancellation from the GUI needs to
|
// Note: any script wishing to be responsive to a cancellation from the GUI needs to
|
||||||
// call checkCancelled()
|
// call checkCancelled()
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Thread.sleep(1000); // pause a bit so we can see progress
|
Thread.sleep(1000); // pause a bit so we can see progress
|
||||||
|
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class PropagateX86ConstantReferences extends GhidraScript {
|
|||||||
tableSizeMax = 64;
|
tableSizeMax = 64;
|
||||||
tableIndexOffset = 0;
|
tableIndexOffset = 0;
|
||||||
for (long assume = 0; assume < tableSizeMax; assume++) {
|
for (long assume = 0; assume < tableSizeMax; assume++) {
|
||||||
assumeValue = new Long(assume);
|
assumeValue = Long.valueOf(assume);
|
||||||
hitTheGuard = false;
|
hitTheGuard = false;
|
||||||
|
|
||||||
symEval.flowConstants(branchSet.getMinAddress(), branchSet, eval, false,
|
symEval.flowConstants(branchSet.getMinAddress(), branchSet, eval, false,
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class RemoveUserCheckoutsScript extends GhidraScript {
|
|||||||
private int removeCheckouts(RepositoryAdapter repository, String folderPath, String uid, TaskMonitor monitor) throws IOException, CancelledException {
|
private int removeCheckouts(RepositoryAdapter repository, String folderPath, String uid, TaskMonitor monitor) throws IOException, CancelledException {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (RepositoryItem item : repository.getItemList(folderPath)) {
|
for (RepositoryItem item : repository.getItemList(folderPath)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += removeCheckouts(repository, item, uid);
|
count += removeCheckouts(repository, item, uid);
|
||||||
}
|
}
|
||||||
for (String subfolder : repository.getSubfolderList(folderPath)) {
|
for (String subfolder : repository.getSubfolderList(folderPath)) {
|
||||||
|
|||||||
@@ -104,11 +104,11 @@ public class RepositoryFileUpgradeScript extends GhidraScript {
|
|||||||
private int listCheckouts(DomainFolder folder) throws IOException, CancelledException {
|
private int listCheckouts(DomainFolder folder) throws IOException, CancelledException {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (DomainFile df : folder.getFiles()) {
|
for (DomainFile df : folder.getFiles()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += listCheckouts(df);
|
count += listCheckouts(df);
|
||||||
}
|
}
|
||||||
for (DomainFolder subfolder : folder.getFolders()) {
|
for (DomainFolder subfolder : folder.getFolders()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += listCheckouts(subfolder);
|
count += listCheckouts(subfolder);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
@@ -130,13 +130,13 @@ public class RepositoryFileUpgradeScript extends GhidraScript {
|
|||||||
private int performProgramUpgrades(DomainFolder folder) throws IOException, CancelledException {
|
private int performProgramUpgrades(DomainFolder folder) throws IOException, CancelledException {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (DomainFile df : folder.getFiles()) {
|
for (DomainFile df : folder.getFiles()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (performProgramUpgrade(df)) {
|
if (performProgramUpgrade(df)) {
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (DomainFolder subfolder : folder.getFolders()) {
|
for (DomainFolder subfolder : folder.getFolders()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
count += performProgramUpgrades(subfolder);
|
count += performProgramUpgrades(subfolder);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ public class ResolveX86orX64LinuxSyscallsScript extends GhidraScript {
|
|||||||
TaskMonitor tMonitor) throws CancelledException {
|
TaskMonitor tMonitor) throws CancelledException {
|
||||||
Map<Function, Set<Address>> funcsToCalls = new HashMap<>();
|
Map<Function, Set<Address>> funcsToCalls = new HashMap<>();
|
||||||
for (Function func : program.getFunctionManager().getFunctionsNoStubs(true)) {
|
for (Function func : program.getFunctionManager().getFunctionsNoStubs(true)) {
|
||||||
tMonitor.checkCanceled();
|
tMonitor.checkCancelled();
|
||||||
for (Instruction inst : program.getListing().getInstructions(func.getBody(), true)) {
|
for (Instruction inst : program.getListing().getInstructions(func.getBody(), true)) {
|
||||||
if (tester.test(inst)) {
|
if (tester.test(inst)) {
|
||||||
Set<Address> callSites = funcsToCalls.get(func);
|
Set<Address> callSites = funcsToCalls.get(func);
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ public class SearchBaseExtended extends GhidraScript {
|
|||||||
private boolean containsOnBit(byte[] array) {
|
private boolean containsOnBit(byte[] array) {
|
||||||
|
|
||||||
for (byte element : array) {
|
for (byte element : array) {
|
||||||
Byte temp = new Byte(element);
|
Byte temp = Byte.valueOf(element);
|
||||||
int value = temp.intValue();
|
int value = temp.intValue();
|
||||||
if (value != 0) {
|
if (value != 0) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class SearchForImageBaseOffsets extends GhidraScript {
|
|||||||
byte byteArray[] = new byte[numBytes];
|
byte byteArray[] = new byte[numBytes];
|
||||||
|
|
||||||
for (int i = 0; i < numBytes; i++) {
|
for (int i = 0; i < numBytes; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
byteArray[i] = (byte) (value >> (8 * i) & 0xff);
|
byteArray[i] = (byte) (value >> (8 * i) & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ public class SearchForImageBaseOffsets extends GhidraScript {
|
|||||||
Address start = currentProgram.getMinAddress();
|
Address start = currentProgram.getMinAddress();
|
||||||
Address found = find(start, byteArray);
|
Address found = find(start, byteArray);
|
||||||
while (found != null) {
|
while (found != null) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
println(found.toString());
|
println(found.toString());
|
||||||
start = found.add(1);
|
start = found.add(1);
|
||||||
found = find(start, byteArray);
|
found = find(start, byteArray);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class SearchForImageBaseOffsetsScript extends GhidraScript {
|
|||||||
byte byteArray[] = new byte[numBytes];
|
byte byteArray[] = new byte[numBytes];
|
||||||
|
|
||||||
for (int i = 0; i < numBytes; i++) {
|
for (int i = 0; i < numBytes; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
byteArray[i] = (byte) (value >> (BITS_PER_BYTE * i) & BYTE_MASK);
|
byteArray[i] = (byte) (value >> (BITS_PER_BYTE * i) & BYTE_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ public class SearchForImageBaseOffsetsScript extends GhidraScript {
|
|||||||
byte byteArray[] = new byte[numBytes];
|
byte byteArray[] = new byte[numBytes];
|
||||||
|
|
||||||
for (int i = 0; i < numBytes; i++) {
|
for (int i = 0; i < numBytes; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
byteArray[i] = (byte) (value >> (8 * (numBytes - (i + 1))) & 0xff);
|
byteArray[i] = (byte) (value >> (8 * (numBytes - (i + 1))) & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ public class SearchForImageBaseOffsetsScript extends GhidraScript {
|
|||||||
Address start = currentProgram.getMinAddress();
|
Address start = currentProgram.getMinAddress();
|
||||||
Address found = find(start, byteArray);
|
Address found = find(start, byteArray);
|
||||||
while (found != null) {
|
while (found != null) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
addressSet.add(found);
|
addressSet.add(found);
|
||||||
start = found.add(1);
|
start = found.add(1);
|
||||||
found = find(start, byteArray);
|
found = find(start, byteArray);
|
||||||
@@ -153,7 +153,7 @@ public class SearchForImageBaseOffsetsScript extends GhidraScript {
|
|||||||
|
|
||||||
AddressIterator addresses = addressSet.getAddresses(true);
|
AddressIterator addresses = addressSet.getAddresses(true);
|
||||||
while (addresses.hasNext()) {
|
while (addresses.hasNext()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Address address = addresses.next();
|
Address address = addresses.next();
|
||||||
println(address.toString());
|
println(address.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -141,7 +141,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
|
|
||||||
ElfSectionHeader[] stringSections = elf.getSections(ElfSectionHeaderConstants.SHT_STRTAB);
|
ElfSectionHeader[] stringSections = elf.getSections(ElfSectionHeaderConstants.SHT_STRTAB);
|
||||||
for (ElfSectionHeader stringSection : stringSections) {
|
for (ElfSectionHeader stringSection : stringSections) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
try {
|
try {
|
||||||
Address addr = addr(stringSection.getOffset());
|
Address addr = addr(stringSection.getOffset());
|
||||||
Address maxAddr = addr.addNoWrap(stringSection.getSize() - 1);
|
Address maxAddr = addr.addNoWrap(stringSection.getSize() - 1);
|
||||||
@@ -176,7 +176,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
private void processSectionHeaders(ElfHeader elf, Listing listing) throws Exception {
|
private void processSectionHeaders(ElfHeader elf, Listing listing) throws Exception {
|
||||||
ElfSectionHeader[] sections = elf.getSections();
|
ElfSectionHeader[] sections = elf.getSections();
|
||||||
for (int i = 0; i < sections.length; i++) {
|
for (int i = 0; i < sections.length; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
String name = sections[i].getNameAsString();
|
String name = sections[i].getNameAsString();
|
||||||
|
|
||||||
DataType sectionDT = sections[i].toDataType();
|
DataType sectionDT = sections[i].toDataType();
|
||||||
@@ -229,7 +229,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
|
|
||||||
ElfProgramHeader[] programHeaders = elf.getProgramHeaders();
|
ElfProgramHeader[] programHeaders = elf.getProgramHeaders();
|
||||||
for (int i = 0; i < programHeaders.length; i++) {
|
for (int i = 0; i < programHeaders.length; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
Data d = array.getComponent(i);
|
Data d = array.getComponent(i);
|
||||||
d.setComment(CodeUnit.EOL_COMMENT, programHeaders[i].getComment());
|
d.setComment(CodeUnit.EOL_COMMENT, programHeaders[i].getComment());
|
||||||
|
|
||||||
@@ -243,7 +243,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
for (ElfProgramHeader programHeader : elf.getProgramHeaders(
|
for (ElfProgramHeader programHeader : elf.getProgramHeaders(
|
||||||
ElfProgramHeaderConstants.PT_INTERP)) {
|
ElfProgramHeaderConstants.PT_INTERP)) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
long offset = programHeader.getOffset();
|
long offset = programHeader.getOffset();
|
||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
Msg.warn(this, " Dynamic table appears to have been stripped from binary");
|
Msg.warn(this, " Dynamic table appears to have been stripped from binary");
|
||||||
@@ -281,7 +281,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
BinaryReader reader = new BinaryReader(provider, !program.getMemory().isBigEndian());
|
BinaryReader reader = new BinaryReader(provider, !program.getMemory().isBigEndian());
|
||||||
|
|
||||||
for (int i = 0; i < dynamics.length; i++) {
|
for (int i = 0; i < dynamics.length; i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Data dynamicData = dynamicTableData.getComponent(i);
|
Data dynamicData = dynamicTableData.getComponent(i);
|
||||||
if (dynamicData == null) {
|
if (dynamicData == null) {
|
||||||
@@ -360,7 +360,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
|
|
||||||
ElfSymbolTable[] symbolTables = elf.getSymbolTables();
|
ElfSymbolTable[] symbolTables = elf.getSymbolTables();
|
||||||
for (ElfSymbolTable symbolTable2 : symbolTables) {
|
for (ElfSymbolTable symbolTable2 : symbolTables) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
Address symbolTableAddr = addr(symbolTable2.getFileOffset());
|
Address symbolTableAddr = addr(symbolTable2.getFileOffset());
|
||||||
|
|
||||||
@@ -406,7 +406,7 @@ public class ElfBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
monitor.setMessage("Processing relocation tables...");
|
monitor.setMessage("Processing relocation tables...");
|
||||||
ElfRelocationTable[] relocationTables = elf.getRelocationTables();
|
ElfRelocationTable[] relocationTables = elf.getRelocationTables();
|
||||||
for (ElfRelocationTable relocationTable : relocationTables) {
|
for (ElfRelocationTable relocationTable : relocationTables) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
ElfSectionHeader relocationSection = relocationTable.getTableSectionHeader();
|
ElfSectionHeader relocationSection = relocationTable.getTableSectionHeader();
|
||||||
String relocSectionName = "<section-not-found>";
|
String relocSectionName = "<section-not-found>";
|
||||||
if (relocationSection != null) {
|
if (relocationSection != null) {
|
||||||
|
|||||||
+3
-3
@@ -189,7 +189,7 @@ public class ApplyFunctionDataTypesCmd extends BackgroundCommand {
|
|||||||
|
|
||||||
monitor.initialize(functionNameMap.size());
|
monitor.initialize(functionNameMap.size());
|
||||||
for (String functionName : functionNameMap.keySet()) {
|
for (String functionName : functionNameMap.keySet()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
FunctionDefinition fdef = functionNameMap.get(functionName);
|
FunctionDefinition fdef = functionNameMap.get(functionName);
|
||||||
checkForSymbol(monitor, functionName, fdef, symbolMap, null);
|
checkForSymbol(monitor, functionName, fdef, symbolMap, null);
|
||||||
@@ -205,10 +205,10 @@ public class ApplyFunctionDataTypesCmd extends BackgroundCommand {
|
|||||||
private void collectFunctionDefinitions(Category cat, TaskMonitor monitor,
|
private void collectFunctionDefinitions(Category cat, TaskMonitor monitor,
|
||||||
Map<String, FunctionDefinition> functionNameMap) throws CancelledException {
|
Map<String, FunctionDefinition> functionNameMap) throws CancelledException {
|
||||||
|
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
|
|
||||||
for (DataType dt : cat.getDataTypes()) {
|
for (DataType dt : cat.getDataTypes()) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCancelled();
|
||||||
if (!(dt instanceof FunctionDefinition)) {
|
if (!(dt instanceof FunctionDefinition)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user