GithubHelp home page GithubHelp logo

silentsignal / android-param-annotate Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 2.0 3 KB

Android parameter annotator for Dalvik/Smali disassembly

Home Page: https://blog.silentsignal.eu/2016/06/16/accessing-local-variables-in-proguarded-android-apps/

License: MIT License

Python 100.00%
dalvik android

android-param-annotate's Introduction

Android parameter annotator for Dalvik/Smali disassembly

Debugging applications without access to the source code always has its problems, especially with debuggers that were built with developers in mind, who obviously doesn't have this restriction.

The Dalvik implementation of JDWP refuses to give any information about parameters at all if the DEX file was built without local variable information, making debugging with JDB difficult.

This simple Python script reads each Smali file and populates this metadata that can be extracted from the mangled function name found in the Dalvik bytecode.

Read more in our blog post about this script

Usage

python3 annotate.py <root directory of smali files>

Dependencies

  • Python 3.x (tested on 3.5.1)

License

The whole project is available under MIT license, see LICENSE.txt.

android-param-annotate's People

Contributors

dnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

android-param-annotate's Issues

Support for wide parameters

Current state:

smali/net/sqlcipher/CursorWindow.smali[935,4] Register p2 is the second half of a wide parameter.
smali/net/sqlcipher/CursorWindow.smali[970,4] Register p2 is the second half of a wide parameter.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: net/sqlcipher/CursorWindow.smali
        at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:75)
        at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:59)
        at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
        at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:404)
        at brut.androlib.Androlib.buildSources(Androlib.java:335)
        at brut.androlib.Androlib.build(Androlib.java:291)
        at brut.androlib.Androlib.build(Androlib.java:263)
        at brut.apktool.Main.cmdBuild(Main.java:227)
        at brut.apktool.Main.main(Main.java:84)

J and D are affected: https://github.com/JesusFreke/smali/wiki/Registers#longdouble-values

Annotation of local variable

Is this script only limited to annotating the parameters and not local variables in which we could not display the value of the local variables when debugging using jdb? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.