binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Make Select All (Ctrl+A) work in linear view and have it select all lines of the current function

Open BlasterXiao opened this issue 1 year ago • 5 comments

What is the feature you'd like to have? I would like to add a Ctrl+A (Select All) shortcut functionality in Binary Ninja's various views (IL, HIL, C, and ASM) to easily copy the entire code content of each view.

Is your feature request related to a problem? Yes. Currently, it's cumbersome to copy the entire code from different views in Binary Ninja, especially when dealing with large binaries or when we need to quickly share or analyze the code outside the tool.

Are any alternative solutions acceptable? no

Additional Information: This feature would greatly improve the workflow when analyzing binaries, especially when users need to:

Share code snippets with team members Paste the code into external analysis tools or documentation Quickly compare different representations (IL, HIL, C, ASM) of the same binary Implementing this feature across all views (IL, HIL, C, and ASM) would ensure consistency and improve user experience in Binary Ninja.

BlasterXiao avatar Aug 26 '24 13:08 BlasterXiao

We can probably only implement this for single function view and linear for what it's worth. It sounds like that's what you wanted anyway.

psifertex avatar Aug 26 '24 14:08 psifertex

You can also do File->Export->Linear View to export everything.

plafosse avatar Aug 27 '24 14:08 plafosse

We already bind "Ctrl+A" to a "Select All" in the graph view, which selects all lines of the current basic block. We should also bind the action in the linear view and have it select all the lines for the current function

xusheng6 avatar Aug 27 '24 14:08 xusheng6

My dev version is 4.2.5975, and I tried Ctrl+A, but it still can't select the current function code block. image

BlasterXiao avatar Aug 28 '24 01:08 BlasterXiao

Are you trying it in graph view? As noted previously, we agree that this should be implemented in linear view but currently is not. So for example this will work when you press CTL-A: Screenshot 2024-09-25 at 10 58 18 Screenshot 2024-09-25 at 10 58 26

But this will not work yet (which is what we're tracking with this issue and we agree would be a nice feature): Screenshot 2024-09-25 at 10 59 01

If you're trying it with graph view and it's not work, please provide more information with screenshots or maybe a sample binary as all the samples I'm trying here, graph view CTL-A does work as expected.

psifertex avatar Sep 25 '24 14:09 psifertex

Hey, I totally agree with the request to make it work for the entire function. Right now, it's a bit of a pain having to use Export to get all the code, and Ctrl+A only working in graph view doesn't quite cut it for me.If we could extend this to linear view, it'd make life a lot easier when trying to quickly copy and share the code.Let me know if I can help out with anything or test a dev version!

OmarFlores542 avatar Jan 17 '25 11:01 OmarFlores542

Since Ctrl+A is ambiguous on the normal linear view I've implemented this capability but it only works when "Single Function View" is enabled in linear view.

Available on dev builds >= 4.3.6696.

psifertex avatar Jan 17 '25 19:01 psifertex