Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to SMALI

Introduction to SMALI

smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation. The syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)

Subho Halder (Appknox)

October 09, 2019
Tweet

More Decks by Subho Halder (Appknox)

Other Decks in Programming

Transcript

  1. • Syntax is loosely based on Jasmin’s/Dedexer’s Syntax • Less

    overhead and easier to {de|re}compile dex files • Smali Representation of : Object blah = null; blah.toString(); Becomes: const v0, 0 //initialize the first local register to null or 0 invoke-virtual {v0}, Ljava/lang/Object;->toString(); Sunday, 28 July 13
  2. • There are two naming schemes for registers - the

    normal v naming scheme and the p naming scheme for parameter registers • v0 - the first local register • v1 - the second local register • v2 or p0 - the first parameter register • v3 or p1 - the second parameter register Sunday, 28 July 13
  3. • Classes are defined as .classs Lclassname • methods are

    defined as .method void main()V • methods are ended with .end-method • you need to return before you end a method. in case of its a void return, you can write return-void Sunday, 28 July 13