mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Refactor getBaseSpaceID -> getSpaceID
This commit is contained in:
parent
875eed4c3b
commit
93c8171ffa
28 changed files with 172 additions and 126 deletions
|
@ -23,6 +23,8 @@
|
|||
//
|
||||
//@category Search
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import generic.jar.ResourceFile;
|
||||
import ghidra.app.decompiler.*;
|
||||
import ghidra.app.decompiler.component.DecompilerUtils;
|
||||
|
@ -43,8 +45,6 @@ import ghidra.util.UndefinedFunction;
|
|||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.exception.InvalidInputException;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class ShowConstantUse extends GhidraScript {
|
||||
private DecompInterface decomplib;
|
||||
DecompileResults lastResults = null;
|
||||
|
@ -143,9 +143,9 @@ public class ShowConstantUse extends GhidraScript {
|
|||
if (f == null) {
|
||||
Reference[] referencesFrom =
|
||||
currentProgram.getReferenceManager().getReferencesFrom(faddr);
|
||||
for (int i = 0; i < referencesFrom.length; i++) {
|
||||
if (referencesFrom[i].isExternalReference()) {
|
||||
faddr = referencesFrom[i].getToAddress();
|
||||
for (Reference element : referencesFrom) {
|
||||
if (element.isExternalReference()) {
|
||||
faddr = element.getToAddress();
|
||||
f = currentProgram.getFunctionManager().getFunctionAt(faddr);
|
||||
if (f != null) {
|
||||
break;
|
||||
|
@ -437,8 +437,7 @@ public class ShowConstantUse extends GhidraScript {
|
|||
keys = constLocs.keySet();
|
||||
Address[] keyArray = keys.toArray(new Address[0]);
|
||||
Arrays.sort(keyArray);
|
||||
for (int i = 0; i < keyArray.length; i++) {
|
||||
Address loc = keyArray[i];
|
||||
for (Address loc : keyArray) {
|
||||
Long constant = constLocs.get(loc);
|
||||
tableChooserDialog.add(new ConstUseLocation(currentProgram, loc, constant, null));
|
||||
}
|
||||
|
@ -872,7 +871,7 @@ public class ShowConstantUse extends GhidraScript {
|
|||
if (def.getInput(0).isConstant() && def.getInput(1).isConstant()) {
|
||||
long space = def.getInput(0).getOffset();
|
||||
long offset = def.getInput(1).getOffset();
|
||||
if (space != funcEntry.getAddressSpace().getBaseSpaceID()) {
|
||||
if (space != funcEntry.getAddressSpace().getSpaceID()) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue