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

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

5 slides
  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

More Decks by Subho Halder (Appknox)

Other Decks in Programming