Analyzing Binaries with Chat¶
Sidekick enables you to analyze binaries interactively using the Chat Assistant within the Chat sidebar. The Chat Assistant is an AI-powered assistant that can:
- Answer your requests by analyzing the chat history, including your messages and information retrieved from the binary
- Search for items in the binary using the Binary Ninja Query Language (BNQL)
- Access Indexes to store and retrieve information
- Access the Notebook to store and retrieve information
- Run tools to assist in completing your request
- Edit the binary
The Chat sidebar maintains your conversations with the Chat Assistant through a collection of "chats". Each chat contains a history of your interactions with the Chat Assistant.
Making Requests¶
To make a request to the Chat Assistant, enter your message in the message box at the bottom of the Chat sidebar and do any of the following:
- Press
Return
- Click the
Send a Message
button - Select
Send Message
from the hamburger menu
When responding to your requests, the Chat Assistant determines what information it needs before proceeding. It may also ask you for additional details or clarification. While working on your request, it may search for items in the binary, retrieve information from Indexes or the Notebook, run tools, or even edit the binary. The Chat Assistant will provide a response based on its understanding of the binary, its findings, and the chat history. You may view the details of the actions it took.
Note
The Chat Assistant performs best if the scope of your chat is limited to a specific topic or set of functions. If you want to switch topics, create a new chat for that topic.
Searching the Binary¶
The Chat Assistant uses the Binary Ninja Query Language (BNQL) to search for items in the binary and retrieve information about them in response to your messages. You can direct the Chat Assistant to search for items in the binary, and based on its knowledge of the binary, it may issue a BNQL query to find the items that match your request. The Chat Assistant will then provide a response based on the results of the query.
Chat Assistant messages that use BNQL list the query used to search for items in the binary. You can copy these queries and use them to add its results as entries to an Index.
Using Indexes¶
The Chat Assistant uses Indexes to store and retrieve analysis data. It serves as a working "memory" for the Chat Assistant, allowing it to store and retrieve information as needed. You may also direct the Chat Assistant to access Indexes if needed. For more information on Indexes, refer to the Indexes documentation.
Using the Notebook¶
The Chat Assistant uses the Notebook to store significant findings during its analysis. It also incorporates information from the Notebook as additional context for its responses. The Notebook allows the Chat Assistant to store findings, insights, and other relevant information that can be referenced later in the conversation or in future chats. You can also direct the Chat Assistant to access the Notebook to retrieve information or to add new findings. For more information on the Notebook, refer to the Notebook documentation.
Using Tools¶
The Chat Assistant maintains a set of active tools to assist in completing your request. Tools are scripts that are registered with the Chat Assistant and can be run to perform specific tasks. Some tools are included by default and always active:
search_binary
: Search for items in the binaryedit_binary
: Edit the binarymanage_binary_index
: Manage the binary indexget_data_dump
: Get a data dump of the binarysearch_tool_library
: Search the tool librarycreate_scripted_tool
: Create a scripted toolregister_tool
: Register a toolsearch_extended_tool_output
: Search the extended tool output
The Chat Assistant may create a new scripted tool to assist in completing a request. You can also direct the Chat Assistant to use a specific tool to complete a task.
Searching Chats¶
To search for content in chats, enter a search term in the Search chats
text box. Results from all chats are displayed in the Chat sidebar.
To navigate to the message in its chat for a given search result, hover over the result message and click the Go to Message
button that appears.
Selecting Chats¶
To select a Chat, click on the drop-down list of Chats and select the desired Chat
Creating New Chats¶
To create a new chat, click on the New Chat
button or select New Chat
from the hamburger drop-down menu
Renaming Chat Titles¶
To rename a Chat title, select Rename Chat
from the hamburger drop-down menu
Note
New Chats are assigned a default Chat title. If the Chat title has not been set by the user, then after the first response to a message request completes, the Chat title is automatically set to a value relevant to the content of that request and response.
Deleting Chats¶
To delete a Chat, select the desired Chat from the drop-down list of Chats and select Delete Chat
from the hamburger drop-down menu
Recording Notes¶
Notes are entries in the Chat that are not sent to the Chat Assistant for response. To record a note in the Chat, enter a message in the message box and perform any of the following actions:
- Press
Control + Return
(Command + Return
on MacOS) - Select
Record Note
from the hamburger drop-down menu
Editing Your Messages/Notes¶
Your messages/notes can be edited. To edit a user message/note, hover over the message/note, click the Edit
button that appears. In the Edit Message
dialog that pops up, apply edits and click Accept
.
Note
This action causes the Chat Assistant to re-evaluate the message history up to and including the edited message and provide a new response. All subsequent messages are removed from the Chat.
To add new lines to a your message/note, press Shift + Return
.
Note
Messages are formatted as markdown, so 2 newlines are required to create a new paragraph.
Viewing Chat Assistant Message Details¶
Some messages from the Chat Assistant (such as tool usage) contain additional details that can be expanded to view. To view/hide these details, hover over the message and click the chevron button that appears.
Details may include additional information for the performed action, output from the tool, or error messages, useful for debugging and troubleshooting.
Copying Message Text¶
To copy a selection of text within the message history, select the text to copy and perform any of the following actions:
- Press
Control + C
(Command + C
on MacOS) - Right-click the selection and select
Copy
Additionally, to copy a message from the Chat Assistant, hover over the message and click the Copy
button that appears.
Navigating to Message Locations¶
Each message (User or Assistant) is linked to the location in the binary that was active when the message was added. In order to navigate to that location in the binary, hover over the message and click on the Go to address
button that appears.
Retrying Chat Assistant Messages¶
After reviewing a message from the Chat Assistant, you can retry the message to get a new response. To do this, hover over the Chat Assistant message and click the Retry
button that appears.
Submitting Feedback¶
To provide feedback on how the Chat Assistant performed, hover over the message from the Chat Assistant and click on the Good response
or Bad response
button that appears. In the Send Feedback
dialog that pops up, provide feedback and click Submit
.
Note
Feedback is only collected for non-commercial plans or commercial-plan users that have opted-in for data collection.
Viewing/Managing Active Tools¶
To view or manage the active tools, select Tools...
from the hamburger drop-down menu. In the Active Tools
dialog that pops up, you can view the current list of active tools.
To pin/unpin a user tool (i.e. not a system tool), click on the pin icon next to the tool name. Pinned tools are not removed from the list of active tools as the Chat Assistant manages its limited number of active tool slots.
To remove a user tool, click on the Remove tool
button next to the tool name.
View Raw Chat¶
To view the raw Chat content, select View Raw Chat
from the hamburger drop-down menu. The raw Chat content is displayed in the Raw Chat Content
dialog that pops up. This content includes the full details of the Chat, including the message history and other Chat metadata. This information is useful for debugging and troubleshooting.
Changing Settings¶
Max Tool Turns (sidekick.notebook.max_tool_turns)¶
This setting is the maximum number of turns that the Chat Assistant can take using a tool during a single response. If the number of tool turns exceeds this value, the Chat Assistant will stop and ask for further instructions. The default value is 10.
Script Tool Execution Timeout (sidekick.notebook.script_timeout)¶
This setting is the maximum time in seconds that the Chat Assistant waits for a scripted tool to execute. The default value is 0 (no timeout).