summaryrefslogtreecommitdiff
path: root/plugins/python/samples/demo.py
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-01-26 19:41:04 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-01-26 19:41:04 (GMT)
commit2050b07c42c15738662dd9b3c5841694b64ab2a3 (patch)
treef6283df4b4775f0c4e42e14025d67443f8fdf9b5 /plugins/python/samples/demo.py
parentb0b35292cb22899b1b23556be452eb827e4010d7 (diff)
Provided some debug helpers as plugin samples.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@330 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
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)