-
Hi, I'm doing For the context, I'm writing a loader for Apple's sep-firmware which is a file that contains multiple Mach-O files. I was able to find and extract them. But I have no idea how to load a single file in a new tab or window once it's extracted. In the end I would like the user to choose which part of the firmware to extract and load in Binja (see picture below). Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
So first an answer to your specific question in the title, and then I'll follow up with a better solution for your actual problem (thanks for explaining both, gets you a two-for-one!). To open a new file (if you're already running code from a UI Plugin you can short-circuit much of this if you have a UIContext already): execute_on_main_thread_and_wait(lambda: UIContext.activeContext().openFilename('/tmp/test.bndb') You could also do something terrible like: from PySide2.QtGui import QDesktopServices
QDesktopServices.openUrl("binaryninja:///bin/ls") However, for an even cleaner workflow, you can instead create your own view settings that let the user select possible views from within the settings UI and then just only create the BinaryView they select/have your code just return the bytes from the one view selected (that's how we handle FAT Mach-O files currently). However, I'll need to tag-in one of the other developers to include that answer, so I'll link them to this thread and let them explain the right way to do that! |
Beta Was this translation helpful? Give feedback.
-
Jordan, Opening a file with Is there any doc for creating my own view settings ? Is this related to the settings module ? Looking forward the best way to do this then :) |
Beta Was this translation helpful? Give feedback.
So first an answer to your specific question in the title, and then I'll follow up with a better solution for your actual problem (thanks for explaining both, gets you a two-for-one!).
To open a new file (if you're already running code from a UI Plugin you can short-circuit much of this if you have a UIContext already):
You could also do something terrible like:
However, for an even cleaner workflow, you can instead create your own view settings that let the user select possible views from within the s…