元始天尊 发表于 2016-6-5 14:19:36

在Windows上使用AndBug

AndBug是linux下java/android的调试器,可以在linux下编译运行,此次修改我增加了对windows-cygwin的支持
原始工程https://github.com/swdunlop/AndBug
新工程https://github.com/lichao890427/AndBugForWin
改动如下:
wire.c                增加__CYGWIN___宏定义处理
                        修改几处c语言变量作用域导致编译失败问题
proto.py        由于win下不支持localfilesystem监听,因此改成tcp
util.py                解析adb ps时会出现空集合,删除之

使用:
安装vs2008
git clone
make
./andbug shell -p com.android.phone
>> classes
## Loaded Classes
   -- java.lang.Long
   -- android.graphics.LightingColorFilter
   -- android.os.StrictMode$LogStackTrace
   -- android.net.Uri$Part
   -- com.android.internal.telephony.BaseCommands
   -- com.android.internal.app.AlertController$ButtonHandler
   -- com.android.internal.telephony.Call$State
   -- java.security.KeyFactorySpi
   -- android.util.StateSet

   >> help
## AndBug (C) 2011 Scott W. Dunlop <swdunlop@gmail.com>
   The AndBug shell is a simple interactive console shell that reduces typing and overhead involved in setting up a
   debugging session.Commands entered at the prompt will be evaluated using the current device and process as a
   context.Where possible, AndBug uses readline; if your Python install lacks readline, this shell will be more
   difficult to use due to the poor console I/O functionality in vanilla Python.(The "rlwrap"utility may help.)

   AndBug is NOT intended for a piracy tool, or other illegal purposes, butas a tool for researchers and developers to
   gain insight into theimplementation of Android applications.Use of AndBug is at your own risk, like most open
   source tools, and no guarantee of fitness or safety is made or implied.
## Commands:
   -- break | b <class> [<method>]
      set breakpoint
   -- break-list
      list active breakpoints/hooks
   -- break-remove <eid/all>
      remove hook/breakpoint
   -- class-trace | ct | ctrace <class-path>
      reports calls to dalvik methods associated with a class
   -- classes [<partial class name>]
      lists loaded classes. if no partial class name supplied, list all classes.
   -- dump <class-path> [<method-query>]
      dumps methods using original sources or apktool sources
   -- exit
      terminates andbug with prejudice
   -- help [<command>]
      information about how to use andbug
   -- inspect <object-id>
      inspect an object
   -- method-trace | mt | mtrace <method>
      reports calls to specific dalvik method
   -- methods <class-path> [<method-query>]
      lists the methods of a class
   -- resume [<name>]
      resumes threads in the process
   -- shell
      starts the andbug shell with the specified process
   -- source <src-dir>
      adds a source directory for finding files
   -- statics <class-path>
      lists the methods of a class
   -- suspend [<name>]
      suspends threads in the process
   -- thread-trace | tt | ttrace <thread-name>
      reports calls to specific thread in the process
   -- threads [<name>]
      lists threads in the process. verbosity: 0 (thread), (1 methods), (2 vars), (3 vars data)
## Examples:
   -- threads
   -- threads verbose=2
   -- threads "Signal Catcher" verbose=3
   -- classes
   -- classes ioactive
   -- methods com.ioactive.decoy.DecoyActivity onInit
   -- method-trace com.ioactive.decoy.DecoyActivity
页: [1]
查看完整版本: 在Windows上使用AndBug