summaryrefslogtreecommitdiff
path: root/plugins/python
diff options
context:
space:
mode:
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: