smali文件:向数组添加一个值

时间:2013-09-21 16:32:38

标签: java android arrays smali

我需要在我的Android应用程序中为硬编码字符串数组添加一个值。不幸的是我丢失了我的漏洞代码,因此我将apk转换为smali。有人可以告诉我如何在“1D”和“2A”之间添加条目(我在代码中添加了注释)?

这里是smali代码的数组部分:

const/4 v1, 0x0

const-string v2, "1A"

aput-object v2, v0, v1

const/4 v1, 0x1

const-string v2, "1B"

aput-object v2, v0, v1

const/4 v1, 0x2

const-string v2, "1C"

aput-object v2, v0, v1

const/4 v1, 0x3

const-string v2, "1D"  //add entry "1E" after this

aput-object v2, v0, v1

const/4 v1, 0x4

const-string v2, "2A"

aput-object v2, v0, v1

const/4 v1, 0x5

const-string v2, "2B"

aput-object v2, v0, v1

const/4 v1, 0x6

const-string v2, "2C"

aput-object v2, v0, v1

const/4 v1, 0x7

const-string v2, "2D"

aput-object v2, v0, v1

const/16 v1, 0x8

const-string v2, "3A"

aput-object v2, v0, v1

const/16 v1, 0x9

const-string v2, "3B"

aput-object v2, v0, v1

const/16 v1, 0xa

const-string v2, "3C"

aput-object v2, v0, v1

const/16 v1, 0xb

const-string v2, "3D"

aput-object v2, v0, v1

const/16 v1, 0xc

const-string v2, "4A"

aput-object v2, v0, v1

const/16 v1, 0xd

const-string v2, "4B"

aput-object v2, v0, v1

const/16 v1, 0xe

const-string v2, "4C"

aput-object v2, v0, v1

const/16 v1, 0xf

const-string v2, "4D"

aput-object v2, v0, v1

const/16 v1, 0x10

const-string v2, "5A"

aput-object v2, v0, v1

const/16 v1, 0x11

const-string v2, "5B"

aput-object v2, v0, v1

const/16 v1, 0x12

const-string v2, "5C"

aput-object v2, v0, v1

const/16 v1, 0x13

const-string v2, "5D"

aput-object v2, v0, v1

const/16 v1, 0x14

const-string v2, "6A"

aput-object v2, v0, v1

const/16 v1, 0x15

const-string v2, "6B"

aput-object v2, v0, v1

const/16 v1, 0x16

const-string v2, "6C"

aput-object v2, v0, v1

const/16 v1, 0x17

const-string v2, "6D"

aput-object v2, v0, v1

const/16 v1, 0x18

const-string v2, "7A"

aput-object v2, v0, v1

const/16 v1, 0x19

const-string v2, "7B"

aput-object v2, v0, v1

const/16 v1, 0x1a

const-string v2, "7C"

aput-object v2, v0, v1

const/16 v1, 0x1b

const-string v2, "7D"

aput-object v2, v0, v1

const/16 v1, 0x1c

const-string v2, "8A"

aput-object v2, v0, v1

const/16 v1, 0x1d

const-string v2, "8B"

aput-object v2, v0, v1

const/16 v1, 0x1e

const-string v2, "8C"

aput-object v2, v0, v1

const/16 v1, 0x1f

const-string v2, "8D"

aput-object v2, v0, v1

谢谢你的帮助!

1 个答案:

答案 0 :(得分:1)

抱歉我的英文

我认为你必须换行:

new-array v0, [new_size = your_size + 1], [Ljava/lang/String;.

然后你必须在评论后添加行:

const/4 v1, 0x4

const-string v2, "1E"

aput-object v2, v0, v1

然后增加以下行中的所有值:

const/4 v1, [value].

例如:

const/4 v1, 0x6 -> const/4 v1, 0x7

const/4 v1, 0x7 -> const/4 v1, 0x8