binaryninja.filemetadata.FileMetadata¶
-
class
binaryninja.filemetadata.FileMetadata(filename=None, handle=None)[source]¶ class FileMetadatarepresents 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.-
__init__(filename=None, handle=None)[source]¶ Instantiates a new FileMetadata class.
Parameters: - filename – The string path to the file to be opened. Defaults to None.
- handle – A handle to the underlying C FileMetadata object. Defaults to None.
Methods
__init__([filename, handle])Instantiates a new FileMetadata class. begin_undo_actions()begin_undo_actionsstart recording actions taken so the can be undone at some point.close()Closes the underlying file handle. commit_undo_actions()commit_undo_actionscommit the actions taken since the last commit to the undo database.create_database(filename[, progress_func])get_view_of_type(name)navigate(view, offset)open_existing_database(filename[, progress_func])redo()redoredo the last commited action in the undo database.save_auto_snapshot([progress_func])set_default_session_data(name, value)undo()undoundo the last commited action in the undo database.Attributes
analysis_changedBoolean result of whether the auto-analysis results have changed (read-only) filenameThe name of the file (read/write) has_databaseWhether the FileMetadata is backed by a database (read-only) modifiedBoolean result of whether the file is modified (Inverse of ‘saved’ property) (read/write) navigationoffsetThe current offset into the file (read/write) rawGets the “Raw” BinaryView of the file savedBoolean result of whether the file has been saved (Inverse of ‘modified’ property) (read/write) session_dataDictionary object where plugins can store arbitrary data associated with the file view-