Naming¶
Sidekick generates meaningful names for items in the binary based on the type of item and its surrounding context. Generally, the better the quality of the surrounding context, the better its generated names are.
Functions¶
The Function Naming feature suggests names for functions to help you quickly understand the purpose of the function.
How it works¶
Sidekick submits a representation of the function to the Sidekick service, which uses a language model to suggest a name for the function.
How to use it¶
Function name suggestions can be generated by following these instructions.
If a function rename suggestion is generated, then it can be applied by following these instructions.
Variables¶
The Variable Naming feature suggests variable names for parameters and local variables in functions making it easier to understand the purpose of the variables in the function.
How it works¶
The variable naming feature works on a per-function basis. It submits a representation of the function to the Sidekick service, which uses a language model to suggest names for the variables.
How to use it¶
Variable name suggestions can be generated by following these instructions.
If a variable rename suggestion is generated, then it can be applied by following these instructions.
Alternatively, you can click on a suggested item to navigate to the variable definition. You can then rename that variable directly using the Binary Ninja UI. At that point, the suggestion items that refer to that variable will be removed from the list. The remaining suggestions can be reviewed, accepted, or rejected.
Structures and Fields¶
The structure and field naming feature suggests names for structures and fields to improve your understanding of the data structures in your binary.
How it works¶
The structure and field naming feature works on a per-component basis. It submits a representative sample of the component to the Sidekick service, which uses a language model to suggest names for the structures and fields.
How to use it¶
If structures have been recovered for the current component, then structure and field name suggestions can be generated by following these instructions.
If a structure or field rename suggestion is generated, then it can be applied by following these instructions.
To recover structures for the current component, follow the these instructions.
Function Callees¶
Sidekick can improve the quality of function names its generates if there are good names for the callees in a function. The function callee naming feature applies names to the callees of a function recursively in order to maximize the quality of this type of information.
How it works¶
Sidekick generates names for all unnamed function callees recursively. All unnamed callees at the deepest layer of the call tree for the current function are named first before moving on to those at the next layer up in the call tree. The naming process continues until the all unnamed callees are named (or until the limit is reached for a single operation).
How to use it¶
Sidekick may generate a suggestion to name callee functions based on the current context, which can be applied by following [these instructions](./suggestions.md#applying-suggestions]. However, users can also perform this operation manually by selecting Name Callee Functions
from the Plugins->Sidekick
menu. This operation may take a while depending on the number of unnamed callees in the call tree of the current function. While the operation is in progress, status is displayed in the status bar on the lower left corner. The operation can be canceled by clicking on the X on the status bar. Any functions named applied prior to canceling are kept. This also allows a user to apply names in batches if the user wants.
Naming Convention¶
Sidekick allows you to configure the naming convention it uses for each name type separately using the Binary Ninja Settings. The following settings are available for configuring naming conventions:
Name Type | Setting Name |
---|---|
Function | sidekick.suggestions.function_naming_convention |
Variable | sidekick.suggestions.variable_naming_convention |
Structure | sidekick.suggestions.struct_naming_convention |
Structure Field | sidekick.suggestions.field_naming_convention |
Component | sidekick.components.naming_convention |
The following naming convention options are available:
Value | Description |
---|---|
any | Use whatever names are generated by the model. |
snake | Formats the variable name as snake_case . |
camel | Formats the variable name as camelCase . |
pascal | Formats the variable name as PascalCase . |