Skip to content

Commit

Permalink
Merge pull request #1 from FreedomCoder/master
Browse files Browse the repository at this point in the history
Changes and first commit
  • Loading branch information
swdunlop committed Jul 14, 2011
2 parents e48a9b9 + ff601ea commit bc605f8
Show file tree
Hide file tree
Showing 37 changed files with 99 additions and 35 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Special Thanks go to the creator and brain behind this project:

Scott W. Dunlop <swdunlop@gmail.com>
Creator and developer of AndBug.

Thanks go to the following people for patches and contributions:

Matias Pablo Brutti <matiasbrutti@gmail.com>
Only a few touches here and there.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Since AndBug is currently where we (IOActive) offer our own internal tools and t
License
-------

Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
Copyright 2011, IOActive All rights reserved.

AndBug is free software: you can redistribute it and/or modify it under
the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion andbug
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/break.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/class_trace.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/classes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/dump.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/exit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/help.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
55 changes: 55 additions & 0 deletions lib/andbug/cmd/method_trace.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
## published by the Free Software Foundation.
##
## AndBug is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
## FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
## more details.
##
## You should have received a copy of the GNU Lesser General Public License
## along with AndBug. If not, see <http://www.gnu.org/licenses/>.

'implementation of the "mtrace" command'

import andbug.command, andbug.screed, andbug.options
from Queue import Queue

def report_hit(t):
t = t[0]
try:
with andbug.screed.section("trace %s" % t):
f = t.frames[0]
name = str(f.loc)
if f.native:
name += ' <native>'
with andbug.screed.item(name):
for k, v in f.values.items():
andbug.screed.item( "%s=%s" %(k, v))
finally:
t.resume()

def cmd_hook_methods(ctxt, cpath, mpath):
for c in ctxt.sess.classes(cpath):
for m in c.methods(mpath):
l = m.firstLoc
if l.native:
andbug.screed.item('Could not hook native %s' % l)
continue
l.hook(func = report_hit)
andbug.screed.item('Hooked %s' % l)

@andbug.command.action(
'<method>', name='method-trace', aliases=('mt','mtrace'), shell=True
)
def method_trace(ctxt, mpath):
'reports calls to specific dalvik method'

cpath, mname, mjni = andbug.options.parse_mquery(".".join(mpath.split('.')[0:-1]), mpath.split('.')[-1])

with andbug.screed.section('Setting Hooks'):
cmd_hook_methods(ctxt, cpath, mname)

ctxt.block_exit()
2 changes: 1 addition & 1 deletion lib/andbug/cmd/methods.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/resume.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/shell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/source.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/statics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/suspend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/cmd/threads.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/options.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/proto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/screed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/source.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are
Expand Down
2 changes: 1 addition & 1 deletion lib/andbug/vm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/jdwp/jdwp.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/jdwp/wire.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
/* Copyright 2011, IOActive All rights reserved.
AndBug is free software: you can redistribute it and/or modify it under
the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion lib/jdwp/wire.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
/* Copyright 2011, IOActive All rights reserved.
AndBug is free software: you can redistribute it and/or modify it under
the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion tests/jdwp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion tests/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion tests/options.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down
2 changes: 1 addition & 1 deletion tests/proto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright 2011, Scott W. Dunlop <swdunlop@gmail.com> All rights reserved.
## Copyright 2011, IOActive, Inc. All rights reserved.
##
## AndBug is free software: you can redistribute it and/or modify it under
## the terms of version 3 of the GNU Lesser General Public License as
Expand Down

0 comments on commit bc605f8

Please sign in to comment.