安卓逆向之smali代码插桩打印日志操作步骤
1.将以下代码复制并保存到你本地并命名为"log.smali",文件名可任意,后缀名必须为“smali”。.class public Lcrack;
.super Ljava/lang/Object;
.source "crack.java"
.method public static log1(Ljava/lang/String;)V #打印出info 1字符串
.locals 1
.prologue
const-string v0, "TAG"
invoke-static {v0, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
return-void
.end method
.method public static log2(Ljava/lang/String;)V #打印出info 2字符串
.locals 1
.prologue
const-string v0, "info 2"
invoke-static {v0, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
return-void
.end method
.method public static log3(Ljava/lang/String;)V #打印出info 3字符串
.locals 1
.prologue
const-string v0, "info 3"
invoke-static {v0, p0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
return-void
.end method
.method public static I(I)V #打印出int型值
.locals 2
.prologue
const-string v0, "info_int"
invoke-static {p0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
return-void
.end method
.method public static J(J)V #打印出long类型的值
.locals 2
.prologue
const-string v0, "info_long"
invoke-static {p0, p1}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
#黑骑士技术QQ1994091497,培训火热扩招中
return-void
.end method2.将“log.smali”加入到工程的“smali”文件的根目录下。
3.在你要打印变量的地方加上如下红框内语句,注:“V1”是你要打印的寄存器。
invoke-static {v1}, Lcrack;->log1(Ljava/lang/String;)V#V1是你想打印得值,需要替换你想打印得寄存器
楼主发贴辛苦了,谢谢楼主分享!我觉得易语言吧是注册对了!
感谢楼主的无私分享!要想易语言吧好 就靠你我他
我看不错噢 谢谢楼主!易语言吧越来越好! 楼主发贴辛苦了,谢谢楼主分享!我觉得易语言吧是注册对了!
楼主,大恩不言谢了!易语言吧是最棒的! 感谢楼主的无私分享!
页:
[1]