summaryrefslogtreecommitdiff
path: root/plugins/python/samples/demo.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/python/samples/demo.py')
-rw-r--r--plugins/python/samples/demo.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/python/samples/demo.py b/plugins/python/samples/demo.py
new file mode 100644
index 0000000..c406231
--- /dev/null
+++ b/plugins/python/samples/demo.py
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+from pychrysalide import Plugin
+from pychrysalide.gui.panels import LogPanel
+
+from basic_blocks import show_basic_blocks
+
+
+class Demo(Plugin):
+ """Demonstration plugin."""
+
+ def init(self, ref):
+ """Initialize the plugin."""
+
+ LogPanel.log_message(LogPanel.LMT_WARNING, 'Welcome to the demo Python plugin !')
+
+ return True
+
+
+ def get_action(self):
+ """Register the plugin for given actions."""
+
+ return Plugin.PGA_BINARY_GROUPED
+
+
+ def execute_on_binary(self, binary, action):
+ """Process registered actions."""
+
+ show_basic_blocks(binary)