-
-
[原创]配置vim方便读取android反编译的smali文件
-
发表于: 2013-6-22 18:51 11350
-
小弟最近在研读android的smali文件,感觉没有什么好文本工具方便可以查看smali文件
;想着vim很强大,就简单配置下vim,结果发现效果很显示: 结构清淅 方便阅读。哈哈。
下面跟大家分享我的配置过程,小弟在此抛砖引玉,希望有高手在上面增加更多的配置,利于android的smali文件的逆向静态分析。
首先打开vim配置文件
sudo vim /etc/vim/vimrc
然后插入
51 :set hlsearch #高亮搜索
52 set number #显式行号
53 :set showmatch
54 :set foldmethod=expr #定义折叠方式为自定义表达式
55 :set foldexpr=getline(v:lnum)[0]!=\"\\.\"&&getline(v:lnum)[1]!=\"m\"&&getline(v:lnum) [2]!=\"e\"&&getline(v:lnum)[3]!=\"t\" #定义的规则
保存退出即可
可以查看下用vim打开smali文件的结果 有多少方法,变量在那块 构造方法在那一块 非常一目了然
3 +-- 3 行: # instance fields-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6 .field private a:Landroid/graphics/Bitmap;
7
8 .field private b:Landroid/graphics/Bitmap;
9 +-- 3 行: # direct methods------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12 .method public constructor <init>(Landroid/content/Context;)V
13 +-- 7 行: .locals 1-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
20 .end method
21
22 .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
23 +-- 11 行: .locals 1-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
34 .end method
35
36 .method private a(Landroid/graphics/Canvas;)V
37 +--101 行: .locals 11------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
138 .end method
139 +-- 3 行: # virtual methods-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
142 .method public a(Landroid/graphics/Bitmap;I)V
143 +-- 17 行: .locals 2-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
160 .end method
161
162 .method public a(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;)V
163 +-- 7 行: .locals 0-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
170 .end method
171
172 .method public a(Ljava/util/List;)V
173 +-- 11 行: .locals 1-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
184 .end method
185
186 .method public draw(Landroid/graphics/Canvas;)V
187 +-- 7 行: .locals 0-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
194 .end method
使用za打开与关闭折叠哈,相信熟悉vim都不会陌生哈。
我将我的配置文件上传到附件,有些同学直接替换就可以
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!