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