summaryrefslogtreecommitdiff
path: root/plugins/python/androperms/androperms.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/python/androperms/androperms.py')
-rw-r--r--plugins/python/androperms/androperms.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/plugins/python/androperms/androperms.py b/plugins/python/androperms/androperms.py
index 18443fc..ddccb8a 100644
--- a/plugins/python/androperms/androperms.py
+++ b/plugins/python/androperms/androperms.py
@@ -56,8 +56,9 @@ class AndroPerms(Plugin):
db = PermsDataBase()
db.filter_permissions(plist)
+ fmt = binary.get_format()
instrs = binary.get_instructions()
- buffer = binary.disassembled_buffer
+ buf = binary.disassembled_buffer
pfn = re.compile('<.* ([^ ]*)\(')
@@ -65,15 +66,20 @@ class AndroPerms(Plugin):
if i.keyword.startswith("invoke"):
- line = buffer.find_line_by_addr(i.address)
+ line = buf.find_line_by_addr(i.address)
text = line.get_text()
- #print "check %s" % text
-
name = pfn.search(text)
if name != None:
- #print " --> ", name.group(1)
- db.check_call(i.address, name.group(1))
+
+ resolved = fmt.resolve_relative_routine(i.address)
+
+ if resolved == None:
+ reladdr = "0x%08x" % i.address
+ else:
+ reladdr = "<%s()+0x%x>" % (resolved[0], resolved[1])
+
+ db.check_call(i.address, name.group(1), reladdr)
self._panel.memorize_permissions(binary, db.get_used_permissions())