Quantcast
Channel: 看雪安全论坛
Viewing all articles
Browse latest Browse all 9556

【原创】windows下编译安装androguard

$
0
0
昨天下午,在windows下编译安装了androguard,现在整理一下步骤。
刚使用androguard,不知道各个功能是否都正常。
如发现问题,欢迎补充。

下载各种包时,建议翻墙,原因你懂的。

1. 安装python
   http://www.python.org/getit/
   个人推荐 2.7 版本
   
2. 安装python库
   先安装setuptools
   https://pypi.python.org/pypi/setuptools#files
   
   然后是ipython, pygments pydot, python-ptrace, chilkat, magic, pyfuzzy, mercury
   其中 ipython 和 pygments 可以从 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载,
   其他的可以从 https://code.google.com/p/androguard/wiki/Installation 给出的链接,到各自的主页上下载。
   基本上如果有exe文件,就直接双击执行;有setup.py,就执行"setup.py install"
   注意下载相应版本的包,不要下载错了。
  
3. 重头戏——编译
   我用的编译环境是msysgit
   https://code.google.com/p/msysgit/downloads/list
   下载安装msysGit-fullinstall包。
   netinstall前段时间有问题,不知道现在解决了没有。
   
   启动安装目录下的 msys.bat, 就是一个类linux的环境。
   
   编辑profile:
   vi ~/.bash_profile
   内容:
代码:

export C_INCLUDE_PATH=/local/include:/C/Python27/include
export CPLUS_INCLUDE_PATH=/local/include:/C/Python27/include
export LD_LIBRARY_PATH=/local/lib:/C/Python27/libs
export LIBRARY_PATH=/local/lib
export INCLUDE_PATH=/local/include
export BINARY_PATH=/local/bin

alias ls='ls -F --color --show-control-chars'
alias ll='ls -l'

   
   重启msys或执行 source ~/.bash_profile
   
   接下来编译依赖库: bzip2, zlib, xz, muparser, sparsehash, snappy
   还是从 https://code.google.com/p/androguard/wiki/Installation 给出的链接,到各自的主页上下载。
   
   下面的安装流程,默认都是在解包的目录下执行。
   安装 bzip2
   编辑Makefile,从82行开始的4行注释掉:
代码:

  #chmod a+x $(PREFIX)/bin/bzip2
  #chmod a+x $(PREFIX)/bin/bunzip2
  #chmod a+x $(PREFIX)/bin/bzcat
  #chmod a+x $(PREFIX)/bin/bzip2recover

   执行
代码:

   make
   make install

   安装zlib
代码:

   make -f win32/Makefile.gcc
   make -f win32/Makefile.gcc install

   安装xz
代码:

   ./configure
   make
   make install

   安装muparser
代码:

   cd build
   mingw32-make -f makefile.mingw
   cd ..

   没有install,只好手工copy
代码:

   cp include/* /local/include
   cp lib/* /local/lib

   安装sparsehash
代码:

   ./configure
   make

   最后编译hashtable_test 会很长时间,怀疑死循环,ctrl-c强制终止。
   直接copy(不make的话,include目录下会缺文件)
代码:

   cp -r src/google /local/include/google
   cp -r src/sparsehash /local/include/sparsehash

   安装snappy
代码:

   ./configure
   make
   make install

   注意:make 和 make install 最后都会死循环,需要ctrl-c强制终止。
   
   回到androguard的根目录
   编辑 elsim/elsim/similarity/libsimilarity/Makefile
   第8行加:
代码:

   LDFLAGS += -lstdc++
   编辑 elsim/elsim/elsign/libelsign/Makefile
   第14行加:
代码:

   LDFLAGS += -lpython27 -L/local/lib -L/C/Python27/libs
   编辑 elsim/elsim/similarity/libsimilarity/similarity.c
   开头加一行:
代码:

   typedef unsigned char u_int8_t;
   第333行,改成
代码:

   #if defined linux || defined __APPLE__ || defined __MINGW32__
   执行
代码:

   make
   
   完成。

Viewing all articles
Browse latest Browse all 9556

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>