From e9c53f3c9a8cb2f28ea8047c1b9b12f0ea31968f Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 2 Aug 2024 12:10:15 +0800 Subject: Support forward type propagation for function/variable. Fix https://github.com/Vector35/binaryninja-api/issues/2725 --- ui/commands.h | 3 +++ ui/flowgraphwidget.h | 3 +++ ui/linearview.h | 3 +++ 3 files changed, 9 insertions(+) (limited to 'ui') diff --git a/ui/commands.h b/ui/commands.h index b0798a9b..3af4f11b 100644 --- a/ui/commands.h +++ b/ui/commands.h @@ -61,6 +61,9 @@ std::optional getVariableDefinitionInstructionIndex( std::optional getVariableDefinitionAddress( FunctionRef func, BNFunctionGraphType funcType, const BinaryNinja::Variable& var, size_t ilInstructionIndex); +bool IsDefaultArgumentOrParameterName(const std::string& name); +std::optional GetVariableNameFromExpr(BinaryNinja::Function* func, + const BinaryNinja::HighLevelILInstruction& instr); /*! @} diff --git a/ui/flowgraphwidget.h b/ui/flowgraphwidget.h index 7c6ad26c..667d088c 100644 --- a/ui/flowgraphwidget.h +++ b/ui/flowgraphwidget.h @@ -354,6 +354,9 @@ class BINARYNINJAUIAPI FlowGraphWidget : void createFuncWithPlatform(PlatformRef platform, bool autoSelect = false); void changeType(); void inferStructureType(const UIActionContext& context); + void forwardPropagateType(); + void inferFunctionType(); + void propagateVariableTypeAndName(); void comment(); void addUserXref(); void functionComment(); diff --git a/ui/linearview.h b/ui/linearview.h index 29021a7a..caa0b439 100644 --- a/ui/linearview.h +++ b/ui/linearview.h @@ -331,6 +331,9 @@ private Q_SLOTS: void editFunctionProperties(); void undefineFunc(); void reanalyze(); + void forwardPropagateType(); + void inferFunctionType(); + void propagateVariableTypeAndName(); void comment(); void commentAccepted(); void addUserXref(); -- cgit v1.3.1