binjatron icon indicating copy to clipboard operation
binjatron copied to clipboard

“Voltron: Sync” appears to fail at binaryview.py line 1888

Open michael-myers opened this issue 8 years ago • 3 comments

From Binary Ninja 1.0.13, MacOS 10.12.3.

I made a HelloWorld in C++, compiled it with g++, attached LLDB and broke on main(). I can confirm that Voltron is installed and working: in a Terminal, voltron view stack or any of the other views will correctly show the current state of the debugger. So I think Voltron works.

But within Binary Ninja, I open the same HelloWorld binary, navigate to main() (ASLR disabled by the debugger, so identical addresses as what I am seeing in LLDB), right click and select "Voltron: Sync". I wait, but nothing ever happens. No highlight where the instruction pointer is, no indication of breakpoints I have set within LLDB. The BN log pane has printed "Starting synchronisation with Voltron". If I repeat the action, I do get the "Already synchronising with Voltron" error.

If I run Binary Ninja with the console output, it hints that there might be a Python error:

$ /Applications/Binary\ Ninja.app/Contents/MacOS/binaryninja -e
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Library/Python/2.7/site-packages/voltron/core.py", line 544, in run
    self.update()
  File "/Library/Python/2.7/site-packages/voltron/core.py", line 513, in update
    self.callback(results)
  File "/Users/tanuki/Library/Application Support/Binary Ninja/plugins/binjatron/__init__.py", line 57, in callback
    func = view.get_function_at(view.platform, view.get_previous_function_start_before(addr))
  File "/Applications/Binary Ninja.app/Contents/MacOS/plugins/../../Resources/python/binaryninja/binaryview.py", line 1888, in get_function_at
    func = core.BNGetAnalysisFunction(self.handle, plat.handle, addr)
AttributeError: 'long' object has no attribute 'handle'

michael-myers avatar Feb 24 '17 04:02 michael-myers

I haven't had time to work on binjatron in ages, but I just merged a PR that is supposed to update it to be compatible with the latest version of the API so maybe give that a try?

snare avatar Feb 28 '17 06:02 snare

Fixed in f278d5dd51771acc731afe63cca50101ff904d18. An API change swapped the order of the addr and plat parameters in get_function_at(self, addr, plat=None).

cvediver avatar Nov 16 '17 15:11 cvediver

FWIW I ran into this exact problem and got everything working by going to the Binary Ninja repository location (~/Library/Application Support/Binary Ninja/repositories/default/plugins/binjatron), setting the remote to this repository and pulling the latest with https://github.com/snare/binjatron/commit/f278d5dd51771acc731afe63cca50101ff904d18 . It appears that the default repositories aren't configured with remotes to get updates from.

LucienBrule avatar Apr 14 '18 19:04 LucienBrule