Skip to content

Commit

Permalink
fix magic current_raw_offset when no BV open
Browse files Browse the repository at this point in the history
  • Loading branch information
psifertex committed Jun 20, 2024
1 parent a5608df commit 43a3162
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def run(self):
self.context.binaryView.file.navigate(self.context.binaryView.file.view, snippetGlobals['here'])
if "current_address" in snippetGlobals and hasattr(self.context, "address") and snippetGlobals['current_address'] != self.context.address:
self.context.binaryView.file.navigate(self.context.binaryView.file.view, snippetGlobals['current_address'])
if "current_raw_offset" in snippetGlobals and hasattr(self.context, "address") and snippetGlobals['current_raw_offset'] != self.context.binaryView.get_data_offset_for_address(self.context.address):
if self.context.binaryView is not None and "current_raw_offset" in snippetGlobals and hasattr(self.context, "address") and snippetGlobals['current_raw_offset'] != self.context.binaryView.get_data_offset_for_address(self.context.address):
addr = self.context.binaryView.get_address_for_data_offset(snippetGlobals["current_raw_offset"])
if addr is not None:
if not self.context.binaryView.file.navigate(self.context.binaryView.file.view, addr):
Expand Down

0 comments on commit 43a3162

Please sign in to comment.