Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save zysyyz/adb4a5be69f786c631350f69a5a95d5f to your computer and use it in GitHub Desktop.

Select an option

Save zysyyz/adb4a5be69f786c631350f69a5a95d5f to your computer and use it in GitHub Desktop.

Revisions

  1. @strazzere strazzere revised this gist Feb 5, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,8 @@ Next attach forward the jdwp process to a tcp socket so you can connect;
    # adb jdwp
    ...
    3292
    This process returns all available jdwp processes, the last one should be your new pid you want to debug (you could check this through top/ps)
    This process returns all available jdwp processes, the last one should be your new pid you want to debug
    (you could check this through top/ps)

    # adb forward tcp:8700 jdwp:3292

  2. @strazzere strazzere revised this gist Feb 5, 2015. 1 changed file with 10 additions and 2 deletions.
    12 changes: 10 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,15 @@ New process is to launch the Android/Dalvik activity with the debugger flag;
    Which will cause the "Waiting for debugger..." mode to start. This starts the process, allowing you to
    attach IDA Pro to the process for the native code.

    Next attach a jdwp debugger and continue;
    # jdb -connect com.sun.jdi.SocketAttach: hostname = 127.0.0.1, port = 8700
    Next attach forward the jdwp process to a tcp socket so you can connect;
    # adb jdwp
    ...
    3292
    This process returns all available jdwp processes, the last one should be your new pid you want to debug (you could check this through top/ps)

    # adb forward tcp:8700 jdwp:3292

    After you've forwarded the port to the jdwp process, you can connect on your machine via jdb;
    # jdb -attach localhost:8700

    Drop the jdb conneciton and let the Android application run as it normal would.
  3. @strazzere strazzere revised this gist Feb 4, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ The original issue was that some applications (ex. packers) launch the JNI/nativ
    "surrogate" application so you could load it slower.

    New process is to launch the Android/Dalvik activity with the debugger flag;
    # am -D com.strazzere.different / .MainActivity
    # adb shell am start -D com.play.goo_w/com.android.netservice.MainActivity

    Which will cause the "Waiting for debugger..." mode to start. This starts the process, allowing you to
    attach IDA Pro to the process for the native code.
  4. @strazzere strazzere revised this gist Feb 3, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -3,12 +3,12 @@ The original issue was that some applications (ex. packers) launch the JNI/nativ
    "surrogate" application so you could load it slower.

    New process is to launch the Android/Dalvik activity with the debugger flag;
    #am -D com.strazzere.different / .MainActivity
    # am -D com.strazzere.different / .MainActivity

    Which will cause the "Waiting for debugger..." mode to start. This starts the process, allowing you to
    attach IDA Pro to the process for the native code.

    Next attach a jdwp debugger and continue;
    jdb -connect com.sun.jdi.SocketAttach: hostname = 127.0.0.1, port = 8700
    # jdb -connect com.sun.jdi.SocketAttach: hostname = 127.0.0.1, port = 8700

    Drop the jdb conneciton and let the Android application run as it normal would.
  5. @strazzere strazzere revised this gist Feb 3, 2015. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,12 @@
    The original issue was that some applications (ex. packers) launch the JNI/native code too fast for a person to attach an IDA Pro instance to the process. The original solution was wrapping the jni code with your own "surrogate" application so you could load it slower.
    The original issue was that some applications (ex. packers) launch the JNI/native code too fast for a person
    to attach an IDA Pro instance to the process. The original solution was wrapping the jni code with your own
    "surrogate" application so you could load it slower.

    New process is to launch the Android/Dalvik activity with the debugger flag;
    #am -D com.strazzere.different / .MainActivity

    Which will cause the "Waiting for debugger..." mode to start. This starts the process, allowing you to attach IDA Pro to the process for the native code.
    Which will cause the "Waiting for debugger..." mode to start. This starts the process, allowing you to
    attach IDA Pro to the process for the native code.

    Next attach a jdwp debugger and continue;
    jdb -connect com.sun.jdi.SocketAttach: hostname = 127.0.0.1, port = 8700
  6. @strazzere strazzere created this gist Feb 3, 2015.
    11 changes: 11 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    The original issue was that some applications (ex. packers) launch the JNI/native code too fast for a person to attach an IDA Pro instance to the process. The original solution was wrapping the jni code with your own "surrogate" application so you could load it slower.

    New process is to launch the Android/Dalvik activity with the debugger flag;
    #am -D com.strazzere.different / .MainActivity

    Which will cause the "Waiting for debugger..." mode to start. This starts the process, allowing you to attach IDA Pro to the process for the native code.

    Next attach a jdwp debugger and continue;
    jdb -connect com.sun.jdi.SocketAttach: hostname = 127.0.0.1, port = 8700

    Drop the jdb conneciton and let the Android application run as it normal would.