smali语法及参考说明

2023-11-19

 smali语法可以参考官方说明,因为google服务器经常无法访问,这里把重要点摘抄出来。文章挺浅显的,就不翻译了

TypesMethodsAndFields  
Some general information about how types, methods and fields are represented in dalvik bytecode
Updated  Jul 20, 2011

Types

dalvik's bytecode has two major classes of types, primitive types and reference types. Reference types are objects and arrays, everything else is a primitive.

Primitives are represented by a single letter. I didn't come up with these abbreviations - they are what is actually stored in the dex file, in string form. They are specified in the dex-format.html document (dalvik/docs/dex-format.html in the AOSP repository)

V void - can only be used for return types
Z boolean
B byte
S short
C char
I int
J long (64 bits)
F float
D double (64 bits)

Objects take the form Lpackage/name/ObjectName; - where the leading L indicates that it is an object type, package/name/ is the package that the object is in, ObjectName is the name of the object, and ; denotes the end of the object name. This would be equivalent topackage.name.ObjectName in java. Or for a more concrete example, Ljava/lang/String; is equivalent to java.lang.String

Arrays take the form [I - this would be an array of ints with a single dimension. i.e. int[] in java. For arrays with multiple dimensions, you simply add more [ characters. [[I = int[][][[[I = int[][][], etc. (Note: The maximum number of dimensions you can have is 255).

You can also have arrays of objects, [Ljava/lang/String; would be an array of Strings.

Methods

Methods are always specified in a very verbose form that includes the type that contains the method, the method name, the types of the parameters and the return type. All this information is required for the virtual machine to be able to find the correct method, and to be able to perform static analysis on the bytecode (for verification/optimization purposes)

They take the form

Lpackage/name/ObjectName;->MethodName(III)Z

In this example, you should recognize Lpackage/name/ObjectName; as a type. MethodName is obviously the name of the method. (III)Z is the method's signature. III are the parameters (in this case, 3 ints), and Z is the return type (bool).

The method parameters are listed one right after another, with no separators between them.

Here's a more complex example:

method(I[[IILjava/lang/String;[Ljava/lang/Object;)Ljava/lang/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

smali语法及参考说明 的相关文章

随机推荐

  • 芯片开发语言的简单区别介绍。Verilog、VHDL、System Verilog、SystemC、Matlab、C/C++等

    芯片开发语言的简单区别介绍 芯片设计前端的流程很长 和芯片前端相关的语言也很多 比如Verilog VHDL System Verilog SystemC Matlab C C 等等 但没有一个语言能够做到适合于整个前端流程 每种语言都有适
  • 【Kubernetes运维篇】零故障升级Pod健康探测详解

    文章目录 一 Pod健康探测介绍 1 三种容器探测方法 2 常用三种探测探针 3 探针相关属性说明 二 探测案例 1 Pod启动探测案例 startupProbe 2 Pod存活探测案例 livenessProbe 3 Pod就绪探测案例
  • QT QComboBox使用详解

    本文详细的介绍了QComboBox控件的各种操作 例如 下拉框添加内容 默认显示 获取下拉框总行数 获取选中索引 获取当前内容 清除列表 重绘下拉框等操作 本文作者原创 转载请附上文章出处与本文链接 QComboBox控件全面详解目录 1
  • RNA 31. SCI文章临床蛋白质组肿瘤在线数据挖掘神器(CPTAC)

    桓峰基因公众号推出转录组分析教程 有需要生信的老师可以联系我们 转录分析教程整理如下 RNA 1 基因表达那些事 基于 GEO RNA 2 SCI文章中基于GEO的差异表达基因之 limma RNA 3 SCI 文章中基于T CGA 差异表
  • 框架学习——带你了解SpringBoot框架

    目录 一 SpringBoot简介 1 1 原有Spring优缺点分析 1 1 1 Spring的优点分析 1 1 2 Spring的缺点分析 1 2 SpringBoot的概述 1 2 1 SpringBoot的特点 1 2 2 Spri
  • Qt(day3)

    思维导图 小练习 second h ifndef SECOND H define SECOND H include
  • (145) Table ‘./addon_collect_wukong_spider‘ is marked as crashed and should be repaired解决思路

    discuz更新插件时报错 145 Table addon collect wukong spider is marked as crashed and should be repaired解决办法 解决思路 打开phpmyadmin 选择
  • 用磁盘压缩卷新建分区和磁盘压缩卷还原问题

    转载 磁盘压缩卷新建分区 http jingyan baidu com article fedf073776922935ad897751 html 磁盘压缩卷还原 https zhidao baidu com question 304344
  • Linux常用命令之文件管理命令

    目录 1 ls 2 gt 输入 输出重定向和 管道命令 3 chmod命令 4 cd命令 5 mkdir和rmdir命令 6 cp命令 7 rm命令 8 mv命令 9 cat命令 10 pwd命令 11 ln命令 12 grep命令 13
  • http协议学习系列

    1 基础概念篇 1 1 介绍 HTTP是Hyper Text Transfer Protocol 超文本传输协议 的缩写 它的发展是万维网协会 World Wide Web Consortium 和Internet工作小组IETF Inte
  • 数据集加载--load_digits

    目录 主要参数 n class return X y as frame 返回值 return X y True return X y False Bunch对象的属性 data target feature names list targe
  • 100天精通Python(爬虫篇)——第47天:selenium自动化操作浏览器(基础+代码实战)

    文章目录 一 Selenium框架环境搭建 1 下载模块 2 安装浏览器驱动WebDriver 二 基础操作 1 打开浏览器 2 无界面模式 3 元素定位 4 元素操作 5 前进后退 6 执行js 7 页面等待 隐式等待 常用 显式等待 了
  • SPI、I2C、UART、CAN

    一 简介 1 SPI SPI Serial Peripheral Interface 串行外设接口 是Motorola公司提出的一种同步串行数据传输标准 在很多器件中被广泛应用 接口 SPI接口经常被称为4线串行总线 以主 从方式工作 数据
  • Go内存管理及性能观测工具

    内存管理 TCMalloc Golang内存分配算法主要源自Google的TCMalloc算法 TCMalloc将内存分成三层最外层Thread Cache 中间层Central Cache 最里层Page Heap Thread Cach
  • 利用hbase api在本地访问并操作服务器的hbase数据库

    最近因为实验室项目需要 开始研究了hbase 然后想一次性往集群服务器上写入大量的数据 并存到hbase中 考虑到在hbase shell下只能单个数据put 这样对于批量插入数据的要求完全不合适 于是就研究起hbase的java api
  • 只要 3 个注解,优雅的实现微服务鉴权!

    原创 不才陈某 码猿技术专栏 2023 04 17 08 50 发表于山东 大家好 我是不才陈某 前面的文章中介绍了网关集成Spring Security实现网关层面的统一的认证鉴权 有不清楚的可以看之前的文章 实战干货 Spring Cl
  • Java面向对象编程(建议收藏)

    面向对象编程是一种方法 被广泛引用与Java中 接下来我将从 包 继承 组合 多态 抽象类和接口这几个方面进行全面的讲解 一 包 包是组织类的一种方式 包从直观上看就是一个文件夹 jar包中包含的都是字节码文件 包一般分为导入默认包 静态导
  • obs 之 OBSObj

    从实例学习c 之 1 内联构造 虚构2 移动构造 移动赋值3 禁用拷贝构造和赋值4 该类虚构不为 virtual 5 使用实例 using OBSDisplay OBSObj
  • 【一键卸载mysql-5.7.38数据库+dos命令bat脚本】

    一键彻底卸载mysql 5 7 38数据库 echo off color 0e echo Start Delete MySQL Process echo Author LSJ echo echo 删除注册表开始 Regedit echo r
  • smali语法及参考说明

    smali语法可以参考官方说明 因为google服务器经常无法访问 这里把重要点摘抄出来 文章挺浅显的 就不翻译了 TypesMethodsAndFields Some general information about how types