linux下的二进制工具(反编译工具)

inux下的二进制工具(反编译工具)

The  GNU Binutils are a collection of binary tools. The main ones are:

  • ld - the GNU linker.
  • as - the GNU assembler.

But they also include:

  • addr2line - Converts addresses into filenames and line numbers.
  • ar - A utility for creating, modifying and extracting from archives.
  • c++filt - Filter to demangle encoded C++ symbols.
  • dlltool - Creates files for building and using DLLs.
  • gold - A new, faster, ELF only linker, still in beta test.
  • gprof - Displays profiling information.
  • nlmconv - Converts object code into an NLM.
  • nm - Lists symbols from object files.
  • objcopy - Copys and translates object files.
  • objdump - Displays information from object files.
  • ranlib - Generates an index to the contents of an archive.
  • readelf - Displays information from any ELF format object file.
  • size - Lists the section sizes of an object or archive file.
  • strings - Lists printable strings from files.
  • strip - Discards symbols.
  • windmc - A Windows compatible message compiler.
  • windres - A compiler for Windows resource files.

Most of these programs use  BFD, the Binary File Descriptor library, to do low-level manipulation. Many of them also use the  opcodes library to assemble and disassemble machine instructions.

The binutils have been ported to most major Unix variants as well as Wintel systems, and their main reason for existence is to give the  GNU system (and  GNU/Linux) the facility to compile and link programs.

The detail introduction and use guide is  documentation for binutils 2.21.

在Linux下,可执行文件即是目标文件,一般情况下可通过以下三个命令查看反汇编信息:

nm命令列出目标文件的所有符号,如:
$nm a.out | more

objdump命令列出目标文件的详细汇编信息
$objdump -S a.out | more

readelf 是列出文件的ELF格式的内容
$readelf --debug-dump a.out | more

关于这三个命令的详细参数,以及其他命令的使用可以参看上面的文档binutils 2.21。反汇编文件这里没有列出,主要是个人觉得分析起来有点难。反汇编的信息对于了解程序的架构很有帮助,但是很难得到具体的程序信息,我本想查看程序返回值,看了半天没有结论。。。
1 . 把apk拷到apktool根目录下,执行:./apktool d xxx.apk,会生成xxx目录,里面有res目录(各种资源文件),smali目录(类似src目录,里面文件的语法不一样)及AndroidManifest.xml。 [*.apk->*.jar: sh ./dex2jar/dex2jar.sh xxx.apk,生成xxx_dex2jar.jar通过jd-linux看源码] 2 . 什么apk汉化啊,就到res/values里string.xml里修改字符串,或者拷贝一份values目录改为values-zh-rCN,再去里面修改string.xml里英文字符串改为中文,所谓的汉化就是这么简单。另外,有些图片里不是中文的得去改图片,那得用Photoshop了,图片也不能乱改,格式,图片大小(尺寸)得原来的。 3 . 修改smali文件,这个有些难度。比如有些apk安装了后要积分什么的,比如大于100才可以用的,其实这个值是用SharedPreference存放的,也就是存在xml里,,位置:/data/data/[包名]/shared_prefs的某个xml里,文件不多肯定是可以找到的。另外一种方法就是修改.smali文件也可以达到这目的,软件实现肯定是读取积分那个值给它修改一下就可以了,例如 const/16 v0 100 (其实就是 v0 = 100)这个语法有点像汇编,觉得还是比汇编简单,v0 v1 ...是寄存器,之前会跟变量关联的。具体的还是自己看看smali语法。 4 . 打包生成apk,执行:./apktool b xxx,会在xxx里面生成,一个dist目录,里面就是xxx.apk,但不能安装滴,提示(Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]),没有给这个apk签名, 5 . 签名,执行:sh ./dex2jar/d2j-apk-sign.sh ./xxx/dist/xxx.apk 就是给刚才那个apk签名,生成的文件还是xxx.apk在apktool根目录下。这样就大功告成啦。 [请看:http://blog.youkuaiyun.com/zhouyuanjing/article/details/7446988]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值