summaryrefslogtreecommitdiff
path: root/plugins/python
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-06-13 22:46:38 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-06-13 22:46:38 (GMT)
commit0f3bbcb376ee4f76142ac4ddf729403fecac2641 (patch)
tree1015b219c8125afe0689384d04f6e37130bd2fba /plugins/python
parentaed45245289e3e16d421aa6154dcb803e86addaa (diff)
Fixed Elf format support.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@353 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/python')
-rw-r--r--plugins/python/androperms/androperms.py6
-rw-r--r--plugins/python/androperms/panel.py5
2 files changed, 10 insertions, 1 deletions
diff --git a/plugins/python/androperms/androperms.py b/plugins/python/androperms/androperms.py
index ddccb8a..f68b9a5 100644
--- a/plugins/python/androperms/androperms.py
+++ b/plugins/python/androperms/androperms.py
@@ -5,6 +5,7 @@ from manifest import AndroidManifest
from db import PermsDataBase
from panel import PermsPanel
from pychrysalide import Plugin
+from pychrysalide.format.dex import DexFormat
from xml.dom import minidom
import re
@@ -31,6 +32,10 @@ class AndroPerms(Plugin):
def execute_on_binary(self, binary, action):
"""Process once a binary is disassembled."""
+ fmt = binary.get_format()
+ if not isinstance(fmt, DexFormat):
+ return False
+
zf = zipfile.ZipFile(binary.get_filename())
f = zf.open('AndroidManifest.xml', 'r')
@@ -56,7 +61,6 @@ class AndroPerms(Plugin):
db = PermsDataBase()
db.filter_permissions(plist)
- fmt = binary.get_format()
instrs = binary.get_instructions()
buf = binary.disassembled_buffer
diff --git a/plugins/python/androperms/panel.py b/plugins/python/androperms/panel.py
index b892339..8f8e925 100644
--- a/plugins/python/androperms/panel.py
+++ b/plugins/python/androperms/panel.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+from pychrysalide.format.dex import DexFormat
from pychrysalide.gui.panels import PanelItem
import gtk
@@ -88,6 +89,10 @@ class PermsPanel(PanelItem):
self._store.clear()
+ fmt = binary.get_format()
+ if not isinstance(fmt, DexFormat):
+ return False
+
used = self._perms[binary]
for p in used: