Changelog

A small patch created by TheZ3ro <https://github.com/TheZ3ro> fixing the following issues:

  • Fixed sparse_switch executor that was not executed due to a typo

  • String regex now support handling of unicode strings (e.g. const-string v0, "\u06e4\u06eb”), which initially would result in an error

In addition, this patch introduces the following new features:

  • Hex values regex now support negative and positive numbers (e.g. const v1, -0x1)

  • Added move_object executor

  • Added java.lang.String.hashCode() implementation as a direct-call

  • Refactored direct-call implementations for Object and Class

0.2.1

Kudos to serenees for fixing these issues:

  • Fixed an issue where Line.split_line would return incorrect results if the input string started with the provided separator.

  • Added “.subannotation” token verification

  • Added support to handle unnamed “.param” declarations

  • Changed exception descriptor of “.catchall” to Ljava/lang/Exception; for all cases

0.2.0

This minor update includes a new smali type system and removes the SmaliValueProxy. The following changes were made:

  • Removed the class SmaliValueProxy completely, the method smali_value now returns one of: int, float, str, SVMType, bool

  • New classes SVMType and Signature to represent smali types:

    Some usage examples
     1from smali import SVMType, Signature
     2
     3# simple type instance
     4t = SVMType("Lcom/example/Class;")
     5t.simple_name # Class
     6t.pretty_name # com.example.Class
     7t.dvm_name # com/example/Class
     8t.full_name # Lcom/example/Class;
     9t.svm_type # SVMType.TYPES.CLASS
    10
    11# create new type instance for method signature
    12m = SVMType("getName([BLjava/lang/String;)Ljava/lang/String;")
    13m.svm_type # SVMType.TYPES.METHOD
    14# retrieve signature instance
    15s = m.signature or Signature(m)
    16s.return_type # SVMType("Ljava/lang/String;")
    17s.parameter_types # [SVMType("[B"), SVMType("Ljava/lang/String;")]
    18s.name # getName
    19s.declaring_class # would return the class before '->' (only if defined)
    20
    21# array types
    22array = SVMType("[B")
    23array.svm_type # SVMType.TYPES.ARRAY
    24array.array_type # SVMType("B")
    25array.dim # 1 (one dimension)
    

0.1.3

  • Fixed an issue in SmaliReader that causes it to run into infinite loops (kudos to metalcorpe)

  • Moved to Github-Pages instead of ReadTheDocs

  • Added the field parent to an execution Frame to enable backtracking of call stacks

  • Some issues around Type and SmaliValueProxy fixed

0.1.2

  • SmaliVM is now able to use customized executors.

    Note

    The default class loader won’t throw any exception upon unknown by default. You can change this behaviour by setting the use_strict attribute to True:

    vm = SmaliVM(use_strict=True)
    
  • Code was formatted properly

  • Documentation update

0.1.1

  • ISmali (interactive Smali shell) pre-release

  • Implementation of almost half of all Smali-opcodes

  • Fixed an error of SmaliValueProxy that caused exceptions on operations with an object of the same class

  • Multiple bug fixes in the process of class definition (import)

0.0.1

  • Start keeping changelog :)

  • Documentation on Smali language

  • Smali parser implementation (line-based)

  • Small Smali-VM