diff options
| author | Rusty Wagner <rusty@vector35.com> | 2017-06-23 18:36:37 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2017-06-23 18:36:37 -0400 |
| commit | c51f3bed6bdef577253feee0e85a71fda1931bd7 (patch) | |
| tree | 1cf26ff28e0b9bfb6bfbed044ba7ca520d63f862 /python/examples/notification_callbacks.py | |
| parent | 4b988c0d24c8d8c8dc67485f3aaeb7106eb4af18 (diff) | |
| parent | cca0fe6ea60eb7f6b35cc433a6fff96cc65b3ff8 (diff) | |
Merge branch 'dev'
Diffstat (limited to 'python/examples/notification_callbacks.py')
| -rw-r--r-- | python/examples/notification_callbacks.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/python/examples/notification_callbacks.py b/python/examples/notification_callbacks.py new file mode 100644 index 00000000..b7c9cde9 --- /dev/null +++ b/python/examples/notification_callbacks.py @@ -0,0 +1,51 @@ +from binaryninja import BinaryDataNotification, PluginCommand, log_info +import inspect + +def reg_notif(view): + demo_notification = DemoNotification(view) + view.register_notification(demo_notification) + +class DemoNotification(BinaryDataNotification): + def __init__(self, view): + self.view = view + + def data_written(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def data_inserted(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def data_removed(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def function_added(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def function_removed(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def function_updated(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def data_var_added(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def data_var_updated(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def data_var_removed(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def string_found(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def string_removed(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def type_defined(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + + def type_undefined(self, *args): + log_info(inspect.stack()[0][3] + str(args)) + +PluginCommand.register("Register Notification", "", reg_notif) |
