mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
2f581d0ead
2 changed files with 22 additions and 6 deletions
|
@ -82,7 +82,7 @@ import ghidra.program.model.mem.MemoryBlock;
|
||||||
import ghidra.program.model.reloc.Relocation;
|
import ghidra.program.model.reloc.Relocation;
|
||||||
import ghidra.program.model.reloc.Relocation.Status;
|
import ghidra.program.model.reloc.Relocation.Status;
|
||||||
import ghidra.program.model.reloc.RelocationTable;
|
import ghidra.program.model.reloc.RelocationTable;
|
||||||
import ghidra.program.model.symbol.Symbol;
|
import ghidra.program.model.symbol.*;
|
||||||
import ghidra.program.util.GhidraProgramUtilities;
|
import ghidra.program.util.GhidraProgramUtilities;
|
||||||
import ghidra.service.graph.*;
|
import ghidra.service.graph.*;
|
||||||
import ghidra.util.exception.CancelledException;
|
import ghidra.util.exception.CancelledException;
|
||||||
|
@ -414,8 +414,8 @@ public class RecoverClassesFromRTTIScript extends GhidraScript {
|
||||||
runScript("FixElfExternalOffsetDataRelocationScript.java");
|
runScript("FixElfExternalOffsetDataRelocationScript.java");
|
||||||
|
|
||||||
// first check that there is even rtti by searching the special string in memory
|
// first check that there is even rtti by searching the special string in memory
|
||||||
if (!isStringInProgramMemory("class_type_info")) {
|
if (!isStringInProgramMemory("class_type_info") && !containsClassTypeinfoSymbol()) {
|
||||||
return ("This program does not contain RTTI.");
|
return ("This program does not appear to contain RTTI.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// then check to see if the special typeinfo namespace is in external space
|
// then check to see if the special typeinfo namespace is in external space
|
||||||
|
@ -1612,9 +1612,25 @@ public class RecoverClassesFromRTTIScript extends GhidraScript {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// assume that if there are any symbols containing "class_type_info" there is rtti in program
|
||||||
|
private boolean containsClassTypeinfoSymbol() {
|
||||||
|
|
||||||
|
SymbolTable symbolTable = currentProgram.getSymbolTable();
|
||||||
|
SymbolIterator symbolIterator =
|
||||||
|
symbolTable.getSymbolIterator("*class_type_info*", true);
|
||||||
|
return symbolIterator.hasNext();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isExternalNamespace(String path) throws CancelledException {
|
private boolean isExternalNamespace(String path) throws CancelledException {
|
||||||
|
|
||||||
List<Symbol> symbols = NamespaceUtils.getSymbols(path, currentProgram, true);
|
// try exact namespace path if there is one
|
||||||
|
List<Symbol> symbols = NamespaceUtils.getSymbols(path, currentProgram, false);
|
||||||
|
|
||||||
|
// if not, try to find path in another namespace
|
||||||
|
if (symbols.isEmpty()) {
|
||||||
|
symbols = NamespaceUtils.getSymbols(path, currentProgram, true);
|
||||||
|
}
|
||||||
|
|
||||||
for (Symbol symbol : symbols) {
|
for (Symbol symbol : symbols) {
|
||||||
monitor.checkCancelled();
|
monitor.checkCancelled();
|
||||||
|
|
|
@ -4096,8 +4096,8 @@ define pcodeop swap_bytes;
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
:POP Rmr16 is $(LONGMODE_OFF) & vexMode=0 & addrsize=0 & opsize=0 & row=5 & page=1 & Rmr16 { local val:2 = 0; pop22(val); Rmr16 = val; }
|
:POP Rmr16 is $(LONGMODE_OFF) & vexMode=0 & addrsize=0 & opsize=0 & row=5 & page=1 & Rmr16 { local val:2 = 0; pop22(val); Rmr16 = val; }
|
||||||
:POP Rmr16 is $(LONGMODE_OFF) & vexMode=0 & addrsize=1 & opsize=0 & row=5 & page=1 & Rmr16 { local val:2 = 0; pop22(val); Rmr16 = val; }
|
:POP Rmr16 is $(LONGMODE_OFF) & vexMode=0 & addrsize=1 & opsize=0 & row=5 & page=1 & Rmr16 { local val:2 = 0; pop42(val); Rmr16 = val; }
|
||||||
:POP Rmr32 is $(LONGMODE_OFF) & vexMode=0 & addrsize=0 & opsize=1 & row=5 & page=1 & Rmr32 { local val:4 = 0; pop44(val); Rmr32 = val; }
|
:POP Rmr32 is $(LONGMODE_OFF) & vexMode=0 & addrsize=0 & opsize=1 & row=5 & page=1 & Rmr32 { local val:4 = 0; pop24(val); Rmr32 = val; }
|
||||||
:POP Rmr32 is $(LONGMODE_OFF) & vexMode=0 & addrsize=1 & opsize=1 & row=5 & page=1 & Rmr32 { local val:4 = 0; pop44(val); Rmr32 = val; }
|
:POP Rmr32 is $(LONGMODE_OFF) & vexMode=0 & addrsize=1 & opsize=1 & row=5 & page=1 & Rmr32 { local val:4 = 0; pop44(val); Rmr32 = val; }
|
||||||
@ifdef IA64
|
@ifdef IA64
|
||||||
:POP Rmr16 is $(LONGMODE_ON) & vexMode=0 & opsize=0 & row=5 & page=1 & Rmr16 { local val:2 = 0; pop82(val); Rmr16 = val; }
|
:POP Rmr16 is $(LONGMODE_ON) & vexMode=0 & opsize=0 & row=5 & page=1 & Rmr16 { local val:2 = 0; pop82(val); Rmr16 = val; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue