Skip to content

Commit e9c53f3

Browse files
committed
Support forward type propagation for function/variable. Fix Vector35#2725
1 parent 7e8d66a commit e9c53f3

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

docs/guide/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ To search in the keybindings list, just click to make sure it's focused and star
516516
- `i` : Cycle between disassembly, LLIL, MLIL and HLIL
517517
- `t` : Switch to type view
518518
- `y` : Change type of currently selected element
519+
- `q` : Forward propagate the type of the selected function or variable
519520
- `a` : Change the data type to an ASCII string
520521
- `[SHIFT] a` : Change the data type to a `wchar_t` string
521522
- `[OPT-SHIFT] a` (macOS) : Change the data type to a `wchar32_t` string

ui/commands.h

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ std::optional<size_t> getVariableDefinitionInstructionIndex(
6161
std::optional<size_t> getVariableDefinitionAddress(
6262
FunctionRef func, BNFunctionGraphType funcType, const BinaryNinja::Variable& var, size_t ilInstructionIndex);
6363

64+
bool IsDefaultArgumentOrParameterName(const std::string& name);
65+
std::optional<std::string> GetVariableNameFromExpr(BinaryNinja::Function* func,
66+
const BinaryNinja::HighLevelILInstruction& instr);
6467

6568
/*!
6669
@}

ui/flowgraphwidget.h

+3
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ class BINARYNINJAUIAPI FlowGraphWidget :
354354
void createFuncWithPlatform(PlatformRef platform, bool autoSelect = false);
355355
void changeType();
356356
void inferStructureType(const UIActionContext& context);
357+
void forwardPropagateType();
358+
void inferFunctionType();
359+
void propagateVariableTypeAndName();
357360
void comment();
358361
void addUserXref();
359362
void functionComment();

ui/linearview.h

+3
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ private Q_SLOTS:
331331
void editFunctionProperties();
332332
void undefineFunc();
333333
void reanalyze();
334+
void forwardPropagateType();
335+
void inferFunctionType();
336+
void propagateVariableTypeAndName();
334337
void comment();
335338
void commentAccepted();
336339
void addUserXref();

0 commit comments

Comments
 (0)