diff options
| author | Rusty Wagner <rusty@vector35.com> | 2018-07-26 16:02:26 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2018-07-26 16:18:02 -0400 |
| commit | 6eb3234d924d870641ee30c4263437f1d8a8d5c7 (patch) | |
| tree | b64815c5e0a2c3b1a10a3e3dcab4c786fdd85c34 /python/filemetadata.py | |
| parent | c5c93fc82b8929d04f62d241ca50228de60fa5f4 (diff) | |
| parent | 1f986c2698ff9df6d42429b1b7699842223634e5 (diff) | |
Merge branch 'dev' into test_stack_adjust
Diffstat (limited to 'python/filemetadata.py')
| -rw-r--r-- | python/filemetadata.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/python/filemetadata.py b/python/filemetadata.py index 4bfc0214..cafe1d67 100644 --- a/python/filemetadata.py +++ b/python/filemetadata.py @@ -18,16 +18,15 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. +from __future__ import absolute_import import traceback import ctypes -# Binary Ninja components -import _binaryninjacore as core -import startup -import associateddatastore -import log -import binaryview - +# Binary Ninja Components +import binaryninja +from binaryninja import _binaryninjacore as core +from binaryninja import associateddatastore #required for _FileMetadataAssociatedDataStore +from binaryninja import log class NavigationHandler(object): def _register(self, handle): @@ -66,12 +65,13 @@ class _FileMetadataAssociatedDataStore(associateddatastore._AssociatedDataStore) class FileMetadata(object): - _associated_data = {} - """ ``class FileMetadata`` represents the file being analyzed by Binary Ninja. It is responsible for opening, closing, creating the database (.bndb) files, and is used to keep track of undoable actions. """ + + _associated_data = {} + def __init__(self, filename = None, handle = None): """ Instantiates a new FileMetadata class. @@ -82,7 +82,7 @@ class FileMetadata(object): if handle is not None: self.handle = core.handle_of_type(handle, core.BNFileMetadata) else: - startup._init_plugins() + binaryninja._init_plugins() self.handle = core.BNCreateFileMetadata() if filename is not None: core.BNSetFilename(self.handle, str(filename)) @@ -167,7 +167,7 @@ class FileMetadata(object): view = core.BNGetFileViewOfType(self.handle, "Raw") if view is None: return None - return binaryview.BinaryView(file_metadata = self, handle = view) + return binaryninja.binaryview.BinaryView(file_metadata = self, handle = view) @property def saved(self): @@ -322,7 +322,7 @@ class FileMetadata(object): lambda ctxt, cur, total: progress_func(cur, total))) if view is None: return None - return binaryview.BinaryView(file_metadata = self, handle = view) + return binaryninja.binaryview.BinaryView(file_metadata = self, handle = view) def save_auto_snapshot(self, progress_func = None): if progress_func is None: @@ -341,7 +341,7 @@ class FileMetadata(object): view = core.BNCreateBinaryViewOfType(view_type, self.raw.handle) if view is None: return None - return binaryview.BinaryView(file_metadata = self, handle = view) + return binaryninja.binaryview.BinaryView(file_metadata = self, handle = view) def __setattr__(self, name, value): try: |
