ImageVerifierCode 换一换
格式:DOCX , 页数:34 ,大小:26.72KB ,
资源ID:11045519      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/11045519.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(dalvik opcodes.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

dalvik opcodes.docx

1、dalvik opcodesDalvik opcodes,对于理解smali文件有很大帮助。 Dalvik opcodesAuthor:Gabor PallerVx values in the table denote a Dalvik register. Depending on the instruction, 16, 256 or 64k registers can be accessed. Operations on long and double values use two registers, e.g. a double value addressed in the V0 reg

2、ister occupies the V0 and V1 registers.Boolean values are stored as 1 for true and 0 for false. Operations on booleans are translated into integer operations.All the examples are in hig-endian format, e.g. 0F00 0A00 is coded as0F, 00, 0A, 00 sequence.Note there are no explanation/example at some ins

3、tructions. This means that I have not seen that instruction in the wild and its presence/name is only known fromAndroid opcode constant list.Opcode (hex)Opcode nameExplanationExample00nopNo operation0000 - nop01move vx,vyMoves the content of vy into vx. Both registers must be in the first 256 regist

4、er range.0110 - move v0, v1Moves v1 into v0.02move/from16 vx,vyMoves the content of vy into vx. vy may be in the 64k register range while vx is one of the first 256 registers.0200 1900 - move/from16 v0, v25Moves v25 into v0.03move/1604move-wide05move-wide/from16 vx,vyMoves a long/double value from v

5、y to vx. vy may be in the 64k register range while wx is one of the first 256 registers.0516 0000 - move-wide/from16 v22, v0Moves v0 into v22.06move-wide/1607move-object vx,vyMoves the object reference from vy to vx.0781 - move-object v1, v8Moves the object reference in v8 to v1.08move-object/from16

6、 vx,vyMoves the object reference from vy to vx, vy can address 64k registers and vx can address 256 registers.0801 1500 - move-object/from16 v1, v21Move the object reference in v21 to v1.09move-object/160Amove-result vxMove the result value of the previous method invocation into vx.0A00 - move-resul

7、t v0Move the return value of a previous method invocation into v0.0Bmove-result-wide vxMove the long/double result value of the previous method invocation into vx,vx+1.0B02 - move-result-wide v2Move the long/double result value of the previous method invocation into v2,v3.0Cmove-result-object vxMove

8、 the result object reference of the previous method invocation into vx.0C00 - move-result-object v00Dmove-exception vxMove the exception object reference thrown during a method invocation into vx.0D19 - move-exception v250Ereturn-voidReturn without a return value0E00 - return-void0Freturn vxReturn w

9、ith vx return value0F00 - return v0Returns with return value in v0.10return-wide vxReturn with double/long result in vx,vx+1.1000 - return-wide v0Returns with a double/long value in v0,v1.11return-object vxReturn with vx object reference value.1100 - return-object v0Returns with object reference val

10、ue in v012const/4 vx,lit4Puts the 4 bit constant into vx1221 - const/4 v1, #int2Moves literal 2 into v1. The destination register is in the lower 4 bit in the second byte, the literal 2 is in the higher 4 bit.13const/16 vx,lit16Puts the 16 bit constant into vx1300 0A00 - const/16 v0, #int 10Puts the

11、 literal constant of 10 into v0.14const vx, lit32Puts the integer constant into vx1400 4E61 BC00 - const v0, #12345678 / #00BC614EMoves literal 12345678 into v0.15const/high16 v0, lit16Puts the 16 bit constant into the topmost bits of the register. Used to initialize float values.1500 2041 - const/h

12、igh16 v0, #float 10.0 / #41200000Moves the floating literal of 10.0 into v0. The 16 bit literal in the instruction carries the top 16 bits of the floating point number.16const-wide/16 vx, lit16Puts the integer constant into vx and vx+1 registers, expanding the integer constant into a long constant.1

13、600 0A00 - const-wide/16 v0, #long 10Moves literal 10 into v0 and v1 registers.17const-wide/32 vx, lit32Puts the 32 bit constant into vx and vx+1 registers, expanding the integer constant into a long constant.1702 4e61 bc00 - const-wide/32 v2, #long 12345678 / #00bc614ePuts #12345678 into v2 and v3

14、registers.18const-wide vx, lit64Puts the 64 bit constant into vx and vx+1 registers.1802 874b 6b5d 54dc 2b00- const-wide v2, #long 12345678901234567 / #002bdc545d6b4b87Puts #12345678901234567 into v2 and v3 registers.19const-wide/high16 vx,lit16Puts the 16 bit constant into the highest 16 bit of vx

15、and vx+1 registers. Used to initialize double values.1900 2440 - const-wide/high16 v0, #double 10.0 / #402400000Puts the double constant of 10.0 into v0 register.1Aconst-string vx,string_idPuts reference to a string constant identified by string_id into vx.1A08 0000 - const-string v8, / string0000Pu

16、ts reference to string0000 (entry #0 in the string table) into v8.1Bconst-string-jumbo1Cconst-class vx,type_idMoves the class object of a class identified by type_id (e.g. Object.class) into vx.1C00 0100 - const-class v0, Test3 / type0001Moves reference to Test3.class (entry#1 in the type id table)

17、into1Dmonitor-enter vxObtains the monitor of the object referenced by vx.1D03 - monitor-enter v3Obtains the monitor of the object referenced by v3.1Emonitor-exitReleases the monitor of the object referenced by vx.1E03 - monitor-exit v3Releases the monitor of the object referenced by v3.1Fcheck-cast

18、vx, type_idChecks whether the object reference in vx can be cast to an instance of a class referenced by type_id. Throws ClassCastException if the cast is not possible, continues execution otherwise.1F04 0100 - check-cast v4, Test3 / type0001Checks whether the object reference in v4 can be cast to t

19、ype0001 (entry #1 in the type id table)20instance-of vx,vy,type_idChecks whether vy is instance of a class identified by type_id. Sets vx non-zero if it is, 0 otherwise.2040 0100 - instance-of v0, v4, Test3 / type0001Checks whether the object reference in v4 is an instance of type0001 (entry #1 in t

20、he type id table). Sets v0 to non-zero if v4 is instance of Test3, 0 otherwise.21array-length vx,vyCalculates the number of elements of the array referenced by vy and puts the length value into vx.2111 - array-length v1, v1Calculates the number of elements of the array referenced by v1 and puts the

21、result into v1.22new-instance vx,typeInstantiates an object type and puts the reference of the newly created instance into vx.2200 1500 - new-instance v0, java.io.FileInputStream / type0015Instantiates type0015 (entry #15H in the type table) and puts its reference into v0.23new-array vx,vy,type_idGe

22、nerates a new array of type_id type and vy element size and puts the reference to the array into vx.2312 2500 - new-array v2, v1, char / type0025Generates a new array of type0025 type and v1 size and puts the reference to the new array into v2.24filled-new-array parameters,type_idGenerates a new arr

23、ay of type_id and fills it with the parameters5. Reference to the newly generated array can be obtained by a move-result-object instruction, immediately following the filled-new-array instruction.2420 530D 0000 - filled-new-array v0,v0,I / type0D53Generates a new array of type0D53. The arrays size w

24、ill be 2 and both elements will be filled with the contents of v0 register.25filled-new-array-range vx.vy,type_idGenerates a new array of type_id and fills it with a range of parameters. Reference to the newly generated array can be obtained by a move-result-object instruction, immediately following

25、 the filled-new-array instruction.2503 0600 1300 - filled-new-array/range v19.v21, B / type0006Generates a new array of type0D53. The arrays size will be 3 and the elements will be filled using the v19,v20 and v21 registers4.26fill-array-data vx,array_data_offsetFills the array referenced by vx with

26、 the static data. The location of the static data is the sum of the position of the current instruction and the offset2606 2500 0000 - fill-array-data v6, 00e6 / +0025Fills the array referenced by v0 with the static data at current instruction+25H words location. The offset is expressed as a 32-bit

27、number. The static data is stored in the following format:0003 / Table type: static array data0400 / Byte per array element (in this case, 4 byte integers)0300 0000 / Number of elements in the table0100 0000 / Element #0: integer 10200 0000 / Element #1: integer 20300 0000 / Element #2: integer327th

28、row vxThrows an exception object. The reference of the exception object is in vx.2700 - throw v0Throws an exception. The exception object reference is in v0.28goto targetUnconditional jump by short offset2.28F0 - goto 0005 / -0010Jumps to current position-16 words (hex 10). 0005 is the label of the

29、target instruction.29goto/16 targetUnconditional jump by 16 bit offset2.2900 0FFE - goto/16 002f / -01f1Jumps to the current position-1F1H words. 002F is the label of the target instruction.2Agoto/32 target2Bpacked-switch vx,tableImplements a switch statement where the case constants are close to ea

30、ch other. The instruction uses an index table. vx indexes into this table to find the offset of the instruction for a particular case. If vx falls out of the index table, the execution continues on the next instruction (default case).2B02 0C00 0000 - packed-switch v2, 000c / +000cExecute a packed sw

31、itch according to the switch argument in v2. The position of the index table is at current instruction+0CH words. The table looks like the following:0001 / Table type: packed switch table0300 / number of elements0000 0000 / element base0500 0000 0: 00000005 / case 0: +000000050700 0000 1: 00000007 / case 1: +000000070900 0000 2: 00000009 / case 2: +000000092Csparse-switch vx,tableImplements a switch statement with sparse case

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1