summaryrefslogtreecommitdiff
path: root/plugins/python/androperms/androperms.py
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-12-21 23:34:14 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-12-21 23:34:14 (GMT)
commit3bfff245c47c4dd1404c5ea7af0ff4858ac8d130 (patch)
treedc3613e2ebdef4d04fa874335795268dba732d31 /plugins/python/androperms/androperms.py
parent0cfcbee3c536ac6d11ec806d47ce4c136f695697 (diff)
Resolved relative addresses for routines and fixed bugs related to PyGObjects construction.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@308 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
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())