redballoonsecurity / ofrak

OFRAK: unpack, modify, and repack binaries.
https://ofrak.com
Other
1.82k stars 128 forks source link

Installation of Binary Ninja fails due to change in package name #450

Closed rbs-afflitto closed 3 months ago

rbs-afflitto commented 3 months ago

What is the problem? (Here is where you provide a complete Traceback.)

Ofrak uses the following shell script to download and install Binary Ninja: ofrak/disassemblers/ofrak_binary_ninja/install_binary_ninja_headless_linux.sh This shell script downloads and executes download_headless.py from the Binary Ninja repo, then attempts to unzip BinaryNinja-headless.zip. It appears that Binary Ninja has changed the name of this file from BinaryNinja-headless.zip to binaryninja_headless_linux.zip.

INFO: Successfully downloaded to: binaryninja_headless_linux.zip
unzip:  cannot find or open BinaryNinja-headless.zip, BinaryNinja-headless.zip.zip or BinaryNinja-headless.zip.ZIP.
rm: cannot remove 'BinaryNinja-headless.zip': No such file or directory
can't open file 'binaryninja/scripts/install_api.py': [Errno 2] No such file or directory

Please provide some information about your environment. At minimum we would like the following information on your platform and Python environment:

If you've discovered it, what is the root cause of the problem? Binary Ninja changed the name of the package, and the Ofrak installer script expects the original name.

How often does the issue happen? Upon each installation of the binary ninja disassembler.

What are the steps to reproduce the issue? Execute ofrak/disassemblers/ofrak_binary_ninja/install_binary_ninja_headless_linux.sh

How would you implement this fix? The Binary Ninja download_headless.py script accepts an --output argument. This will override the default name that the server gives, allowing the Ofrak script to know what the file is named.

Are there any (reasonable) alternative approaches? Update the .zip file name to binaryninja_headless_linux.zip, however this may be different depending on the platform and may change again in the future.

Are you interested in implementing it yourself? Yes

rbs-jacob commented 3 months ago

Fixed by #451.