mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-22 10:02:49 +08:00
Merge remote-tracking branch
'origin/GP-3576_Dan_PR-5487_sakiodre_noHighVariableErrorDuringUnwind' into patch (Closes #5487)
This commit is contained in:
+12
@@ -25,6 +25,7 @@ import ghidra.program.model.data.DataType;
|
||||
import ghidra.program.model.listing.Function;
|
||||
import ghidra.program.model.pcode.PcodeOp;
|
||||
import ghidra.program.model.pcode.PcodeOpAST;
|
||||
import ghidra.program.model.pcode.VarnodeAST;
|
||||
|
||||
/**
|
||||
* A warning issued while unwinding a stack
|
||||
@@ -186,6 +187,17 @@ public interface StackUnwindWarning {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* While analyzing an indirect call, couldn't get the function signature because its input doesn't have a high variable.
|
||||
*/
|
||||
public record NoHighVariableFromTargetPointerTypeUnwindWarning(VarnodeAST vn)
|
||||
implements StackUnwindWarning {
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "Input of indirect call target has no high variable: " + vn;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* While analyzing an indirect call, the signature could not be derived from call-site context.
|
||||
*/
|
||||
|
||||
+8
-1
@@ -216,7 +216,14 @@ class SymPcodeExecutor extends PcodeExecutor<Sym> {
|
||||
*/
|
||||
protected FunctionSignature getSignatureFromTargetPointerType(PcodeOpAST op) {
|
||||
VarnodeAST target = (VarnodeAST) op.getInput(0);
|
||||
DataType dataType = target.getHigh().getDataType();
|
||||
HighVariable high = target.getHigh();
|
||||
|
||||
if (high == null) {
|
||||
warnings.add(new NoHighVariableFromTargetPointerTypeUnwindWarning(target));
|
||||
return null;
|
||||
}
|
||||
|
||||
DataType dataType = high.getDataType();
|
||||
if (!(dataType instanceof Pointer ptrType)) {
|
||||
warnings.add(new UnexpectedTargetTypeStackUnwindWarning(dataType));
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user