首页
社区
课程
招聘
[求助]smali问题//各位大神来看看
发表于: 2013-9-13 18:23 7424

[求助]smali问题//各位大神来看看

2013-9-13 18:23
7424

修改一个类构造函数,发现dalvikvm总报错,优化不过去

.method private constructor <init>()V
    .locals 3

    .prologue
    const/4 v2, 0x4

    const/4 v1, 0x0

    .line 3130
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 116
    new-instance v0, Landroid/util/TypedValue;

    invoke-direct {v0}, Landroid/util/TypedValue;-><init>()V

    iput-object v0, p0, Landroid/content/res/Resources;->mTmpValue:Landroid/util/TypedValue;

    .line 117
    new-instance v0, Landroid/content/res/Configuration;

    invoke-direct {v0}, Landroid/content/res/Configuration;-><init>()V

    iput-object v0, p0, Landroid/content/res/Resources;->mTmpConfig:Landroid/content/res/Configuration;

    .line 120
    new-instance v0, Landroid/util/LongSparseArray;

    invoke-direct {v0}, Landroid/util/LongSparseArray;-><init>()V

    iput-object v0, p0, Landroid/content/res/Resources;->mDrawableCache:Landroid/util/LongSparseArray;

    .line 122
    new-instance v0, Landroid/util/LongSparseArray;

    invoke-direct {v0}, Landroid/util/LongSparseArray;-><init>()V

    iput-object v0, p0, Landroid/content/res/Resources;->mColorStateListCache:Landroid/util/LongSparseArray;

    .line 124
    new-instance v0, Landroid/util/LongSparseArray;

    invoke-direct {v0}, Landroid/util/LongSparseArray;-><init>()V

    iput-object v0, p0, Landroid/content/res/Resources;->mColorDrawableCache:Landroid/util/LongSparseArray;

    .line 128
    iput-object v1, p0, Landroid/content/res/Resources;->mCachedStyledAttributes:Landroid/content/res/TypedArray;

    .line 129
    iput-object v1, p0, Landroid/content/res/Resources;->mLastRetrievedAttrs:Ljava/lang/RuntimeException;

    .line 131
    const/4 v0, -0x1

    iput v0, p0, Landroid/content/res/Resources;->mLastCachedXmlBlockIndex:I

    .line 132
    new-array v0, v2, [I

    fill-array-data v0, :array_92

    iput-object v0, p0, Landroid/content/res/Resources;->mCachedXmlBlockIds:[I

.........

    .line 3140
    return-void

    :cond_8b
    move-object v0, v1

    .line 160
    goto :goto_56

    :cond_8d
    move-object v0, v1

    .line 172
    goto :goto_61

    :cond_8f
    move-object v0, v1

    .line 198
    goto :goto_6c

    .line 132
    nop
    nop
    nop
    nop


    :array_92
    .array-data 4
        0x0
        0x0
        0x0
        0x0
    .end array-data

.end method

修改这个类的构造函数, 发现总是在fill-array-data 指令提示失败
求助虫虫版主,在前边加过一个nop,两个、三个、四个都试过了还是爆unaligned错误。

01-04 07:49:52.261: W/dalvikvm(17909): VFY: unaligned array data table: at 49, data offset 108
01-04 07:49:52.261: W/dalvikvm(17909): VFY:  rejecting opcode 0x26 at 0x0031
01-04 07:49:52.261: W/dalvikvm(17909): VFY:  rejected Landroid/content/res/Resources;.<init> ()V
01-04 07:49:52.261: W/dalvikvm(17909): Verifier rejected class Landroid/content/res/Resources;
01-04 07:49:52.261: W/dalvikvm(17909): threadid=5: thread exiting with uncaught exception (group=0x4160eac8)

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 53
活跃值: (280)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
2
没人遇到过?
2013-9-16 09:32
0
雪    币: 18
活跃值: (117)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
3
v2下面有没有  locals 3表示只用了3个寄存器   加个v2  要改为4
2013-9-16 10:28
0
雪    币: 18
活跃值: (117)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
4
好吧  刚才是手机看的  只有前两排 。
2013-9-16 12:54
0
雪    币: 53
活跃值: (280)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
5
试了新版的smali2.0b6,加一个nop 问题解决
老版本的smali问题多多啊
2013-9-16 13:04
0
游客
登录 | 注册 方可回帖
返回
//