美文网首页
smali逆向修改从超长的local缩短所遇到的问题

smali逆向修改从超长的local缩短所遇到的问题

作者: 吉凶以情迁 | 来源:发表于2021-08-26 23:02 被阅读0次

    .https://note.youdao.com/s/3Dz7Ahjv

    end method
    .method protected onCreate(Landroid/os/Bundle;)V
     # .registers 22    
    .registers 5
    
       # invoke-super/range {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
      invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
       
     invoke-static {p0}, Lcom/qiyi/video/StartActivity;->a(Landroid/content/Context;)V
    
    
     # invoke-virtual/range {p0,p0}, Lcom/qiyi/video/StartActivity;->showbaiduad()V
      invoke-virtual {p0,v0}, Lcom/qiyi/video/StartActivity;->showbaiduad()V
    

    之前注册22个 ,那么 我不知道 调用静态了,那么怎么办呢,直接全部改成5个就好了,反正垃圾代码全部删除了。红色的代表被修改的,

    插入toast的方法

    .end method
    .method public static a(Landroid/content/Context;)V
        .locals 2
    
        .prologue
        .line 138
        const-string v0, "\u60c5\u8fc1\u7834\u89e3\u4e8c\u6b21\u5783\u573e\u6821\u9a8c..qq694886526\u5185\u7f6e\u62a2\u7ea2\u5305\u63d2\u4ef6\u62a2\u7ea2\u5305\u7b49\u4f60\u4e0b\u8f7d\uff01"
    
        const/4 v1, 0x0
    
        invoke-static {p0, v0, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
    
        move-result-object v0
    
        invoke-virtual {v0}, Landroid/widget/Toast;->show()V
    
        .line 139
        return-void
    .end method
    .method protected onCreate(Landroid/os/Bundle;)V
        .registers 5
     # .registers 22
       # invoke-super/range {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
           invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
        invoke-static {p0}, Lcom/qiyi/video/StartActivity;->a(Landroid/content/Context;)V
    # 由于就在这个文件toast所以这里改成这个当前所在的静态类就好了
     invoke-virtual {p0,v0}, Lcom/qiyi/video/StartActivity;->showbaiduad()V
    

    上面打错了

    p0,v0是错误的因为没有参数 v0要删除了

    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
      
     
     invoke-virtual {p0}, Lcom/qiyi/video/StartActivity;->showbaiduad()V
       invoke-static {p0}, Lcom/qiyi/video/StartActivity;->a(Landroid/content/Context;)V
    

    虽然能通过smali签名但是无法跑起来

    修改闪退又看不到错误怎么办
    输入你修改的类的名称查看log
    31660-31664/? W/dex2oat: void com.qiyi.video.StartActivity.onCreate(android.os.Bundle) failed to verify: void com.qiyi.video.StartActivity.onCreate(android.os.Bundle): [0x3] Rejecting invocation, expected 2 arguments, found 1
    04-11 23:14:39.032 2408-2514/? I/HwLauncher: Launcher.IconC

    搞不懂放弃了

    .end method
    .method protected onCreate(Landroid/os/Bundle;)V
        .registers 22
    
        invoke-static/range {p0 .. p1}, Lcom/qiyi/video/StartActivity;->a(Landroid/content/Context;)V
        invoke-super/range {p0 .. p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
          invoke-virtual/range {p0 .. p0}, Lcom/qiyi/video/StartActivity;->showbaiduad()V
    

    这里马上结束的显然不能放在这里

    相关文章

      网友评论

          本文标题:smali逆向修改从超长的local缩短所遇到的问题

          本文链接:https://www.haomeiwen.com/subject/xbyjiltx.html