Android基础逆向如何实现
这篇文章主要介绍“Android基础逆向如何实现”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Android基础逆向如何实现”文章能帮助大家解决问题。
创新互联自2013年创立以来,先为庐江等服务建站,庐江等地企业,进行企业商务咨询服务。为庐江企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。
第一步:试玩。
自己玩
第二步:反编译,搜索关键字。
1.搜索“成功”
这里搜索到了三条数据
点进去之后是这样一个方法:
.method public static d()V .locals 4 const/4 v3, 0x1 const/4 v2, 0x0 sget v0, Lcom/xy/kom/d/bk;->i:I invoke-static {v0}, Lcom/xy/kom/g/p;->b(I)Z sget v0, Lcom/xy/kom/d/bk;->h:I invoke-static {v0}, Lcom/xy/kom/g/p;->c(I)Z sget-boolean v0, Lcom/xy/kom/d/bk;->G:Z if-eqz v0, :cond_4 sget-object v0, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; iget-object v0, v0, Lcom/xy/kom/GameActivity;->m:Lcom/xy/kom/g/p; invoke-virtual {v0}, Lcom/xy/kom/g/p;->x()Ljava/util/ArrayList; move-result-object v0 invoke-static {}, Lcom/xy/kom/g/f;->l()Lcom/xy/kom/g/f; move-result-object v1 invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z :goto_0 sget-object v0, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; iget-object v0, v0, Lcom/xy/kom/GameActivity;->m:Lcom/xy/kom/g/p; invoke-virtual {v0}, Lcom/xy/kom/g/p;->t()V sget-object v0, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; iget-object v0, v0, Lcom/xy/kom/GameActivity;->r:Lcom/xy/kom/d/ei; if-eqz v0, :cond_0 sget-object v0, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; iget-object v0, v0, Lcom/xy/kom/GameActivity;->r:Lcom/xy/kom/d/ei; invoke-virtual {v0, v2}, Lcom/xy/kom/d/ei;->a(I)V :cond_0 sget-object v0, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; const/4 v1, 0x6 invoke-virtual {v0, v1}, Lcom/xy/kom/GameActivity;->a(I)V invoke-static {}, Lcom/xy/kom/d/bk;->h()V sget-object v0, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; const-string v1, "\u8d2d\u4e70\u6210\u529f\uff01\u9053\u5177\u5df2\u53d1\u653e" invoke-static {v0, v1, v2}, 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 sget-object v0, Lcom/xy/kom/GameActivity;->N:Lcom/xy/kom/e/a; invoke-virtual {v0, v3}, Lcom/xy/kom/e/a;->a(I)V sput-boolean v3, Lcom/xy/kom/GameActivity;->M:Z invoke-static {}, Lcom/xy/kom/a/h;->f()I move-result v0 const/16 v1, 0xd if-ne v0, v1, :cond_2 sget v0, Lcom/xy/kom/GameActivity;->h:I const/4 v1, 0x2 if-ne v0, v1, :cond_2 sget-object v0, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; iget-object v0, v0, Lcom/xy/kom/GameActivity;->m:Lcom/xy/kom/g/p; invoke-virtual {v0}, Lcom/xy/kom/g/p;->w()Ljava/util/ArrayList; move-result-object v0 invoke-interface {v0}, Ljava/util/List;->size()I move-result v1 sget-object v2, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; iget-object v2, v2, Lcom/xy/kom/GameActivity;->m:Lcom/xy/kom/g/p; invoke-virtual {v2}, Lcom/xy/kom/g/p;->l()I move-result v2 if-ne v1, v2, :cond_1 sget-object v1, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; iget-object v1, v1, Lcom/xy/kom/GameActivity;->r:Lcom/xy/kom/d/ei; invoke-interface {v0}, Ljava/util/List;->size()I move-result v2 add-int/lit8 v2, v2, -0x1 invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object v0 check-cast v0, Lcom/xy/kom/g/f; invoke-virtual {v1, v0}, Lcom/xy/kom/d/ei;->b(Lcom/xy/kom/g/f;)V :cond_1 sget-object v0, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; iget-object v0, v0, Lcom/xy/kom/GameActivity;->r:Lcom/xy/kom/d/ei; sget-object v1, Lcom/xy/kom/d/bk;->d:Lcom/xy/kom/g/f; invoke-virtual {v0, v1}, Lcom/xy/kom/d/ei;->a(Lcom/xy/kom/g/f;)V invoke-static {}, Lcom/xy/kom/d/bk;->m()V :cond_2 sget-boolean v0, Lcom/xy/kom/d/bk;->G:Z if-nez v0, :cond_3 const/4 v0, 0x0 sput-object v0, Lcom/xy/kom/d/bk;->d:Lcom/xy/kom/g/f; :cond_3 return-void :cond_4 sget-object v0, Lcom/xy/kom/GameActivity;->A:Lcom/xy/kom/GameActivity; iget-object v0, v0, Lcom/xy/kom/GameActivity;->m:Lcom/xy/kom/g/p; invoke-virtual {v0}, Lcom/xy/kom/g/p;->x()Ljava/util/ArrayList; move-result-object v0 sget-object v1, Lcom/xy/kom/d/bk;->d:Lcom/xy/kom/g/f; invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z goto/16 :goto_0.end method
这里找到一个调用成功的方法。我们继续溯源查看。
发现是一个onResult方法。
解决方法:
(1)覆盖switch失败转为成功。
(2)更改switch跳转
(3)最后一种我最喜欢作用,思路最明确,使用goto进行跳转。跳转到成功即可。
恩,改完之后汇编,整个游戏就破解好了。
没什么好说的。
测试成果。
是成功的,懒的玩。不想发图,自己测试吧,有疑问可以找我。
实例分析(2)
之前没有找好,现在去找找。
找练习的APK的时候主要注意三点。
(1)最好是单机
(2)选择大小的时候选小一点的,恩,反编译快。我们的目的是为了练习。
(3)无壳,现阶段可定脱不了壳。
找到了一个什么酷跑什么的游戏。
三步走
第一步 试玩
原版apk:练习传送门在这里找,编号:2002
拿到游戏,首先就要玩一下是不,人家怎么购买的你总要知道吧。说不定会有新的发现。
反编译破解
搜索关键字“成功失败”
点开之后进去,发现,原来还是一个onResult。
.method public onResult(ILjava/lang/String;Ljava/lang/Object;)V .locals 3 .param p1, "paramAnonymousInt" # I .param p2, "paramAnonymousString" # Ljava/lang/String; .param p3, "paramAnonymousObject" # Ljava/lang/Object; .prologue goto :pswitch_0 .line 26 packed-switch p1, :pswitch_data_0 .line 37 const-string v0, "Unity" new-instance v1, Ljava/lang/StringBuilder; const-string v2, "\u8d2d\u4e70\u9053\u5177\uff1a[" invoke-direct {v1, v2}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 const-string v2, "]\u53d6\u6d88\uff01" invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I .line 38 invoke-static {}, Lcom/huibang/paopao/MainActivity;->access$0()Ljava/lang/String; move-result-object v0 invoke-static {}, Lcom/huibang/paopao/MainActivity;->access$1()Ljava/lang/String; move-result-object v1 const-string v2, "cancel" invoke-static {v0, v1, v2}, Lcom/unity3d/player/UnityPlayer;->UnitySendMessage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V .line 41 :goto_0 return-void .line 29 :pswitch_0 const-string v0, "Unity" new-instance v1, Ljava/lang/StringBuilder; const-string v2, "\u8d2d\u4e70\u9053\u5177\uff1a[" invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-> (Ljava/lang/String;)V invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 const-string v2, "] \u6210\u529f\uff01" invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I .line 30 invoke-static {}, Lcom/huibang/paopao/MainActivity;->access$0()Ljava/lang/String; move-result-object v0 invoke-static {}, Lcom/huibang/paopao/MainActivity;->access$1()Ljava/lang/String; move-result-object v1 const-string v2, "success" invoke-static {v0, v1, v2}, Lcom/unity3d/player/UnityPlayer;->UnitySendMessage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V goto :goto_0 .line 33 :pswitch_1 const-string v0, "Unity" new-instance v1, Ljava/lang/StringBuilder; const-string v2, "\u8d2d\u4e70\u9053\u5177\uff1a[" invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-> (Ljava/lang/String;)V invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 const-string v2, "] \u5931\u8d25\uff01" invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I .line 34 invoke-static {}, Lcom/huibang/paopao/MainActivity;->access$0()Ljava/lang/String; move-result-object v0 invoke-static {}, Lcom/huibang/paopao/MainActivity;->access$1()Ljava/lang/String; move-result-object v1 const-string v2, "fail" invoke-static {v0, v1, v2}, Lcom/unity3d/player/UnityPlayer;->UnitySendMessage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V goto :goto_0 .line 26 nop :pswitch_data_0 .packed-switch 0x1 :pswitch_0 :pswitch_1 .end packed-switch.end method
关于“Android基础逆向如何实现”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注创新互联行业资讯频道,小编每天都会为大家更新不同的知识点。
分享文章:Android基础逆向如何实现
文章路径:http://ybzwz.com/article/jopppo.html