如何从Android so中提取URL

  由于工作需要,研究了一下如何从Android so中提取URL。Android so实际上是一个ELF(Executable and Linking Format)格式的文件,要从中提取URL就需要首先了解ELF文件格式。URL实际上就是一个字符串,要从Android so中提取URL,实际上我们只需知道ELF文件的字符串存储在哪个区段就可以了。以下为ELF文件区块表的介绍:

.textwhere code stands, as said above. objdump -drS .process.o will show you that
.datawhere global tables, variables, etc. stand. objdump -s -j .data .process.o will hexdump it.
.bssdon't look for bits of .bss in your file: there's none. That's where your uninitialized arrays and variable are, and the loader 'knows' they should be filled with zeroes ... there's no point storing more zeroes on your disk than there already are, is it ?
.rodatathat's where your strings go, usually the things you forgot when linking and that cause your kernel not to work. objdump -s -j .rodata .process.o will hexdump it. Note that depending on the compiler, you may have more sections like this.
.comment & .notejust comments put there by the compiler/linker toolchain
.stab & .stabstrdebugging symbols & similar information.

  注:要想了解详细的ELF文件格式见http://wiki.osdev.org/ELF。此文只介绍与主题相关的知识。

从表中的粗体字可以知道.rodata区段便是ELF文件字符串的存储位置,使用objdump -s -j .rodata filename命令可以获取所有字符串信息,然后就可以提取URL了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值