mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-0: Fixing raw type warnings
This commit is contained in:
parent
a6cd5b5dbc
commit
0cbf33d074
58 changed files with 241 additions and 241 deletions
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -233,7 +233,8 @@ public enum BackgroundUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void executeBackground(Runnable command) {
|
protected void executeBackground(Runnable command) {
|
||||||
BackgroundCommand cmd = new BackgroundCommand(name, opts.contains(TaskOpt.HAS_PROGRESS),
|
BackgroundCommand<DomainObject> cmd =
|
||||||
|
new BackgroundCommand<>(name, opts.contains(TaskOpt.HAS_PROGRESS),
|
||||||
opts.contains(TaskOpt.CAN_CANCEL), opts.contains(TaskOpt.IS_MODAL)) {
|
opts.contains(TaskOpt.CAN_CANCEL), opts.contains(TaskOpt.IS_MODAL)) {
|
||||||
@Override
|
@Override
|
||||||
public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
|
public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -21,6 +21,7 @@ import ghidra.app.cmd.label.RenameLabelCmd;
|
||||||
import ghidra.app.script.GhidraScript;
|
import ghidra.app.script.GhidraScript;
|
||||||
import ghidra.framework.cmd.CompoundCmd;
|
import ghidra.framework.cmd.CompoundCmd;
|
||||||
import ghidra.program.model.address.*;
|
import ghidra.program.model.address.*;
|
||||||
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.program.model.symbol.*;
|
import ghidra.program.model.symbol.*;
|
||||||
|
|
||||||
public class AutoRenameLabelsScript extends GhidraScript {
|
public class AutoRenameLabelsScript extends GhidraScript {
|
||||||
|
@ -45,7 +46,7 @@ public class AutoRenameLabelsScript extends GhidraScript {
|
||||||
|
|
||||||
SymbolTable symbolTable = currentProgram.getSymbolTable();
|
SymbolTable symbolTable = currentProgram.getSymbolTable();
|
||||||
AddressIterator it = view.getAddresses(true);
|
AddressIterator it = view.getAddresses(true);
|
||||||
CompoundCmd cmd = new CompoundCmd("Auto Rename Labels");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Auto Rename Labels");
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
Address address = it.next();
|
Address address = it.next();
|
||||||
Symbol primary = symbolTable.getPrimarySymbol(address);
|
Symbol primary = symbolTable.getPrimarySymbol(address);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -83,7 +83,7 @@ public class SetEquateScript extends GhidraScript {
|
||||||
// looking for was found
|
// looking for was found
|
||||||
|
|
||||||
// Sets the equate to the user defined name and execute
|
// Sets the equate to the user defined name and execute
|
||||||
Command cmd =
|
Command<Program> cmd =
|
||||||
new SetEquateCmd(equateName, tempValue.getAddress(), i, scalarValue);
|
new SetEquateCmd(equateName, tempValue.getAddress(), i, scalarValue);
|
||||||
state.getTool().execute(cmd, currentProgram);
|
state.getTool().execute(cmd, currentProgram);
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class ClearPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeUnit cu = program.getListing().getCodeUnitContaining(location.getAddress());
|
CodeUnit cu = program.getListing().getCodeUnitContaining(location.getAddress());
|
||||||
Command cmd = new ClearCmd(cu, options);
|
Command<Program> cmd = new ClearCmd(cu, options);
|
||||||
tool.execute(cmd, program);
|
tool.execute(cmd, program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -34,8 +34,7 @@ import ghidra.app.plugin.ProgramPlugin;
|
||||||
import ghidra.app.plugin.core.navigation.NavigationOptions;
|
import ghidra.app.plugin.core.navigation.NavigationOptions;
|
||||||
import ghidra.app.services.*;
|
import ghidra.app.services.*;
|
||||||
import ghidra.framework.cmd.Command;
|
import ghidra.framework.cmd.Command;
|
||||||
import ghidra.framework.model.DomainObjectChangedEvent;
|
import ghidra.framework.model.*;
|
||||||
import ghidra.framework.model.DomainObjectListener;
|
|
||||||
import ghidra.framework.options.SaveState;
|
import ghidra.framework.options.SaveState;
|
||||||
import ghidra.framework.plugintool.PluginInfo;
|
import ghidra.framework.plugintool.PluginInfo;
|
||||||
import ghidra.framework.plugintool.PluginTool;
|
import ghidra.framework.plugintool.PluginTool;
|
||||||
|
@ -191,7 +190,7 @@ public class ColorizingPlugin extends ProgramPlugin implements DomainObjectListe
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Command command = null;
|
Command<DomainObject> command = null;
|
||||||
ProgramSelection selection = listingContext.getSelection();
|
ProgramSelection selection = listingContext.getSelection();
|
||||||
if (selection != null && !selection.isEmpty()) {
|
if (selection != null && !selection.isEmpty()) {
|
||||||
command = new SetColorCommand(color, service, selection);
|
command = new SetColorCommand(color, service, selection);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -112,7 +112,7 @@ class CreateArrayAction extends ListingContextAction {
|
||||||
int maxNoConflictElements = getMaxNoConflictElements(struct, comp.getComponentIndex(), dt);
|
int maxNoConflictElements = getMaxNoConflictElements(struct, comp.getComponentIndex(), dt);
|
||||||
int numElements = getNumElements(dt, maxNoConflictElements, maxElements);
|
int numElements = getNumElements(dt, maxNoConflictElements, maxElements);
|
||||||
|
|
||||||
Command cmd = new CreateArrayInStructureCmd(addr, numElements, dt, compPath);
|
Command<Program> cmd = new CreateArrayInStructureCmd(addr, numElements, dt, compPath);
|
||||||
if (!tool.execute(cmd, program)) {
|
if (!tool.execute(cmd, program)) {
|
||||||
tool.setStatusInfo(cmd.getStatusMsg());
|
tool.setStatusInfo(cmd.getStatusMsg());
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ class CreateArrayAction extends ListingContextAction {
|
||||||
// Arrays currently use aligned-length only
|
// Arrays currently use aligned-length only
|
||||||
int numElements = length / dt.getAlignedLength();
|
int numElements = length / dt.getAlignedLength();
|
||||||
|
|
||||||
Command cmd = new CreateArrayInStructureCmd(from.getAddress(), numElements, dt,
|
Command<Program> cmd = new CreateArrayInStructureCmd(from.getAddress(), numElements, dt,
|
||||||
from.getComponentPath());
|
from.getComponentPath());
|
||||||
if (!tool.execute(cmd, program)) {
|
if (!tool.execute(cmd, program)) {
|
||||||
tool.setStatusInfo(cmd.getStatusMsg());
|
tool.setStatusInfo(cmd.getStatusMsg());
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -26,8 +26,7 @@ import ghidra.framework.cmd.BackgroundCommand;
|
||||||
import ghidra.program.model.address.Address;
|
import ghidra.program.model.address.Address;
|
||||||
import ghidra.program.model.data.CycleGroup;
|
import ghidra.program.model.data.CycleGroup;
|
||||||
import ghidra.program.model.data.DataType;
|
import ghidra.program.model.data.DataType;
|
||||||
import ghidra.program.model.listing.Data;
|
import ghidra.program.model.listing.*;
|
||||||
import ghidra.program.model.listing.Listing;
|
|
||||||
import ghidra.program.util.*;
|
import ghidra.program.util.*;
|
||||||
import ghidra.util.Msg;
|
import ghidra.util.Msg;
|
||||||
|
|
||||||
|
@ -83,7 +82,7 @@ public class CycleGroupAction extends ListingContextAction {
|
||||||
|
|
||||||
// Handle selection case
|
// Handle selection case
|
||||||
if (selection != null && !selection.isEmpty()) {
|
if (selection != null && !selection.isEmpty()) {
|
||||||
BackgroundCommand cmd = null;
|
BackgroundCommand<Program> cmd = null;
|
||||||
DataType dt = null;
|
DataType dt = null;
|
||||||
Address addr = selection.getMinAddress();
|
Address addr = selection.getMinAddress();
|
||||||
Data data = listing.getDataContaining(addr);
|
Data data = listing.getDataContaining(addr);
|
||||||
|
|
|
@ -206,7 +206,7 @@ public class EquateTablePlugin extends ProgramPlugin implements DomainObjectList
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isValid(oldEquate, newEquateName)) {
|
if (isValid(oldEquate, newEquateName)) {
|
||||||
Command cmd = new RenameEquatesCmd(oldEquateName, newEquateName);
|
Command<Program> cmd = new RenameEquatesCmd(oldEquateName, newEquateName);
|
||||||
tool.execute(cmd, currentProgram);
|
tool.execute(cmd, currentProgram);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.fallthrough;
|
package ghidra.app.plugin.core.fallthrough;
|
||||||
|
|
||||||
|
import javax.swing.event.ChangeEvent;
|
||||||
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
import ghidra.app.cmd.refs.ClearFallThroughCmd;
|
import ghidra.app.cmd.refs.ClearFallThroughCmd;
|
||||||
import ghidra.app.cmd.refs.SetFallThroughCmd;
|
import ghidra.app.cmd.refs.SetFallThroughCmd;
|
||||||
import ghidra.app.util.viewer.field.BrowserCodeUnitFormat;
|
import ghidra.app.util.viewer.field.BrowserCodeUnitFormat;
|
||||||
|
@ -23,9 +26,6 @@ import ghidra.framework.plugintool.PluginTool;
|
||||||
import ghidra.program.model.address.*;
|
import ghidra.program.model.address.*;
|
||||||
import ghidra.program.model.listing.*;
|
import ghidra.program.model.listing.*;
|
||||||
|
|
||||||
import javax.swing.event.ChangeEvent;
|
|
||||||
import javax.swing.event.ChangeListener;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is really a model for the FallThroughDialog state. However, it is used as a
|
* This class is really a model for the FallThroughDialog state. However, it is used as a
|
||||||
* convenience for executing the auto-override and clear-fallthrough actions.
|
* convenience for executing the auto-override and clear-fallthrough actions.
|
||||||
|
@ -187,7 +187,7 @@ class FallThroughModel implements ChangeListener {
|
||||||
* @param currentSelection
|
* @param currentSelection
|
||||||
*/
|
*/
|
||||||
void autoOverride(AddressSetView view) {
|
void autoOverride(AddressSetView view) {
|
||||||
CompoundCmd cmd = new CompoundCmd("Auto-Override");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Auto-Override");
|
||||||
AddressRangeIterator iter = view.getAddressRanges();
|
AddressRangeIterator iter = view.getAddressRanges();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
override(iter.next(), cmd);
|
override(iter.next(), cmd);
|
||||||
|
@ -200,7 +200,7 @@ class FallThroughModel implements ChangeListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearOverride(AddressSetView view) {
|
void clearOverride(AddressSetView view) {
|
||||||
CompoundCmd cmd = new CompoundCmd("Clear FallThroughs");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Clear FallThroughs");
|
||||||
InstructionIterator it = program.getListing().getInstructions(view, true);
|
InstructionIterator it = program.getListing().getInstructions(view, true);
|
||||||
while(it.hasNext()) {
|
while(it.hasNext()) {
|
||||||
Instruction inst = it.next();
|
Instruction inst = it.next();
|
||||||
|
@ -225,7 +225,7 @@ class FallThroughModel implements ChangeListener {
|
||||||
return program;
|
return program;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void override(AddressRange range, CompoundCmd cmd) {
|
private void override(AddressRange range, CompoundCmd<Program> cmd) {
|
||||||
Address min = range.getMinAddress();
|
Address min = range.getMinAddress();
|
||||||
Address max = range.getMaxAddress();
|
Address max = range.getMaxAddress();
|
||||||
Listing listing = program.getListing();
|
Listing listing = program.getListing();
|
||||||
|
@ -248,7 +248,7 @@ class FallThroughModel implements ChangeListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setFallThrough(Address addr, CompoundCmd cmd) {
|
private void setFallThrough(Address addr, CompoundCmd<Program> cmd) {
|
||||||
Instruction inst = program.getListing().getInstructionAfter(addr);
|
Instruction inst = program.getListing().getInstructionAfter(addr);
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
cmd.add(new SetFallThroughCmd(addr, inst.getMinAddress()));
|
cmd.add(new SetFallThroughCmd(addr, inst.getMinAddress()));
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -60,7 +60,7 @@ public class AddVarArgsAction extends ListingContextAction {
|
||||||
|
|
||||||
Function function = functionPlugin.getFunction(context);
|
Function function = functionPlugin.getFunction(context);
|
||||||
if ((function != null) && (!function.hasVarArgs())) {
|
if ((function != null) && (!function.hasVarArgs())) {
|
||||||
Command command = new SetFunctionVarArgsCommand(function, true);
|
Command<Program> command = new SetFunctionVarArgsCommand(function, true);
|
||||||
|
|
||||||
PluginTool tool = functionPlugin.getTool();
|
PluginTool tool = functionPlugin.getTool();
|
||||||
Program program = context.getProgram();
|
Program program = context.getProgram();
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -103,7 +103,7 @@ class AnalyzeStackRefsAction extends ListingContextAction {
|
||||||
|
|
||||||
doParameterAnalysis = options.getBoolean("Create Param Variables", doParameterAnalysis);
|
doParameterAnalysis = options.getBoolean("Create Param Variables", doParameterAnalysis);
|
||||||
|
|
||||||
BackgroundCommand cmd = null;
|
BackgroundCommand<Program> cmd = null;
|
||||||
if (doNewStackAnalysis) {
|
if (doNewStackAnalysis) {
|
||||||
cmd = new NewFunctionStackAnalysisCmd(funcSet, doParameterAnalysis, doLocalAnalysis,
|
cmd = new NewFunctionStackAnalysisCmd(funcSet, doParameterAnalysis, doLocalAnalysis,
|
||||||
true);
|
true);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -95,7 +95,7 @@ public class CreateExternalFunctionAction extends ProgramContextAction {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void actionPerformed(ProgramActionContext context) {
|
protected void actionPerformed(ProgramActionContext context) {
|
||||||
CompoundCmd compoundCmd = null;
|
CompoundCmd<Program> compoundCmd = null;
|
||||||
CreateExternalFunctionCmd cmd = null;
|
CreateExternalFunctionCmd cmd = null;
|
||||||
if (context instanceof ListingActionContext) {
|
if (context instanceof ListingActionContext) {
|
||||||
ListingActionContext listingContext = (ListingActionContext) context;
|
ListingActionContext listingContext = (ListingActionContext) context;
|
||||||
|
@ -107,7 +107,7 @@ public class CreateExternalFunctionAction extends ProgramContextAction {
|
||||||
CreateExternalFunctionCmd extFuncCmd = new CreateExternalFunctionCmd(s);
|
CreateExternalFunctionCmd extFuncCmd = new CreateExternalFunctionCmd(s);
|
||||||
if (cmd != null) {
|
if (cmd != null) {
|
||||||
if (compoundCmd == null) {
|
if (compoundCmd == null) {
|
||||||
compoundCmd = new CompoundCmd("Create External Functions");
|
compoundCmd = new CompoundCmd<>("Create External Functions");
|
||||||
compoundCmd.add(cmd);
|
compoundCmd.add(cmd);
|
||||||
}
|
}
|
||||||
compoundCmd.add(extFuncCmd);
|
compoundCmd.add(extFuncCmd);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -139,7 +139,7 @@ class CreateFunctionAction extends ListingContextAction {
|
||||||
funcPlugin.getTool().clearStatusInfo();
|
funcPlugin.getTool().clearStatusInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
BackgroundCommand cmd;
|
BackgroundCommand<Program> cmd;
|
||||||
if (createThunk) {
|
if (createThunk) {
|
||||||
cmd = getCreateThunkFunctionCmd(context.getProgram(), entry, body);
|
cmd = getCreateThunkFunctionCmd(context.getProgram(), entry, body);
|
||||||
if (cmd == null) {
|
if (cmd == null) {
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
/* ###
|
/* ###
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -16,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.function;
|
package ghidra.app.plugin.core.function;
|
||||||
|
|
||||||
|
import docking.action.MenuData;
|
||||||
import ghidra.app.cmd.function.SetFunctionVarArgsCommand;
|
import ghidra.app.cmd.function.SetFunctionVarArgsCommand;
|
||||||
import ghidra.app.context.ListingActionContext;
|
import ghidra.app.context.ListingActionContext;
|
||||||
import ghidra.app.context.ListingContextAction;
|
import ghidra.app.context.ListingContextAction;
|
||||||
|
@ -25,7 +25,6 @@ import ghidra.program.model.listing.Function;
|
||||||
import ghidra.program.model.listing.Program;
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.program.util.*;
|
import ghidra.program.util.*;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
import docking.action.MenuData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action that changes a Function so that it has VarArgs (a variable argument list).
|
* Action that changes a Function so that it has VarArgs (a variable argument list).
|
||||||
|
@ -62,7 +61,7 @@ public class DeleteVarArgsAction extends ListingContextAction {
|
||||||
public void actionPerformed(ListingActionContext context) {
|
public void actionPerformed(ListingActionContext context) {
|
||||||
Function function = functionPlugin.getFunction(context);
|
Function function = functionPlugin.getFunction(context);
|
||||||
if ((function != null) && (function.hasVarArgs())) {
|
if ((function != null) && (function.hasVarArgs())) {
|
||||||
Command command = new SetFunctionVarArgsCommand(function, false);
|
Command<Program> command = new SetFunctionVarArgsCommand(function, false);
|
||||||
|
|
||||||
PluginTool tool = functionPlugin.getTool();
|
PluginTool tool = functionPlugin.getTool();
|
||||||
Program program = context.getProgram();
|
Program program = context.getProgram();
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -84,7 +84,7 @@ public class EditFunctionPurgeAction extends ListingContextAction {
|
||||||
int newFunctionPurgeSize = numberInputDialog.getValue();
|
int newFunctionPurgeSize = numberInputDialog.getValue();
|
||||||
|
|
||||||
if (newFunctionPurgeSize != currentFunctionPurgeSize) {
|
if (newFunctionPurgeSize != currentFunctionPurgeSize) {
|
||||||
Command command = new SetFunctionPurgeCommand(function, newFunctionPurgeSize);
|
Command<Program> command = new SetFunctionPurgeCommand(function, newFunctionPurgeSize);
|
||||||
|
|
||||||
PluginTool tool = functionPlugin.getTool();
|
PluginTool tool = functionPlugin.getTool();
|
||||||
Program program = function.getProgram();
|
Program program = function.getProgram();
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
/* ###
|
/* ###
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -38,7 +37,7 @@ public class X86FunctionPurgeAnalyzer extends AbstractAnalyzer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean added(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log) {
|
public boolean added(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log) {
|
||||||
BackgroundCommand cmd;
|
BackgroundCommand<Program> cmd;
|
||||||
|
|
||||||
cmd = new FunctionPurgeAnalysisCmd(set);
|
cmd = new FunctionPurgeAnalysisCmd(set);
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -20,8 +20,7 @@ import java.util.Set;
|
||||||
import ghidra.app.cmd.function.RemoveFunctionTagCmd;
|
import ghidra.app.cmd.function.RemoveFunctionTagCmd;
|
||||||
import ghidra.framework.cmd.Command;
|
import ghidra.framework.cmd.Command;
|
||||||
import ghidra.framework.plugintool.PluginTool;
|
import ghidra.framework.plugintool.PluginTool;
|
||||||
import ghidra.program.model.listing.Function;
|
import ghidra.program.model.listing.*;
|
||||||
import ghidra.program.model.listing.FunctionTag;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a list of tags that have been assigned to the current function
|
* Displays a list of tags that have been assigned to the current function
|
||||||
|
@ -73,7 +72,8 @@ public class TargetTagsPanel extends TagListPanel {
|
||||||
public void removeSelectedTags() {
|
public void removeSelectedTags() {
|
||||||
Set<FunctionTag> selectedTags = getSelectedTags();
|
Set<FunctionTag> selectedTags = getSelectedTags();
|
||||||
for (FunctionTag tag : selectedTags) {
|
for (FunctionTag tag : selectedTags) {
|
||||||
Command cmd = new RemoveFunctionTagCmd(tag.getName(), function.getEntryPoint());
|
Command<Program> cmd =
|
||||||
|
new RemoveFunctionTagCmd(tag.getName(), function.getEntryPoint());
|
||||||
tool.execute(cmd, program);
|
tool.execute(cmd, program);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,8 @@ public class LabelMgrPlugin extends Plugin {
|
||||||
protected void removeLabelCallback(ListingActionContext context) {
|
protected void removeLabelCallback(ListingActionContext context) {
|
||||||
Symbol s = getSymbol(context);
|
Symbol s = getSymbol(context);
|
||||||
if (s != null) {
|
if (s != null) {
|
||||||
Command cmd = new DeleteLabelCmd(s.getAddress(), s.getName(), s.getParentNamespace());
|
Command<Program> cmd =
|
||||||
|
new DeleteLabelCmd(s.getAddress(), s.getName(), s.getParentNamespace());
|
||||||
|
|
||||||
if (!tool.execute(cmd, context.getProgram())) {
|
if (!tool.execute(cmd, context.getProgram())) {
|
||||||
tool.setStatusInfo(cmd.getStatusMsg());
|
tool.setStatusInfo(cmd.getStatusMsg());
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -94,7 +94,7 @@ public class OperandLabelDialog extends DialogComponentProvider {
|
||||||
Address symAddr = sym.getAddress();
|
Address symAddr = sym.getAddress();
|
||||||
Reference ref = refMgr.getReference(addr, symAddr, opIndex);
|
Reference ref = refMgr.getReference(addr, symAddr, opIndex);
|
||||||
|
|
||||||
CompoundCmd cmd = new CompoundCmd("Set Label");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Set Label");
|
||||||
Namespace scope = null;
|
Namespace scope = null;
|
||||||
|
|
||||||
Symbol newSym = findSymbol(symTable, currentLabel, symAddr);
|
Symbol newSym = findSymbol(symTable, currentLabel, symAddr);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -15,6 +15,11 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.module;
|
package ghidra.app.plugin.core.module;
|
||||||
|
|
||||||
|
import javax.swing.tree.TreePath;
|
||||||
|
|
||||||
|
import docking.ActionContext;
|
||||||
|
import docking.action.DockingAction;
|
||||||
|
import docking.action.MenuData;
|
||||||
import ghidra.app.CorePluginPackage;
|
import ghidra.app.CorePluginPackage;
|
||||||
import ghidra.app.cmd.module.RenameCmd;
|
import ghidra.app.cmd.module.RenameCmd;
|
||||||
import ghidra.app.context.ListingActionContext;
|
import ghidra.app.context.ListingActionContext;
|
||||||
|
@ -26,8 +31,9 @@ import ghidra.app.services.ProgramTreeService;
|
||||||
import ghidra.framework.cmd.CompoundCmd;
|
import ghidra.framework.cmd.CompoundCmd;
|
||||||
import ghidra.framework.plugintool.PluginInfo;
|
import ghidra.framework.plugintool.PluginInfo;
|
||||||
import ghidra.framework.plugintool.PluginTool;
|
import ghidra.framework.plugintool.PluginTool;
|
||||||
import ghidra.framework.plugintool.util.*;
|
import ghidra.framework.plugintool.util.PluginStatus;
|
||||||
import ghidra.program.model.address.Address;
|
import ghidra.program.model.address.Address;
|
||||||
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.program.model.listing.ProgramFragment;
|
import ghidra.program.model.listing.ProgramFragment;
|
||||||
import ghidra.program.model.symbol.Symbol;
|
import ghidra.program.model.symbol.Symbol;
|
||||||
import ghidra.program.model.symbol.SymbolTable;
|
import ghidra.program.model.symbol.SymbolTable;
|
||||||
|
@ -35,12 +41,6 @@ import ghidra.program.util.LabelFieldLocation;
|
||||||
import ghidra.program.util.ProgramLocation;
|
import ghidra.program.util.ProgramLocation;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
|
|
||||||
import javax.swing.tree.TreePath;
|
|
||||||
|
|
||||||
import docking.ActionContext;
|
|
||||||
import docking.action.DockingAction;
|
|
||||||
import docking.action.MenuData;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin provides the following Fragment rename actions:
|
* Plugin provides the following Fragment rename actions:
|
||||||
* 1. Automatically rename selected Program Fragments to match the
|
* 1. Automatically rename selected Program Fragments to match the
|
||||||
|
@ -113,7 +113,7 @@ public class AutoRenamePlugin extends ProgramPlugin {
|
||||||
if (obj instanceof ProgramNode) {
|
if (obj instanceof ProgramNode) {
|
||||||
ProgramNode node = (ProgramNode) obj;
|
ProgramNode node = (ProgramNode) obj;
|
||||||
|
|
||||||
CompoundCmd cmd = new CompoundCmd("Auto Rename Fragment(s)");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Auto Rename Fragment(s)");
|
||||||
SymbolTable symTable = currentProgram.getSymbolTable();
|
SymbolTable symTable = currentProgram.getSymbolTable();
|
||||||
|
|
||||||
// Find selected Fragments
|
// Find selected Fragments
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -24,6 +24,7 @@ import ghidra.app.context.ListingActionContext;
|
||||||
import ghidra.app.context.ListingContextAction;
|
import ghidra.app.context.ListingContextAction;
|
||||||
import ghidra.framework.cmd.Command;
|
import ghidra.framework.cmd.Command;
|
||||||
import ghidra.program.model.address.Address;
|
import ghidra.program.model.address.Address;
|
||||||
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.program.model.symbol.Reference;
|
import ghidra.program.model.symbol.Reference;
|
||||||
import ghidra.program.model.symbol.ReferenceManager;
|
import ghidra.program.model.symbol.ReferenceManager;
|
||||||
import ghidra.program.util.*;
|
import ghidra.program.util.*;
|
||||||
|
@ -58,7 +59,7 @@ public class DeleteReferencesAction extends ListingContextAction {
|
||||||
if (loc instanceof OperandFieldLocation) {
|
if (loc instanceof OperandFieldLocation) {
|
||||||
opIndex = ((OperandFieldLocation) loc).getOperandIndex();
|
opIndex = ((OperandFieldLocation) loc).getOperandIndex();
|
||||||
}
|
}
|
||||||
Command cmd = new RemoveAllReferencesCmd(loc.getAddress(), opIndex);
|
Command<Program> cmd = new RemoveAllReferencesCmd(loc.getAddress(), opIndex);
|
||||||
plugin.getTool().execute(cmd, context.getProgram());
|
plugin.getTool().execute(cmd, context.getProgram());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -173,13 +173,13 @@ class EditReferencesModel extends AbstractSortedTableModel<Reference> {
|
||||||
|
|
||||||
case REF_TYPE_COL:
|
case REF_TYPE_COL:
|
||||||
if (ref.getReferenceType() != value) {
|
if (ref.getReferenceType() != value) {
|
||||||
Command cmd = new EditRefTypeCmd(ref, (RefType) value);
|
Command<Program> cmd = new EditRefTypeCmd(ref, (RefType) value);
|
||||||
plugin.getTool().execute(cmd, cu.getProgram());
|
plugin.getTool().execute(cmd, cu.getProgram());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IS_PRIMARY_COL:
|
case IS_PRIMARY_COL:
|
||||||
Command cmd = new SetPrimaryRefCmd(ref, ((Boolean) value).booleanValue());
|
Command<Program> cmd = new SetPrimaryRefCmd(ref, ((Boolean) value).booleanValue());
|
||||||
plugin.getTool().execute(cmd, cu.getProgram());
|
plugin.getTool().execute(cmd, cu.getProgram());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
private void deleteExternalProgram() {
|
private void deleteExternalProgram() {
|
||||||
ExternalManager externalManager = program.getExternalManager();
|
ExternalManager externalManager = program.getExternalManager();
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
CompoundCmd cmd = new CompoundCmd("Delete External Program Name");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Delete External Program Name");
|
||||||
for (String externalName : getSelectedExternalNames()) {
|
for (String externalName : getSelectedExternalNames()) {
|
||||||
boolean hasLocations = externalManager.getExternalLocations(externalName).hasNext();
|
boolean hasLocations = externalManager.getExternalLocations(externalName).hasNext();
|
||||||
if (hasLocations) {
|
if (hasLocations) {
|
||||||
|
@ -251,7 +251,8 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
ExternalManager externalManager = program.getExternalManager();
|
ExternalManager externalManager = program.getExternalManager();
|
||||||
String externalLibraryPath = externalManager.getExternalLibraryPath(externalName);
|
String externalLibraryPath = externalManager.getExternalLibraryPath(externalName);
|
||||||
if (!pathName.equals(externalLibraryPath)) {
|
if (!pathName.equals(externalLibraryPath)) {
|
||||||
Command cmd = new SetExternalNameCmd(externalName, domainFile.getPathname());
|
Command<Program> cmd =
|
||||||
|
new SetExternalNameCmd(externalName, domainFile.getPathname());
|
||||||
getTool().execute(cmd, program);
|
getTool().execute(cmd, program);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -260,7 +261,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearExternalAssociation() {
|
private void clearExternalAssociation() {
|
||||||
CompoundCmd cmd = new CompoundCmd("Clear External Program Associations");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Clear External Program Associations");
|
||||||
for (String externalName : getSelectedExternalNames()) {
|
for (String externalName : getSelectedExternalNames()) {
|
||||||
cmd.add(new ClearExternalNameCmd(externalName));
|
cmd.add(new ClearExternalNameCmd(externalName));
|
||||||
}
|
}
|
||||||
|
@ -435,7 +436,8 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
rowToHighlightDuringNextReload = newName;
|
rowToHighlightDuringNextReload = newName;
|
||||||
String oldName = path.getName();
|
String oldName = path.getName();
|
||||||
Command cmd = new UpdateExternalNameCmd(oldName, newName, SourceType.USER_DEFINED);
|
Command<Program> cmd =
|
||||||
|
new UpdateExternalNameCmd(oldName, newName, SourceType.USER_DEFINED);
|
||||||
if (!tool.execute(cmd, program)) {
|
if (!tool.execute(cmd, program)) {
|
||||||
tool.setStatusInfo(cmd.getStatusMsg());
|
tool.setStatusInfo(cmd.getStatusMsg());
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -525,25 +525,27 @@ public class ReferencesPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BackgroundCommand cmd =
|
BackgroundCommand<Program> cmd =
|
||||||
new AddMemRefsCmd(cuAddr, set, rt, SourceType.USER_DEFINED, opIndex);
|
new AddMemRefsCmd(cuAddr, set, rt, SourceType.USER_DEFINED, opIndex);
|
||||||
tool.executeBackgroundCommand(cmd, cu.getProgram());
|
tool.executeBackgroundCommand(cmd, cu.getProgram());
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean addDefaultReference(Program program, Address fromAddr, int opIndex, Address toAddr,
|
boolean addDefaultReference(Program program, Address fromAddr, int opIndex, Address toAddr,
|
||||||
RefType refType) {
|
RefType refType) {
|
||||||
Command cmd =
|
Command<Program> cmd =
|
||||||
new AddMemRefCmd(fromAddr, toAddr, refType, SourceType.USER_DEFINED, opIndex, true);
|
new AddMemRefCmd(fromAddr, toAddr, refType, SourceType.USER_DEFINED, opIndex, true);
|
||||||
return tool.execute(cmd, program);
|
return tool.execute(cmd, program);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean addDefaultReference(Program program, Address fromAddr, int opIndex, int stackOffset) {
|
boolean addDefaultReference(Program program, Address fromAddr, int opIndex, int stackOffset) {
|
||||||
Command cmd = new AddStackRefCmd(fromAddr, opIndex, stackOffset, SourceType.USER_DEFINED);
|
Command<Program> cmd =
|
||||||
|
new AddStackRefCmd(fromAddr, opIndex, stackOffset, SourceType.USER_DEFINED);
|
||||||
return tool.execute(cmd, program);
|
return tool.execute(cmd, program);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean addDefaultReference(Program program, Address fromAddr, int opIndex, Register reg) {
|
boolean addDefaultReference(Program program, Address fromAddr, int opIndex, Register reg) {
|
||||||
Command cmd = new AddRegisterRefCmd(fromAddr, opIndex, reg, SourceType.USER_DEFINED);
|
Command<Program> cmd =
|
||||||
|
new AddRegisterRefCmd(fromAddr, opIndex, reg, SourceType.USER_DEFINED);
|
||||||
return tool.execute(cmd, program);
|
return tool.execute(cmd, program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -559,7 +561,7 @@ public class ReferencesPlugin extends Plugin {
|
||||||
* Remove specified set of references
|
* Remove specified set of references
|
||||||
*/
|
*/
|
||||||
void deleteReferences(Program program, Reference[] refs) {
|
void deleteReferences(Program program, Reference[] refs) {
|
||||||
CompoundCmd cmd = new CompoundCmd("Remove Reference(s)");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Remove Reference(s)");
|
||||||
for (Reference ref : refs) {
|
for (Reference ref : refs) {
|
||||||
cmd.add(new RemoveReferenceCmd(ref));
|
cmd.add(new RemoveReferenceCmd(ref));
|
||||||
}
|
}
|
||||||
|
@ -573,7 +575,7 @@ public class ReferencesPlugin extends Plugin {
|
||||||
*/
|
*/
|
||||||
boolean updateReference(Reference editRef, CodeUnit fromCodeUnit, Address toAddr,
|
boolean updateReference(Reference editRef, CodeUnit fromCodeUnit, Address toAddr,
|
||||||
boolean isOffsetRef, long offset, RefType refType) {
|
boolean isOffsetRef, long offset, RefType refType) {
|
||||||
CompoundCmd cmd = new CompoundCmd("Update Memory Reference");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Update Memory Reference");
|
||||||
int opIndex = editRef.getOperandIndex();
|
int opIndex = editRef.getOperandIndex();
|
||||||
cmd.add(new RemoveReferenceCmd(editRef));
|
cmd.add(new RemoveReferenceCmd(editRef));
|
||||||
if (isOffsetRef) {
|
if (isOffsetRef) {
|
||||||
|
@ -610,7 +612,7 @@ public class ReferencesPlugin extends Plugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Command cmd;
|
Command<Program> cmd;
|
||||||
if (isOffsetRef) {
|
if (isOffsetRef) {
|
||||||
cmd = new AddOffsetMemRefCmd(fromAddr, toAddr, false, refType, SourceType.USER_DEFINED,
|
cmd = new AddOffsetMemRefCmd(fromAddr, toAddr, false, refType, SourceType.USER_DEFINED,
|
||||||
opIndex, offset);
|
opIndex, offset);
|
||||||
|
@ -632,7 +634,7 @@ public class ReferencesPlugin extends Plugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompoundCmd cmd = new CompoundCmd("Update Register Reference");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Update Register Reference");
|
||||||
cmd.add(new RemoveReferenceCmd(editRef));
|
cmd.add(new RemoveReferenceCmd(editRef));
|
||||||
cmd.add(new AddRegisterRefCmd(fromAddr, editRef.getOperandIndex(), reg, refType,
|
cmd.add(new AddRegisterRefCmd(fromAddr, editRef.getOperandIndex(), reg, refType,
|
||||||
SourceType.USER_DEFINED));
|
SourceType.USER_DEFINED));
|
||||||
|
@ -670,7 +672,7 @@ public class ReferencesPlugin extends Plugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompoundCmd cmd = new CompoundCmd("Update Stack Reference");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Update Stack Reference");
|
||||||
cmd.add(new RemoveReferenceCmd(editRef));
|
cmd.add(new RemoveReferenceCmd(editRef));
|
||||||
cmd.add(new AddStackRefCmd(fromAddr, editRef.getOperandIndex(), stackOffset, refType,
|
cmd.add(new AddStackRefCmd(fromAddr, editRef.getOperandIndex(), stackOffset, refType,
|
||||||
SourceType.USER_DEFINED));
|
SourceType.USER_DEFINED));
|
||||||
|
@ -699,7 +701,8 @@ public class ReferencesPlugin extends Plugin {
|
||||||
return tool.execute(cmd, p);
|
return tool.execute(cmd, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildAddExtRefCmd(CompoundCmd cmd, Program p, Address fromAddr, int opIndex,
|
private void buildAddExtRefCmd(CompoundCmd<Program> cmd, Program p, Address fromAddr,
|
||||||
|
int opIndex,
|
||||||
String extName, String path, Address addr, String label, RefType refType) {
|
String extName, String path, Address addr, String label, RefType refType) {
|
||||||
|
|
||||||
cmd.add(new SetExternalRefCmd(fromAddr, opIndex, extName, label, addr, refType,
|
cmd.add(new SetExternalRefCmd(fromAddr, opIndex, extName, label, addr, refType,
|
||||||
|
@ -721,7 +724,7 @@ public class ReferencesPlugin extends Plugin {
|
||||||
ExternalLocation oldExtLoc = editRef.getExternalLocation();
|
ExternalLocation oldExtLoc = editRef.getExternalLocation();
|
||||||
String oldExtName = oldExtLoc.getLibraryName();
|
String oldExtName = oldExtLoc.getLibraryName();
|
||||||
|
|
||||||
CompoundCmd cmd = new CompoundCmd("Update External Reference");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Update External Reference");
|
||||||
|
|
||||||
// TODO: Add RefType entry to External Reference editor panel (assume unchanged to avoid merge conflict)
|
// TODO: Add RefType entry to External Reference editor panel (assume unchanged to avoid merge conflict)
|
||||||
|
|
||||||
|
@ -790,7 +793,7 @@ public class ReferencesPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CompoundCmd cmd = new CompoundCmd("Add External Reference");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Add External Reference");
|
||||||
buildAddExtRefCmd(cmd, p, fromCodeUnit.getMinAddress(), opIndex, extName, path, addr, label,
|
buildAddExtRefCmd(cmd, p, fromCodeUnit.getMinAddress(), opIndex, extName, path, addr, label,
|
||||||
refType);
|
refType);
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -231,7 +231,7 @@ public class RegisterPlugin extends ProgramPlugin {
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
AddressRange range = it.next();
|
AddressRange range = it.next();
|
||||||
if (range.contains(addr)) {
|
if (range.contains(addr)) {
|
||||||
Command cmd = new SetRegisterCmd(register, range.getMinAddress(),
|
Command<Program> cmd = new SetRegisterCmd(register, range.getMinAddress(),
|
||||||
range.getMaxAddress(), null);
|
range.getMaxAddress(), null);
|
||||||
if (!tool.execute(cmd, context.getProgram())) {
|
if (!tool.execute(cmd, context.getProgram())) {
|
||||||
Msg.showError(this, tool.getToolFrame(), "Register Context Error",
|
Msg.showError(this, tool.getToolFrame(), "Register Context Error",
|
||||||
|
@ -246,7 +246,7 @@ public class RegisterPlugin extends ProgramPlugin {
|
||||||
RegisterFieldLocation location = (RegisterFieldLocation) context.getLocation();
|
RegisterFieldLocation location = (RegisterFieldLocation) context.getLocation();
|
||||||
Register register = location.getRegister();
|
Register register = location.getRegister();
|
||||||
Address addr = location.getAddress();
|
Address addr = location.getAddress();
|
||||||
Command cmd = new SetRegisterCmd(register, addr, addr, null);
|
Command<Program> cmd = new SetRegisterCmd(register, addr, addr, null);
|
||||||
if (!tool.execute(cmd, context.getProgram())) {
|
if (!tool.execute(cmd, context.getProgram())) {
|
||||||
Msg.showError(this, tool.getToolFrame(), "Register Context Error", cmd.getStatusMsg());
|
Msg.showError(this, tool.getToolFrame(), "Register Context Error", cmd.getStatusMsg());
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ public class RegisterPlugin extends ProgramPlugin {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompoundCmd cmd = new CompoundCmd("Set Register Values");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Set Register Values");
|
||||||
for (AddressRange range : addressSet) {
|
for (AddressRange range : addressSet) {
|
||||||
SetRegisterCmd regCmd =
|
SetRegisterCmd regCmd =
|
||||||
new SetRegisterCmd(register, range.getMinAddress(), range.getMaxAddress(), value);
|
new SetRegisterCmd(register, range.getMinAddress(), range.getMaxAddress(), value);
|
||||||
|
|
|
@ -102,9 +102,9 @@ class RegisterValuesPanel extends JPanel {
|
||||||
|
|
||||||
private void updateValue(Address start, Address end, Address newStart, Address newEnd,
|
private void updateValue(Address start, Address end, Address newStart, Address newEnd,
|
||||||
BigInteger newValue) {
|
BigInteger newValue) {
|
||||||
CompoundCmd cmd = new CompoundCmd("Update Register Range");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Update Register Range");
|
||||||
Command cmd1 = new SetRegisterCmd(selectedRegister, start, end, null);
|
Command<Program> cmd1 = new SetRegisterCmd(selectedRegister, start, end, null);
|
||||||
Command cmd2 = new SetRegisterCmd(selectedRegister, newStart, newEnd, newValue);
|
Command<Program> cmd2 = new SetRegisterCmd(selectedRegister, newStart, newEnd, newValue);
|
||||||
cmd.add(cmd1);
|
cmd.add(cmd1);
|
||||||
cmd.add(cmd2);
|
cmd.add(cmd2);
|
||||||
tool.execute(cmd, currentProgram);
|
tool.execute(cmd, currentProgram);
|
||||||
|
@ -250,7 +250,7 @@ class RegisterValuesPanel extends JPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
void deleteSelectedRanges() {
|
void deleteSelectedRanges() {
|
||||||
CompoundCmd cmd = new CompoundCmd("Delete Register Value Ranges");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Delete Register Value Ranges");
|
||||||
int[] rows = table.getSelectedRows();
|
int[] rows = table.getSelectedRows();
|
||||||
boolean containsDefaultValues = false;
|
boolean containsDefaultValues = false;
|
||||||
for (int row : rows) {
|
for (int row : rows) {
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -95,7 +95,8 @@ public class SetExternalProgramAction extends SymbolTreeContextAction {
|
||||||
String pathName = domainFile.toString();
|
String pathName = domainFile.toString();
|
||||||
dialog.close();
|
dialog.close();
|
||||||
if (!pathName.equals(externalLibraryPath)) {
|
if (!pathName.equals(externalLibraryPath)) {
|
||||||
Command cmd = new SetExternalNameCmd(externalName, domainFile.getPathname());
|
Command<Program> cmd =
|
||||||
|
new SetExternalNameCmd(externalName, domainFile.getPathname());
|
||||||
plugin.getTool().execute(cmd, plugin.getProgram());
|
plugin.getTool().execute(cmd, plugin.getProgram());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -73,7 +73,7 @@ public class PropertyManagerProvider extends ComponentProviderAdapter {
|
||||||
String propName = (String) model.getValueAt(row,
|
String propName = (String) model.getValueAt(row,
|
||||||
PropertyManagerTableModel.PROPERTY_NAME_COLUMN);
|
PropertyManagerTableModel.PROPERTY_NAME_COLUMN);
|
||||||
model.removeRow(row);
|
model.removeRow(row);
|
||||||
Command cmd = new PropertyDeleteCmd(propName, restrictedView);
|
Command<Program> cmd = new PropertyDeleteCmd(propName, restrictedView);
|
||||||
PropertyManagerProvider.this.plugin.getTool().execute(cmd, currentProgram);
|
PropertyManagerProvider.this.plugin.getTool().execute(cmd, currentProgram);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -121,7 +121,7 @@ public final class ObjectiveC1_Utilities {
|
||||||
if (state.thumbCodeLocations.contains(address)) {
|
if (state.thumbCodeLocations.contains(address)) {
|
||||||
Register tmodeRegister = state.program.getLanguage().getRegister("TMode");
|
Register tmodeRegister = state.program.getLanguage().getRegister("TMode");
|
||||||
if (tmodeRegister != null) {
|
if (tmodeRegister != null) {
|
||||||
Command c =
|
Command<Program> c =
|
||||||
new SetRegisterCmd(tmodeRegister, address, address, BigInteger.valueOf(1));
|
new SetRegisterCmd(tmodeRegister, address, address, BigInteger.valueOf(1));
|
||||||
c.applyTo(state.program);
|
c.applyTo(state.program);
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ public final class ObjectiveC1_Utilities {
|
||||||
|
|
||||||
ObjectiveC1_Utilities.setThumbBit(state, address);
|
ObjectiveC1_Utilities.setThumbBit(state, address);
|
||||||
|
|
||||||
BackgroundCommand command = null;
|
BackgroundCommand<Program> command = null;
|
||||||
|
|
||||||
command = new DisassembleCommand(address, null, true);
|
command = new DisassembleCommand(address, null, true);
|
||||||
command.applyTo(state.program, state.monitor);
|
command.applyTo(state.program, state.monitor);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -218,7 +218,7 @@ class MarkupXmlMgr {
|
||||||
|
|
||||||
RefType refType = getDefaultRefType(fromAddr, toAddr, opIndex);
|
RefType refType = getDefaultRefType(fromAddr, toAddr, opIndex);
|
||||||
|
|
||||||
Command cmd = null;
|
Command<Program> cmd = null;
|
||||||
if (baseAddr != null) {
|
if (baseAddr != null) {
|
||||||
long offset = toAddr.subtract(baseAddr);
|
long offset = toAddr.subtract(baseAddr);
|
||||||
cmd = new AddOffsetMemRefCmd(fromAddr, toAddr, false, refType,
|
cmd = new AddOffsetMemRefCmd(fromAddr, toAddr, false, refType,
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -124,7 +124,7 @@ class PropertiesXmlMgr {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!overwrite && !"bookmarks".equals(type)) {
|
if (!overwrite && !"bookmarks".equals(type)) {
|
||||||
PropertyMap map = propMapMgr.getPropertyMap(name);
|
PropertyMap<?> map = propMapMgr.getPropertyMap(name);
|
||||||
if (map != null && map.hasProperty(addr)) {
|
if (map != null && map.hasProperty(addr)) {
|
||||||
log.appendMsg("Conflicting '" + name + "' PROPERTY ignored at: " + addr);
|
log.appendMsg("Conflicting '" + name + "' PROPERTY ignored at: " + addr);
|
||||||
return; // skip - property conflicts
|
return; // skip - property conflicts
|
||||||
|
|
|
@ -573,7 +573,7 @@ public class GhidraProject {
|
||||||
* @param program
|
* @param program
|
||||||
* the program on which the command is to be applied.
|
* the program on which the command is to be applied.
|
||||||
*/
|
*/
|
||||||
public void execute(Command cmd, Program program) {
|
public void execute(Command<Program> cmd, Program program) {
|
||||||
AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager(program);
|
AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager(program);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
mgr.initializeOptions();
|
mgr.initializeOptions();
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -58,7 +58,7 @@ public class BookmarkEditCmdTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
|
|
||||||
private Address[] createBookmarks(ProgramLocation[] locs) {
|
private Address[] createBookmarks(ProgramLocation[] locs) {
|
||||||
|
|
||||||
CompoundCmd compoundCmd = new CompoundCmd("Create Bookmarks");
|
CompoundCmd<Program> compoundCmd = new CompoundCmd<>("Create Bookmarks");
|
||||||
|
|
||||||
Address[] addrs = new Address[locs.length];
|
Address[] addrs = new Address[locs.length];
|
||||||
for (int i = 0; i < locs.length; i++) {
|
for (int i = 0; i < locs.length; i++) {
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -484,7 +484,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
// note: we want to test a specific code path, so we must delete more than 20 items
|
// note: we want to test a specific code path, so we must delete more than 20 items
|
||||||
|
|
||||||
// add more to our current set
|
// add more to our current set
|
||||||
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
|
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001110"), "Type1", "Cat1a", "Cmt1A"));
|
addCmd.add(new BookmarkEditCmd(addr("01001110"), "Type1", "Cat1a", "Cmt1A"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001120"), "Type1", "Cat1a", "Cmt1B"));
|
addCmd.add(new BookmarkEditCmd(addr("01001120"), "Type1", "Cat1a", "Cmt1B"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001120"), "Type1", "Cat1b", "Cmt1C"));
|
addCmd.add(new BookmarkEditCmd(addr("01001120"), "Type1", "Cat1b", "Cmt1C"));
|
||||||
|
@ -545,7 +545,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
assertFalse(addressSet.contains(addr("01001100")));
|
assertFalse(addressSet.contains(addr("01001100")));
|
||||||
assertFalse(addressSet.contains(addr("01001120")));
|
assertFalse(addressSet.contains(addr("01001120")));
|
||||||
|
|
||||||
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
|
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001100"), "Type1", "Cat1a", "Cmt1A"));
|
addCmd.add(new BookmarkEditCmd(addr("01001100"), "Type1", "Cat1a", "Cmt1A"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001120"), "Type1", "Cat1a", "Cmt1B"));
|
addCmd.add(new BookmarkEditCmd(addr("01001120"), "Type1", "Cat1a", "Cmt1B"));
|
||||||
applyCmd(program, addCmd);
|
applyCmd(program, addCmd);
|
||||||
|
@ -558,7 +558,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDeleteOffcutBookmarks() throws Exception {
|
public void testDeleteOffcutBookmarks() throws Exception {
|
||||||
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
|
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
|
||||||
Address a = addr("0100b6db");
|
Address a = addr("0100b6db");
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
addCmd.add(new BookmarkEditCmd(a, "Type1", "Cat1a", "Cmt1A"));
|
addCmd.add(new BookmarkEditCmd(a, "Type1", "Cat1a", "Cmt1A"));
|
||||||
|
@ -706,7 +706,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
applyCmd(program, delCmd);
|
applyCmd(program, delCmd);
|
||||||
|
|
||||||
// Add specific bookmarks
|
// Add specific bookmarks
|
||||||
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
|
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001010"), "Type1", "Cat1a", "Cmt1A"));
|
addCmd.add(new BookmarkEditCmd(addr("01001010"), "Type1", "Cat1a", "Cmt1A"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001020"), "Type1", "Cat1a", "Cmt1B"));
|
addCmd.add(new BookmarkEditCmd(addr("01001020"), "Type1", "Cat1a", "Cmt1B"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001020"), "Type1", "Cat1b", "Cmt1C"));
|
addCmd.add(new BookmarkEditCmd(addr("01001020"), "Type1", "Cat1b", "Cmt1C"));
|
||||||
|
|
|
@ -789,8 +789,8 @@ public class CodeBrowserOptionsTest extends AbstractGhidraHeadedIntegrationTest
|
||||||
|
|
||||||
//--- Verify register variable markup options
|
//--- Verify register variable markup options
|
||||||
|
|
||||||
Command cmd = new AddRegisterRefCmd(addr("0x1002d0b"), 0, program.getRegister("EDI"),
|
Command<Program> cmd = new AddRegisterRefCmd(addr("0x1002d0b"), 0,
|
||||||
SourceType.USER_DEFINED);
|
program.getRegister("EDI"), SourceType.USER_DEFINED);
|
||||||
applyCmd(program, cmd);
|
applyCmd(program, cmd);
|
||||||
cb.updateNow();
|
cb.updateNow();
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + 23));
|
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + 23));
|
||||||
|
|
||||||
Command cmd = new CreateStructureCmd(addr, 24);
|
Command<Program> cmd = new CreateStructureCmd(addr, 24);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
Data d = program.getListing().getDataAt(addr);
|
Data d = program.getListing().getDataAt(addr);
|
||||||
|
@ -127,7 +127,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + 23));
|
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + 23));
|
||||||
|
|
||||||
Command cmd = new CreateArrayCmd(addr, 6, new Pointer32DataType(), 4);
|
Command<Program> cmd = new CreateArrayCmd(addr, 6, new Pointer32DataType(), 4);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
Symbol s = createLabel(addr, "ArrayA");
|
Symbol s = createLabel(addr, "ArrayA");
|
||||||
|
@ -161,7 +161,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));
|
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));
|
||||||
|
|
||||||
Command cmd = new CreateStructureCmd(addr, 24);
|
Command<Program> cmd = new CreateStructureCmd(addr, 24);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
Data d = program.getListing().getDataAt(addr);
|
Data d = program.getListing().getDataAt(addr);
|
||||||
|
@ -207,11 +207,11 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
Address a = addr(EXT_POINTERS_OFFSET + (i * 24));
|
Address a = addr(EXT_POINTERS_OFFSET + (i * 24));
|
||||||
Command cmd = new CreateArrayCmd(a, 6, new Pointer32DataType(), 4);
|
Command<Program> cmd = new CreateArrayCmd(a, 6, new Pointer32DataType(), 4);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
}
|
}
|
||||||
|
|
||||||
Command cmd = new CreateStructureCmd(addr, 4 * 24);
|
Command<Program> cmd = new CreateStructureCmd(addr, 4 * 24);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
Data d = program.getListing().getDataAt(addr);
|
Data d = program.getListing().getDataAt(addr);
|
||||||
|
@ -254,7 +254,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));
|
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));
|
||||||
|
|
||||||
Command cmd = new CreateArrayCmd(addr, 6, new Pointer32DataType(), 4);
|
Command<Program> cmd = new CreateArrayCmd(addr, 6, new Pointer32DataType(), 4);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
Data d = program.getListing().getDataAt(addr);
|
Data d = program.getListing().getDataAt(addr);
|
||||||
|
@ -294,7 +294,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));
|
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));
|
||||||
|
|
||||||
Command cmd = new CreateStructureCmd(addr, 24);
|
Command<Program> cmd = new CreateStructureCmd(addr, 24);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
Data d = program.getListing().getDataAt(addr);
|
Data d = program.getListing().getDataAt(addr);
|
||||||
|
@ -349,7 +349,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr.add(23));
|
clearSymbols(addr, addr.add(23));
|
||||||
|
|
||||||
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(23)));
|
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(23)));
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
addr = addr(EXT_POINTERS_OFFSET + 2);
|
addr = addr(EXT_POINTERS_OFFSET + 2);
|
||||||
|
@ -407,7 +407,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address structAddr = addr(EXT_POINTERS_OFFSET);
|
Address structAddr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(structAddr, structAddr.add(23));
|
clearSymbols(structAddr, structAddr.add(23));
|
||||||
|
|
||||||
Command cmd = new ClearCmd(new AddressSet(structAddr, structAddr.add(23)));
|
Command<Program> cmd = new ClearCmd(new AddressSet(structAddr, structAddr.add(23)));
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
structAddr = addr(EXT_POINTERS_OFFSET + 2);
|
structAddr = addr(EXT_POINTERS_OFFSET + 2);
|
||||||
|
@ -443,7 +443,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr.add(23));
|
clearSymbols(addr, addr.add(23));
|
||||||
|
|
||||||
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(23)));
|
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(23)));
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
addr = addr(EXT_POINTERS_OFFSET + 2);
|
addr = addr(EXT_POINTERS_OFFSET + 2);
|
||||||
|
@ -488,7 +488,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr.add(7));
|
clearSymbols(addr, addr.add(7));
|
||||||
|
|
||||||
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
|
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
addr = addr(EXT_POINTERS_OFFSET + 2);
|
addr = addr(EXT_POINTERS_OFFSET + 2);
|
||||||
|
@ -508,7 +508,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr.add(7));
|
clearSymbols(addr, addr.add(7));
|
||||||
|
|
||||||
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
|
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
addr = addr(EXT_POINTERS_OFFSET + 2);
|
addr = addr(EXT_POINTERS_OFFSET + 2);
|
||||||
|
@ -528,7 +528,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr.add(7));
|
clearSymbols(addr, addr.add(7));
|
||||||
|
|
||||||
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
|
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
addr = addr(EXT_POINTERS_OFFSET + 2);
|
addr = addr(EXT_POINTERS_OFFSET + 2);
|
||||||
|
@ -551,7 +551,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
Address addr = addr(EXT_POINTERS_OFFSET);
|
Address addr = addr(EXT_POINTERS_OFFSET);
|
||||||
clearSymbols(addr, addr.add(7));
|
clearSymbols(addr, addr.add(7));
|
||||||
|
|
||||||
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
|
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
addr = addr(EXT_POINTERS_OFFSET + 2);
|
addr = addr(EXT_POINTERS_OFFSET + 2);
|
||||||
|
|
|
@ -287,7 +287,7 @@ public class MarkerTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
@Test
|
@Test
|
||||||
public void testToolTipMaxLines() throws Exception {
|
public void testToolTipMaxLines() throws Exception {
|
||||||
tool.addPlugin(BookmarkPlugin.class.getName());
|
tool.addPlugin(BookmarkPlugin.class.getName());
|
||||||
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
|
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
|
||||||
Address a = addr("0x0100b6db");
|
Address a = addr("0x0100b6db");
|
||||||
for (int i = 0; i < 20; i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
addCmd.add(new BookmarkEditCmd(a, "Type1", "Cat1a", "Cmt1A_" + (i + 1)));
|
addCmd.add(new BookmarkEditCmd(a, "Type1", "Cat1a", "Cmt1A_" + (i + 1)));
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -637,7 +637,7 @@ public class NextPrevCodeUnitPluginTest extends AbstractGhidraHeadedIntegrationT
|
||||||
clearExisingBookmarks();
|
clearExisingBookmarks();
|
||||||
|
|
||||||
// add more to our current set
|
// add more to our current set
|
||||||
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
|
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001110"), BookmarkType.ERROR, "Cat1a", "Cmt1A"));
|
addCmd.add(new BookmarkEditCmd(addr("01001110"), BookmarkType.ERROR, "Cat1a", "Cmt1A"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001118"), BookmarkType.NOTE, "Cat1a", "Cmt1B"));
|
addCmd.add(new BookmarkEditCmd(addr("01001118"), BookmarkType.NOTE, "Cat1a", "Cmt1B"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01001120"), BookmarkType.ERROR, "Cat1a", "Cmt1B"));
|
addCmd.add(new BookmarkEditCmd(addr("01001120"), BookmarkType.ERROR, "Cat1a", "Cmt1B"));
|
||||||
|
@ -736,7 +736,7 @@ public class NextPrevCodeUnitPluginTest extends AbstractGhidraHeadedIntegrationT
|
||||||
clearExisingBookmarks();
|
clearExisingBookmarks();
|
||||||
|
|
||||||
// add more to our current set
|
// add more to our current set
|
||||||
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
|
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01003e2c"), BookmarkType.WARNING, "Cat1a", "Cmt1A"));
|
addCmd.add(new BookmarkEditCmd(addr("01003e2c"), BookmarkType.WARNING, "Cat1a", "Cmt1A"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01003e2e"), BookmarkType.NOTE, "Cat1a", "Cmt1B"));
|
addCmd.add(new BookmarkEditCmd(addr("01003e2e"), BookmarkType.NOTE, "Cat1a", "Cmt1B"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("01003e30"), BookmarkType.WARNING, "Cat1a", "Cmt1B"));
|
addCmd.add(new BookmarkEditCmd(addr("01003e30"), BookmarkType.WARNING, "Cat1a", "Cmt1B"));
|
||||||
|
@ -803,7 +803,7 @@ public class NextPrevCodeUnitPluginTest extends AbstractGhidraHeadedIntegrationT
|
||||||
String typeString = bob.getTypeString();
|
String typeString = bob.getTypeString();
|
||||||
|
|
||||||
// add more to our current set
|
// add more to our current set
|
||||||
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
|
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
|
||||||
addCmd.add(new BookmarkEditCmd(addr("0100529b"), typeString, "Cat1a", "Cmt1A"));
|
addCmd.add(new BookmarkEditCmd(addr("0100529b"), typeString, "Cat1a", "Cmt1A"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("0100529d"), BookmarkType.NOTE, "Cat1a", "Cmt1B"));
|
addCmd.add(new BookmarkEditCmd(addr("0100529d"), BookmarkType.NOTE, "Cat1a", "Cmt1B"));
|
||||||
addCmd.add(new BookmarkEditCmd(addr("0100529e"), typeString, "Cat1a", "Cmt1B"));
|
addCmd.add(new BookmarkEditCmd(addr("0100529e"), typeString, "Cat1a", "Cmt1B"));
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -15,9 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.plugin.core.scalartable;
|
package ghidra.app.plugin.core.scalartable;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -818,7 +816,7 @@ public class ScalarSearchTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
assertTrue("Unable to apply data type at address: " + address, apply(createDataCommand));
|
assertTrue("Unable to apply data type at address: " + address, apply(createDataCommand));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean apply(Command cmd) throws RollbackException {
|
private boolean apply(Command<Program> cmd) throws RollbackException {
|
||||||
return cmd.applyTo(program);
|
return cmd.applyTo(program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -558,7 +558,7 @@ public class SymbolTreeNavigationTest extends AbstractProgramBasedTest {
|
||||||
assertNull("Found a selected node when there should be no selection", node);
|
assertNull("Found a selected node when there should be no selection", node);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyCmd(Command cmd) throws RollbackException {
|
public void applyCmd(Command<Program> cmd) throws RollbackException {
|
||||||
boolean success = applyCmd(program, cmd);
|
boolean success = applyCmd(program, cmd);
|
||||||
assertTrue("Command failed - " + cmd.getName() + "; status = " + cmd.getStatusMsg(),
|
assertTrue("Command failed - " + cmd.getName() + "; status = " + cmd.getStatusMsg(),
|
||||||
success);
|
success);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -1438,7 +1438,8 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
private void addLabel(String label, String namespaceName, Address address) throws Exception {
|
private void addLabel(String label, String namespaceName, Address address) throws Exception {
|
||||||
Namespace namespace = null;
|
Namespace namespace = null;
|
||||||
if (namespaceName != null) {
|
if (namespaceName != null) {
|
||||||
Command command = new CreateNamespacesCmd(namespaceName, SourceType.USER_DEFINED);
|
Command<Program> command =
|
||||||
|
new CreateNamespacesCmd(namespaceName, SourceType.USER_DEFINED);
|
||||||
if (tool.execute(command, program)) {
|
if (tool.execute(command, program)) {
|
||||||
List<Namespace> namespaces =
|
List<Namespace> namespaces =
|
||||||
NamespaceUtils.getNamespaceByPath(program, null, namespaceName);
|
NamespaceUtils.getNamespaceByPath(program, null, namespaceName);
|
||||||
|
@ -1450,7 +1451,8 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Command command = new AddLabelCmd(address, label, namespace, SourceType.USER_DEFINED);
|
Command<Program> command =
|
||||||
|
new AddLabelCmd(address, label, namespace, SourceType.USER_DEFINED);
|
||||||
tool.execute(command, program);
|
tool.execute(command, program);
|
||||||
waitForNotBusy();
|
waitForNotBusy();
|
||||||
}
|
}
|
||||||
|
@ -1700,7 +1702,7 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
waitForSwing();
|
waitForSwing();
|
||||||
int max = symbolTable.getRowCount();
|
int max = symbolTable.getRowCount();
|
||||||
for (int i = 0; i < max; i++) {
|
for (int i = 0; i < max; i++) {
|
||||||
Symbol s = (Symbol) symbolTable.getValueAt(i, SymbolTableModel.LABEL_COL);
|
Symbol s = (Symbol) symbolTable.getValueAt(i, AbstractSymbolTableModel.LABEL_COL);
|
||||||
if (s == null) {
|
if (s == null) {
|
||||||
continue; // symbol deleted
|
continue; // symbol deleted
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -294,7 +294,7 @@ public class OperandFieldFactoryTest extends AbstractGhidraHeadedIntegrationTest
|
||||||
structure.add(IntegerDataType.dataType, "field3", "Comment 3");
|
structure.add(IntegerDataType.dataType, "field3", "Comment 3");
|
||||||
|
|
||||||
Address arrayAddr = addr("01001888");
|
Address arrayAddr = addr("01001888");
|
||||||
Command cmd = new CreateArrayCmd(arrayAddr, 3, structure, 12);
|
Command<Program> cmd = new CreateArrayCmd(arrayAddr, 3, structure, 12);
|
||||||
applyCmd(program, cmd);
|
applyCmd(program, cmd);
|
||||||
|
|
||||||
String arrayName = "ArrayOfStructures";
|
String arrayName = "ArrayOfStructures";
|
||||||
|
@ -330,7 +330,7 @@ public class OperandFieldFactoryTest extends AbstractGhidraHeadedIntegrationTest
|
||||||
structure.add(IntegerDataType.dataType, "field3", "Comment 3");
|
structure.add(IntegerDataType.dataType, "field3", "Comment 3");
|
||||||
|
|
||||||
Address structAddr = addr("01001888");
|
Address structAddr = addr("01001888");
|
||||||
Command cmd = new CreateStructureCmd(structure, structAddr);
|
Command<Program> cmd = new CreateStructureCmd(structure, structAddr);
|
||||||
applyCmd(program, cmd);
|
applyCmd(program, cmd);
|
||||||
|
|
||||||
String structName = "Structure";
|
String structName = "Structure";
|
||||||
|
@ -358,7 +358,7 @@ public class OperandFieldFactoryTest extends AbstractGhidraHeadedIntegrationTest
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
|
||||||
protected void disassembleAt(Address addr) {
|
protected void disassembleAt(Address addr) {
|
||||||
Command cmd = new DisassembleCommand(addr, null, false);
|
Command<Program> cmd = new DisassembleCommand(addr, null, false);
|
||||||
applyCmd(program, cmd);
|
applyCmd(program, cmd);
|
||||||
waitForSwing();
|
waitForSwing();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -256,7 +256,8 @@ public class StructureFactoryTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
|
|
||||||
// create a valid structure...
|
// create a valid structure...
|
||||||
int defaultPtrLen = program.getAddressFactory().getDefaultAddressSpace().getPointerSize();
|
int defaultPtrLen = program.getAddressFactory().getDefaultAddressSpace().getPointerSize();
|
||||||
Command cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structureLength);
|
Command<Program> cmd =
|
||||||
|
new CreateStructureCmd("TestStructA", addr(startOffset), structureLength);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
Data d = program.getListing().getDataAt(addr(startOffset));
|
Data d = program.getListing().getDataAt(addr(startOffset));
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class CreateArrayInStructureCmdTest extends AbstractGenericTest {
|
||||||
|
|
||||||
Address addr = addr(UNDEFINED_AREA);
|
Address addr = addr(UNDEFINED_AREA);
|
||||||
int structLen = 30;
|
int structLen = 30;
|
||||||
Command cmd = new CreateStructureCmd(addr, structLen);
|
Command<Program> cmd = new CreateStructureCmd(addr, structLen);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
DataType dt = new Pointer16DataType(new ByteDataType());
|
DataType dt = new Pointer16DataType(new ByteDataType());
|
||||||
|
@ -120,7 +120,7 @@ public class CreateArrayInStructureCmdTest extends AbstractGenericTest {
|
||||||
struct1.add(new DWordDataType());
|
struct1.add(new DWordDataType());
|
||||||
struct1.add(new QWordDataType());
|
struct1.add(new QWordDataType());
|
||||||
|
|
||||||
Command cmd = new CreateDataCmd(addr(startOffset + 1), struct1);
|
Command<Program> cmd = new CreateDataCmd(addr(startOffset + 1), struct1);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
Data dataAt = program.getListing().getDataAt(addr(startOffset + 1));
|
Data dataAt = program.getListing().getDataAt(addr(startOffset + 1));
|
||||||
struct1 = (Structure) dataAt.getDataType();
|
struct1 = (Structure) dataAt.getDataType();
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class CreateDataInStructureBackgroundCmdTest extends AbstractGenericTest
|
||||||
|
|
||||||
int structLen = (2 * defaultPtrLen) + 2;
|
int structLen = (2 * defaultPtrLen) + 2;
|
||||||
|
|
||||||
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
cmd = new CreateDataInStructureBackgroundCmd(addr(startOffset), new int[] { 0 }, 2,
|
cmd = new CreateDataInStructureBackgroundCmd(addr(startOffset), new int[] { 0 }, 2,
|
||||||
|
@ -126,7 +126,7 @@ public class CreateDataInStructureBackgroundCmdTest extends AbstractGenericTest
|
||||||
|
|
||||||
int structLen = (2 * defaultPtrLen) + (2 * structA.getLength());
|
int structLen = (2 * defaultPtrLen) + (2 * structA.getLength());
|
||||||
|
|
||||||
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
cmd = new CreateDataInStructureBackgroundCmd(addr(startOffset), new int[] { 0 },
|
cmd = new CreateDataInStructureBackgroundCmd(addr(startOffset), new int[] { 0 },
|
||||||
|
@ -175,7 +175,7 @@ public class CreateDataInStructureBackgroundCmdTest extends AbstractGenericTest
|
||||||
long startOffset = UNDEFINED_AREA;
|
long startOffset = UNDEFINED_AREA;
|
||||||
|
|
||||||
int structLen = 4;
|
int structLen = 4;
|
||||||
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
cmd = new CreateDataInStructureBackgroundCmd(addr(startOffset), new int[] { 0 }, 4,
|
cmd = new CreateDataInStructureBackgroundCmd(addr(startOffset), new int[] { 0 }, 4,
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class CreateDataInStructureCmdTest extends AbstractGenericTest {
|
||||||
|
|
||||||
int structLen = defaultPtrLen + 1;
|
int structLen = defaultPtrLen + 1;
|
||||||
|
|
||||||
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
cmd = new CreateDataInStructureCmd(addr(startOffset), new int[] { 0 }, new ByteDataType());
|
cmd = new CreateDataInStructureCmd(addr(startOffset), new int[] { 0 }, new ByteDataType());
|
||||||
|
@ -116,7 +116,7 @@ public class CreateDataInStructureCmdTest extends AbstractGenericTest {
|
||||||
|
|
||||||
int structLen = defaultPtrLen + structA.getLength();
|
int structLen = defaultPtrLen + structA.getLength();
|
||||||
|
|
||||||
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
cmd = new CreateDataInStructureCmd(addr(startOffset), new int[] { 0 }, structA);
|
cmd = new CreateDataInStructureCmd(addr(startOffset), new int[] { 0 }, structA);
|
||||||
|
@ -155,7 +155,7 @@ public class CreateDataInStructureCmdTest extends AbstractGenericTest {
|
||||||
long startOffset = UNDEFINED_AREA;
|
long startOffset = UNDEFINED_AREA;
|
||||||
|
|
||||||
int structLen = 1;
|
int structLen = 1;
|
||||||
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
cmd = new CreateDataInStructureCmd(addr(startOffset), new int[] { 0 }, new ByteDataType());
|
cmd = new CreateDataInStructureCmd(addr(startOffset), new int[] { 0 }, new ByteDataType());
|
||||||
|
@ -203,7 +203,7 @@ public class CreateDataInStructureCmdTest extends AbstractGenericTest {
|
||||||
struct1.add(adt);
|
struct1.add(adt);
|
||||||
struct1.add(new WordDataType());
|
struct1.add(new WordDataType());
|
||||||
|
|
||||||
Command cmd = new CreateDataCmd(addr(startOffset + 1000), struct1);
|
Command<Program> cmd = new CreateDataCmd(addr(startOffset + 1000), struct1);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
Data dataAt = program.getListing().getDataAt(addr(startOffset + 1000));
|
Data dataAt = program.getListing().getDataAt(addr(startOffset + 1000));
|
||||||
struct1 = (Structure) dataAt.getDataType();
|
struct1 = (Structure) dataAt.getDataType();
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class CreateStructureInStructureCmdTest extends AbstractGenericTest {
|
||||||
offset = createArray(offset, 8, 4, stringPtr);
|
offset = createArray(offset, 8, 4, stringPtr);
|
||||||
|
|
||||||
int structLen = (int) (offset - startOffset);
|
int structLen = (int) (offset - startOffset);
|
||||||
Command cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structLen);
|
Command<Program> cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structLen);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
Data d = program.getListing().getDataAt(addr(startOffset));
|
Data d = program.getListing().getDataAt(addr(startOffset));
|
||||||
|
@ -179,7 +179,7 @@ public class CreateStructureInStructureCmdTest extends AbstractGenericTest {
|
||||||
offset = createArray(offset, 8, 4, stringPtr);
|
offset = createArray(offset, 8, 4, stringPtr);
|
||||||
|
|
||||||
int structLen = (int) (offset - startOffset);
|
int structLen = (int) (offset - startOffset);
|
||||||
Command cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structLen);
|
Command<Program> cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structLen);
|
||||||
cmd.applyTo(program);
|
cmd.applyTo(program);
|
||||||
|
|
||||||
Data d = program.getListing().getDataAt(addr(startOffset));
|
Data d = program.getListing().getDataAt(addr(startOffset));
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -20,7 +20,6 @@ import static org.junit.Assert.*;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import generic.test.AbstractGenericTest;
|
|
||||||
import ghidra.app.plugin.core.analysis.AnalysisBackgroundCommand;
|
import ghidra.app.plugin.core.analysis.AnalysisBackgroundCommand;
|
||||||
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
|
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
|
||||||
import ghidra.framework.cmd.Command;
|
import ghidra.framework.cmd.Command;
|
||||||
|
@ -30,7 +29,6 @@ import ghidra.program.database.ProgramBuilder;
|
||||||
import ghidra.program.database.function.OverlappingFunctionException;
|
import ghidra.program.database.function.OverlappingFunctionException;
|
||||||
import ghidra.program.model.address.*;
|
import ghidra.program.model.address.*;
|
||||||
import ghidra.program.model.listing.*;
|
import ghidra.program.model.listing.*;
|
||||||
import ghidra.program.model.symbol.SourceType;
|
|
||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.test.TestEnv;
|
import ghidra.test.TestEnv;
|
||||||
|
|
||||||
|
@ -78,7 +76,7 @@ public class CreateFunctionCmdWithFlowTest extends AbstractGhidraHeadedIntegrati
|
||||||
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
|
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
|
||||||
analysisMgr.reAnalyzeAll(null);
|
analysisMgr.reAnalyzeAll(null);
|
||||||
|
|
||||||
Command cmd = new AnalysisBackgroundCommand(analysisMgr, false);
|
Command<Program> cmd = new AnalysisBackgroundCommand(analysisMgr, false);
|
||||||
tool.execute(cmd, program);
|
tool.execute(cmd, program);
|
||||||
waitForBusyTool(tool);
|
waitForBusyTool(tool);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -263,7 +263,7 @@ public class AddLabelCmdTest extends AbstractGenericTest {
|
||||||
return p.getSymbolTable().getPrimarySymbol(addr);
|
return p.getSymbolTable().getPrimarySymbol(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean execute(Command cmd) {
|
private boolean execute(Command<Program> cmd) {
|
||||||
int txId = notepad.startTransaction("Transaction");
|
int txId = notepad.startTransaction("Transaction");
|
||||||
boolean result = cmd.applyTo(notepad);
|
boolean result = cmd.applyTo(notepad);
|
||||||
notepad.endTransaction(txId, true);
|
notepad.endTransaction(txId, true);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -68,7 +68,8 @@ public class CreateNamespacesCmdTest extends AbstractGenericTest {
|
||||||
String[] namespaces1 = new String[] { "Global", "child1", "child2" };
|
String[] namespaces1 = new String[] { "Global", "child1", "child2" };
|
||||||
String namespaceString1 = createNamespaceStringFromArray(namespaces1);
|
String namespaceString1 = createNamespaceStringFromArray(namespaces1);
|
||||||
|
|
||||||
Command command = new CreateNamespacesCmd(namespaceString1, SourceType.USER_DEFINED);
|
Command<Program> command =
|
||||||
|
new CreateNamespacesCmd(namespaceString1, SourceType.USER_DEFINED);
|
||||||
boolean success = execute(command);
|
boolean success = execute(command);
|
||||||
assertTrue("Failed to create namespaces from string: " + namespaceString1 + "\nMessage: " +
|
assertTrue("Failed to create namespaces from string: " + namespaceString1 + "\nMessage: " +
|
||||||
command.getStatusMsg(), success);
|
command.getStatusMsg(), success);
|
||||||
|
@ -348,7 +349,7 @@ public class CreateNamespacesCmdTest extends AbstractGenericTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean execute(Command cmd) {
|
private boolean execute(Command<Program> cmd) {
|
||||||
int txId = program.startTransaction("Transaction");
|
int txId = program.startTransaction("Transaction");
|
||||||
boolean result = cmd.applyTo(program);
|
boolean result = cmd.applyTo(program);
|
||||||
program.endTransaction(txId, true);
|
program.endTransaction(txId, true);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -34,7 +34,7 @@ import ghidra.util.exception.RollbackException;
|
||||||
public class AddMemoryBlockCmdTest extends AbstractGenericTest {
|
public class AddMemoryBlockCmdTest extends AbstractGenericTest {
|
||||||
private Program notepad;
|
private Program notepad;
|
||||||
private Program x08;
|
private Program x08;
|
||||||
private Command command;
|
private Command<Program> command;
|
||||||
|
|
||||||
public AddMemoryBlockCmdTest() {
|
public AddMemoryBlockCmdTest() {
|
||||||
super();
|
super();
|
||||||
|
@ -73,7 +73,7 @@ public class AddMemoryBlockCmdTest extends AbstractGenericTest {
|
||||||
assertEquals(block.getName(), f.getName());
|
assertEquals(block.getName(), f.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean applyCmd(Program p, Command c) {
|
private boolean applyCmd(Program p, Command<Program> c) {
|
||||||
int txId = p.startTransaction(c.getName());
|
int txId = p.startTransaction(c.getName());
|
||||||
boolean commit = true;
|
boolean commit = true;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -33,8 +33,7 @@ import ghidra.program.database.ProgramBuilder;
|
||||||
import ghidra.program.database.ProgramDB;
|
import ghidra.program.database.ProgramDB;
|
||||||
import ghidra.program.model.address.Address;
|
import ghidra.program.model.address.Address;
|
||||||
import ghidra.program.model.address.AddressFactory;
|
import ghidra.program.model.address.AddressFactory;
|
||||||
import ghidra.program.model.listing.CodeUnit;
|
import ghidra.program.model.listing.*;
|
||||||
import ghidra.program.model.listing.Listing;
|
|
||||||
import ghidra.program.model.symbol.RefType;
|
import ghidra.program.model.symbol.RefType;
|
||||||
import ghidra.program.model.symbol.SourceType;
|
import ghidra.program.model.symbol.SourceType;
|
||||||
import ghidra.test.AbstractGhidraHeadlessIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadlessIntegrationTest;
|
||||||
|
@ -96,7 +95,7 @@ public class EolCommentsTest extends AbstractGenericTest {
|
||||||
@Test
|
@Test
|
||||||
public void testReferenceToStringData() throws Exception {
|
public void testReferenceToStringData() throws Exception {
|
||||||
|
|
||||||
Command cmd = new AddMemRefCmd(addr("0x1001000"), addr("0x1001234"),
|
Command<Program> cmd = new AddMemRefCmd(addr("0x1001000"), addr("0x1001234"),
|
||||||
SourceType.USER_DEFINED, 0, true);
|
SourceType.USER_DEFINED, 0, true);
|
||||||
applyCmd(cmd);
|
applyCmd(cmd);
|
||||||
|
|
||||||
|
@ -115,7 +114,7 @@ public class EolCommentsTest extends AbstractGenericTest {
|
||||||
|
|
||||||
Address dataStartAddress = addr("0x1001234");
|
Address dataStartAddress = addr("0x1001234");
|
||||||
Address offcutAddress = dataStartAddress.add(2);
|
Address offcutAddress = dataStartAddress.add(2);
|
||||||
Command cmd =
|
Command<Program> cmd =
|
||||||
new AddMemRefCmd(addr("0x1001000"), offcutAddress, SourceType.USER_DEFINED, 0, true);
|
new AddMemRefCmd(addr("0x1001000"), offcutAddress, SourceType.USER_DEFINED, 0, true);
|
||||||
applyCmd(cmd);
|
applyCmd(cmd);
|
||||||
|
|
||||||
|
@ -138,7 +137,7 @@ public class EolCommentsTest extends AbstractGenericTest {
|
||||||
|
|
||||||
Address dataStartAddress = addr("0x1001234");
|
Address dataStartAddress = addr("0x1001234");
|
||||||
Address offcutAddress = dataStartAddress.add(2);
|
Address offcutAddress = dataStartAddress.add(2);
|
||||||
Command cmd =
|
Command<Program> cmd =
|
||||||
new AddMemRefCmd(addr("0x1001000"), offcutAddress, SourceType.USER_DEFINED, 0, true);
|
new AddMemRefCmd(addr("0x1001000"), offcutAddress, SourceType.USER_DEFINED, 0, true);
|
||||||
applyCmd(cmd);
|
applyCmd(cmd);
|
||||||
|
|
||||||
|
@ -165,7 +164,7 @@ public class EolCommentsTest extends AbstractGenericTest {
|
||||||
//
|
//
|
||||||
Address dataStartAddress = addr("0x1001234");
|
Address dataStartAddress = addr("0x1001234");
|
||||||
Address offcutAddress = dataStartAddress.add(4);
|
Address offcutAddress = dataStartAddress.add(4);
|
||||||
Command cmd =
|
Command<Program> cmd =
|
||||||
new AddMemRefCmd(addr("0x1001000"), offcutAddress, SourceType.USER_DEFINED, 0, true);
|
new AddMemRefCmd(addr("0x1001000"), offcutAddress, SourceType.USER_DEFINED, 0, true);
|
||||||
applyCmd(cmd);
|
applyCmd(cmd);
|
||||||
|
|
||||||
|
@ -226,7 +225,7 @@ public class EolCommentsTest extends AbstractGenericTest {
|
||||||
assertEquals(0, comments.size());
|
assertEquals(0, comments.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean applyCmd(Command cmd) throws RollbackException {
|
public boolean applyCmd(Command<Program> cmd) throws RollbackException {
|
||||||
return AbstractGhidraHeadlessIntegrationTest.applyCmd(program, cmd);
|
return AbstractGhidraHeadlessIntegrationTest.applyCmd(program, cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -27,6 +27,7 @@ import ghidra.app.plugin.core.decompile.DecompilerActionContext;
|
||||||
import ghidra.app.util.HelpTopics;
|
import ghidra.app.util.HelpTopics;
|
||||||
import ghidra.framework.cmd.Command;
|
import ghidra.framework.cmd.Command;
|
||||||
import ghidra.framework.plugintool.PluginTool;
|
import ghidra.framework.plugintool.PluginTool;
|
||||||
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.program.model.symbol.SourceType;
|
import ghidra.program.model.symbol.SourceType;
|
||||||
import ghidra.program.model.symbol.Symbol;
|
import ghidra.program.model.symbol.Symbol;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
|
@ -64,7 +65,8 @@ public class RemoveLabelAction extends AbstractDecompilerAction {
|
||||||
@Override
|
@Override
|
||||||
protected void decompilerActionPerformed(DecompilerActionContext context) {
|
protected void decompilerActionPerformed(DecompilerActionContext context) {
|
||||||
Symbol s = getSymbol(context);
|
Symbol s = getSymbol(context);
|
||||||
Command cmd = new DeleteLabelCmd(s.getAddress(), s.getName(), s.getParentNamespace());
|
Command<Program> cmd =
|
||||||
|
new DeleteLabelCmd(s.getAddress(), s.getName(), s.getParentNamespace());
|
||||||
PluginTool tool = context.getTool();
|
PluginTool tool = context.getTool();
|
||||||
if (!tool.execute(cmd, context.getProgram())) {
|
if (!tool.execute(cmd, context.getProgram())) {
|
||||||
tool.setStatusInfo(cmd.getStatusMsg());
|
tool.setStatusInfo(cmd.getStatusMsg());
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -157,7 +157,7 @@ public class TagFilterEditorDialog extends DialogComponentProvider implements Ta
|
||||||
// Inner Classes
|
// Inner Classes
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
|
|
||||||
private class TagListModel extends DefaultListModel {
|
private class TagListModel extends DefaultListModel<TagInfo> {
|
||||||
TagListModel(Map<String, VTMatchTag> allTags, Map<String, VTMatchTag> excludedTags) {
|
TagListModel(Map<String, VTMatchTag> allTags, Map<String, VTMatchTag> excludedTags) {
|
||||||
for (Map.Entry<String, VTMatchTag> entry : allTags.entrySet()) {
|
for (Map.Entry<String, VTMatchTag> entry : allTags.entrySet()) {
|
||||||
boolean isExcluded = excludedTags.containsKey(entry.getKey());
|
boolean isExcluded = excludedTags.containsKey(entry.getKey());
|
||||||
|
|
|
@ -180,7 +180,7 @@ public class LayoutLocationMap<V, E> {
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int gridX(Column col) {
|
public int gridX(Column<V> col) {
|
||||||
return col.index;
|
return col.index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -19,17 +19,12 @@ import static org.junit.Assert.*;
|
||||||
|
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
|
|
||||||
import ghidra.app.plugin.core.analysis.AnalysisBackgroundCommand;
|
|
||||||
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
|
|
||||||
import ghidra.framework.cmd.Command;
|
import ghidra.framework.cmd.Command;
|
||||||
import ghidra.framework.options.Options;
|
import ghidra.framework.options.Options;
|
||||||
import ghidra.framework.plugintool.PluginTool;
|
import ghidra.framework.plugintool.PluginTool;
|
||||||
import ghidra.program.database.ProgramBuilder;
|
import ghidra.program.database.ProgramBuilder;
|
||||||
import ghidra.program.model.address.AddressSet;
|
import ghidra.program.model.listing.Instruction;
|
||||||
import ghidra.program.model.data.DWordDataType;
|
import ghidra.program.model.listing.Program;
|
||||||
import ghidra.program.model.data.DataType;
|
|
||||||
import ghidra.program.model.listing.*;
|
|
||||||
import ghidra.program.model.symbol.SourceType;
|
|
||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.test.TestEnv;
|
import ghidra.test.TestEnv;
|
||||||
|
|
||||||
|
@ -67,7 +62,7 @@ public class ArmBranchReturnDetectionTest extends AbstractGhidraHeadedIntegratio
|
||||||
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
|
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
|
||||||
analysisMgr.reAnalyzeAll(null);
|
analysisMgr.reAnalyzeAll(null);
|
||||||
|
|
||||||
Command cmd = new AnalysisBackgroundCommand(analysisMgr, false);
|
Command<Program> cmd = new AnalysisBackgroundCommand(analysisMgr, false);
|
||||||
tool.execute(cmd, program);
|
tool.execute(cmd, program);
|
||||||
waitForBusyTool(tool);
|
waitForBusyTool(tool);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -433,7 +433,7 @@ public class JavaAnalyzer extends AbstractJavaAnalyzer implements AnalysisWorker
|
||||||
Data referredData = constantPoolData.getComponent(indexMap.get(index));
|
Data referredData = constantPoolData.getComponent(indexMap.get(index));
|
||||||
instruction.addOperandReference(0, referredData.getAddress(), RefType.DATA,
|
instruction.addOperandReference(0, referredData.getAddress(), RefType.DATA,
|
||||||
SourceType.ANALYSIS);
|
SourceType.ANALYSIS);
|
||||||
CompoundCmd cmd = new CompoundCmd("Add constant pool reference");
|
CompoundCmd<Program> cmd = new CompoundCmd<>("Add constant pool reference");
|
||||||
String constantPoolLabel = "CPOOL[" + index + "]";
|
String constantPoolLabel = "CPOOL[" + index + "]";
|
||||||
cmd.add(
|
cmd.add(
|
||||||
new AddLabelCmd(referredData.getAddress(), constantPoolLabel, SourceType.ANALYSIS));
|
new AddLabelCmd(referredData.getAddress(), constantPoolLabel, SourceType.ANALYSIS));
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* 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.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -25,12 +25,10 @@ import ghidra.framework.cmd.Command;
|
||||||
import ghidra.framework.options.Options;
|
import ghidra.framework.options.Options;
|
||||||
import ghidra.framework.plugintool.PluginTool;
|
import ghidra.framework.plugintool.PluginTool;
|
||||||
import ghidra.program.database.ProgramBuilder;
|
import ghidra.program.database.ProgramBuilder;
|
||||||
import ghidra.program.model.address.AddressSet;
|
|
||||||
import ghidra.program.model.data.DWordDataType;
|
import ghidra.program.model.data.DWordDataType;
|
||||||
import ghidra.program.model.data.DataType;
|
import ghidra.program.model.data.DataType;
|
||||||
import ghidra.program.model.listing.*;
|
import ghidra.program.model.listing.*;
|
||||||
import ghidra.program.model.symbol.Reference;
|
import ghidra.program.model.symbol.Reference;
|
||||||
import ghidra.program.model.symbol.SourceType;
|
|
||||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||||
import ghidra.test.TestEnv;
|
import ghidra.test.TestEnv;
|
||||||
|
|
||||||
|
@ -69,7 +67,7 @@ public class CreateFunctionThunkTest extends AbstractGhidraHeadedIntegrationTest
|
||||||
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
|
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
|
||||||
analysisMgr.reAnalyzeAll(null);
|
analysisMgr.reAnalyzeAll(null);
|
||||||
|
|
||||||
Command cmd = new AnalysisBackgroundCommand(analysisMgr, false);
|
Command<Program> cmd = new AnalysisBackgroundCommand(analysisMgr, false);
|
||||||
tool.execute(cmd, program);
|
tool.execute(cmd, program);
|
||||||
waitForBusyTool(tool);
|
waitForBusyTool(tool);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue