forked from SecureBrain/JEB-sample-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlertMarker.py
More file actions
39 lines (33 loc) · 1017 Bytes
/
AlertMarker.py
File metadata and controls
39 lines (33 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# JEB sample script
# http://www.android-decompiler.com/
#
# AlertMarker.py
# Set(unset) alert marker to focued method.
#
# Copyright (c) 2013 SecureBrain
from jeb.api import IScript
from jeb.api.dex import Dex
from jeb.api.ui import View
import string
class AlertMarker(IScript):
def run(self, jeb):
self.jeb = jeb
self.dex = jeb.getDex()
self.ui = jeb.getUI()
success = self.start()
def start(self):
view = self.ui.getView(View.Type.ASSEMBLY)
msig = view.getCodePosition().getSignature()
md = self.dex.getMethodData(msig)
if not md:
print 'caret is not in method.'
return
f = md.getUserFlags()
print 'target:' + msig
if (f & Dex.FLAG_ALERT) == 0:
print 'set alert marker'
md.setUserFlags(f | Dex.FLAG_ALERT)
else:
print 'unset alert'
md.setUserFlags(f & ~Dex.FLAG_ALERT)
view.refresh()