Skip to content

Commit 6267492

Browse files
CouleeAppsemesare
authored andcommitted
[SharedCache] Add python magic variable
1 parent ebff89f commit 6267492

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

view/sharedcache/api/python/sharedcache.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,15 @@ def symbols(self) -> [CacheSymbol]:
254254
result.append(symbol_from_api(value[i]))
255255
sccore.BNSharedCacheFreeSymbolList(value, count)
256256
return result
257-
258-
257+
258+
259+
def _get_dsc(instance: binaryninja.PythonScriptingInstance):
260+
if instance.interpreter.active_view is None:
261+
return None
262+
return SharedCache(instance.interpreter.active_view)
263+
264+
265+
binaryninja.PythonScriptingProvider.register_magic_variable(
266+
"dsc",
267+
_get_dsc
268+
)

0 commit comments

Comments
 (0)