【问题标题】:What does the following smali terminology mean?以下 smali 术语是什么意思?
【发布时间】:2016-09-30 08:04:45
【问题描述】:

我最近一直在研究一些 smali 编码的文件,其中有一些我不理解的术语,并且在任何地方都没有解释(甚至在 dalvik opcodes 站点中也没有)。让我们开始回答问题

1. What is ->?
2. What is (somerandomletter):I, F, J, S, C, B etc. (any element encoding letter)? 
   example of both in one: Lcom/google/android/gms/games/achievement/AchievementEntity;->j:I
3. What is this god damned v1, v2, v3, or v4 I see everywhere?
   ex. const-string/jumbo v1, "Type"
4. What is invoke-static and invoke-interface?
   ex. invoke-interface {p0},      Lcom/google/android/gms/games/achievement/Achievement;->n()J
   ex. invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
5. What are interfaces and public or private fields?

【问题讨论】:

    标签: smali


    【解决方案1】:
    1. -> 是用于表示成员(方法或字段)的语法。
    2. 这些是原始类型。它们记录在https://source.android.com/devices/tech/dalvik/dex-format.html(搜索“TypeDescriptor Semantics”)。另见https://github.com/JesusFreke/smali/wiki/TypesMethodsAndFields

    Lcom/google/android/gms/games/achievement/AchievementEntity;->j:I 是对字段的引用。 Lcom/google/android/gms/games/achievement/AchievementEntity; 是包含字段的类,-> 是表示成员的语法,j 是字段的名称,: 只是一个分隔符,I 是字段的类型(整数)。

    1. 这些是寄存器。你可以在https://source.android.com/devices/tech/dalvik/dalvik-bytecode.htmlhttps://github.com/JesusFreke/smali/wiki/Registers找到更多信息

    2. 这些记录在https://source.android.com/devices/tech/dalvik/dalvik-bytecode.html

    invoke-static 用于调用静态方法(始终被视为直接方法)。

    invoke-interface 用于调用接口方法,即在具体类未知的对象上,使用引用接口的 method_id。

    1. 这些与接口以及公共和私有字段的标准 java 概念相匹配。

    【讨论】:

      猜你喜欢
      • 2013-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-15
      • 2013-10-06
      • 2010-12-17
      相关资源
      最近更新 更多