cah011 / binja-avr

AVR assembly plugin for Binary Ninja
MIT License
12 stars 11 forks source link

NameError: name 'BinaryViewType' is not defined #15

Open bmuessig opened 5 years ago

bmuessig commented 5 years ago

I am using BN Version 1.1.1555 Personal. When launching BN, this error is thrown:

Traceback (most recent call last):
  File "~/.binaryninja/plugins/binja-avr/__init__.py", line 1191, in <module>
    BinaryViewType['ELF'].register_arch(83, Endianness.LittleEndian, Architecture["AVR"])
NameError: name 'BinaryViewType' is not defined
Python plugin 'binja-avr' could not be loaded
bmuessig commented 5 years ago

I have now added the following to __init__.py:

from binaryninja.binaryview import BinaryViewType
from binaryninja.enums import Endianness

This results in an internal error of the BN API itself:

Traceback (most recent call last):
  File "/opt/binaryninja/plugins/../python/binaryninja/architecture.py", line 890, in _get_stack_pointer_register
    return self._all_regs[self.stack_pointer]
KeyError: 'SP'
Loaded Python plugin 'binja-avr'
Knight-Ops commented 5 years ago

This is likely due to API changes within Binary Ninja. They may have changed how the disassemblers get certain registers. I don't have any AVR binaries available to test on currently, but I will try to look at the API changes soon.

On Sun, Apr 28, 2019, 8:51 AM Benedikt Müssig notifications@github.com wrote:

I have now added the following to init.py:

from binaryninja.binaryview import BinaryViewType from binaryninja.enums import Endianness

This results in an internal error of the BN API itself:

Traceback (most recent call last): File "/opt/binaryninja/plugins/../python/binaryninja/architecture.py", line 890, in _get_stack_pointer_register return self._all_regs[self.stack_pointer] KeyError: 'SP' Loaded Python plugin 'binja-avr'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cah011/binja-avr/issues/15#issuecomment-487376364, or mute the thread https://github.com/notifications/unsubscribe-auth/AEF5PNJUKBFKR6VKOIIDIRDPSWMTXANCNFSM4HI4FHWQ .