Part 1 – Reverse engineering using Androguard

本文介绍如何使用Androguard进行安卓应用逆向工程,包括Androguard的下载安装及使用方法,通过实例展示了如何用Androguard反编译apk文件并获取应用的活动列表、权限列表等关键信息。

Welcome to the very first article of this series on “Reverse Engineering android applications”. To read an overview of the series, refer to the serious announcement blog post.

“Learning is no harm, even if done by Reverse Engineering”

As quoted above, learning is no harm, if reverse engineering is done for the learning and analysis purpose. If you want to see how reverse engineering done using basic tools which are famous among android developers, refer to the Part 9: Reverse engineering android application blog post shared by Paresh in lazy android developers series.

In this part, we shall cover how reverse engineering can be done by using Androguard, how to download and setup Androguard and how to decompile an apk using Androguard. We would look into the deep analysis in future parts of this series.

In this Part

Reverse Engineering using Androguard

  • What is Androguard
  • How to download and install Androguard
  • How to decompile an apk using Androguard

I would request you to watch this demo video on what we are going to learn in this article.

What is Androguard?

Androguard is a python based tool, which can run on Linux/Windows/OSX, provided python is installed in the system. Check: http://code.google.com/p/androguard/

It is powerful tool to disassemble and to decompile android apps. It can be used for the Static Analysis of an application. If you are wondering what is static Analysis, refer this Stackoverflow answer Static code analysis . We often use code obfuscators. Using any reverse engineering tool we can measure the obfuscation level and can converts Android xml files to readable format. We will see all these details later in this article.

How to Download and Install Androguard?

Remark: Linux system is used while performing the tutorial. Wherever needed, steps for windows system would be mentioned.

Download it as a Virtual Machine (Advisable for Windows Users)

Remark:“It is advisable for windows users to download this Virtual Machine, because managing all prerequisites for the Androguard, is headache in Windows”.

Directly download the full pack Virtual machine with all modules required to run the tool.

  • A.R.E (Android Reverse Engineering) Virtual Machine is the easiest way to get all the set of tools for Android malware analysis and Reverse Engineering including Androguard. Refer this document on downloading A.R.E virtual machine: https://redmine.honeynet.org/projects/are/wiki
  • You can use Androguard directly from Santoku distribution. Santoku is a Linux Distribution, with complete suit of tools of Mobile Forensics, Mobile Security, Reverse Engineering and Mobile malware analysis. Download and run Santoku as a Virtual machine. Refer this document on downloading Santoku https://santoku-linux.com/download

Note:If you have downloaded any of above virtual machine, then directly skip the download steps for Ubuntu system and go to installation directly.

Downloading in Ubuntu/Debian system

Before we proceed further for the installation, let’s check out the prerequisites in the system.

1
2
sudo easy_install ipython
sudo easy_install pygments

Now download & install Androguard. We can use either of the ways:

  • Using Mercurial version
    • Make sure Mercurial is installed in your system. Follow this docs for installation of mercurial. http://mercurial.selenic.com/wiki/Download
    • Run this command into Terminal or Command line in windows.
      1
      hg clone https: //androguard.googlecode.com/hg/ androguard

      hg clone androguard

  • Using Git
    • Androguard project is available on GitHub, we can use git clone in terminal or command line to install Androguard.
      1
      git clone https: //github.com/androguard/androguard.git

      git clone androguard

Installing the Tool:

If you have downloaded the A.R.E (Android Reverse Engineering) virtual machine, start the virtual machine with username and password provided at A.R.E website and navigate to Androguard folder.
If you have downloaded Androguard in live system using hg or git, navigate to the Androguard folder or just copy it to any handy location and navigate to it.

Simply fire the setup.py in with install command.

sudo python installing androguard

Note: Make Sure you have followed all steps required for installation, as actual work begins from here!

Let’s Run Androguard – Decompiling the app

Androguard supports 3 decompilers.

  • DAD
  • dex2jar + jad
  • DED

To know about each of them in detail follow this document on Decompilers. In this part, we will cover how to use the DAD Decompiler in Androguard.

Step 1: Run this command in terminal

1
./androlyze.py -s

androlyze androguard

Step 2: This command will start own input prompt, waiting for input.
androlyze - 2 - androguard
Now let’s define the path of apk and type of decompiler we want to use to decompile the app.

Input this command into the prompt and replace path_to_apk with path of the apk we want to analyse.

1
a,d,dx = AnalyzeAPK( "path_to_apk" , decompiler= "dad" )

androlyze androguard - analyze apk

Remark:In this example we have used anonymous app “demo.apk”.

Depending on the apk, it might take some time to execute and after successful execution of command, it will prompt for APK or DVM specific commands.

androlyze androguard - analyze apk 2

Let’s examine list of all Activities in the app. Enter this command in input prompt, it will display all activities in app as output.

1
a.get_activities()

androguard get_activities()

To get list of all permissions as output, input this command:

1
a.get_permissions()

androguard get_permissions

To get list of all class names as output, input this command:

1
d.get_classes_names()

To get list of all strings defined in app as output, input this command:

1
d.get_strings()

To get list of all methods in a class as output, input this command:

1
d.get_methods()

Refer to this document for all such APK (a.get) and DVM (d.get) specifics commands.

In Summary

This bring us to the end of this part. In this part, we talked about Androguard, how to download and install it and we have also talked about decompiling an apk using Androguard. We shall talk about doing deep analysis using Androguard and other tools in the next part.

原文地址: http://www.technotalkative.com/part-1-reverse-engineering-using-androguard/

【四轴飞行器】非线性三自由度四轴飞行器模拟器研究(Matlab代码实现)内容概要:本文围绕非线性三自由度四轴飞行器模拟器的研究展开,重点介绍基于Matlab代码实现的四轴飞行器动力学建模与仿真方法。研究构建了考虑非线性特性的飞行器数学模型,涵盖姿态动力学与运动学方程,实现了三自由度(滚转、俯仰、偏航)的精确模拟。文中详细阐述了系统建模过程、控制算法设计思路及仿真结果分析,帮助读者深入理解四轴飞行器的飞行动力学特性与控制机制;同时,该模拟器可用于算法验证、控制器设计与教学实验。; 适合人群:具备一定自动控制理论基础和Matlab编程能力的高校学生、科研人员及无人机相关领域的工程技术人员,尤其适合从事飞行器建模、控制算法开发的研究生和初级研究人员。; 使用场景及目标:①用于四轴飞行器非线性动力学特性的学习与仿真验证;②作为控制器(如PID、LQR、MPC等)设计与测试的仿真平台;③支持无人机控制系统教学与科研项目开发,提升对姿态控制与系统仿真的理解。; 阅读建议:建议读者结合Matlab代码逐模块分析,重点关注动力学方程的推导与实现方式,动手运行并调试仿真程序,以加深对飞行器姿态控制过程的理解。同时可扩展为六自由度模型或加入外部干扰以增强仿真真实性。
基于分布式模型预测控制DMPC的多智能体点对点过渡轨迹生成研究(Matlab代码实现)内容概要:本文围绕“基于分布式模型预测控制(DMPC)的多智能体点对点过渡轨迹生成研究”展开,重点介绍如何利用DMPC方法实现多智能体系统在复杂环境下的协同轨迹规划与控制。文中结合Matlab代码实现,详细阐述了DMPC的基本原理、数学建模过程以及在多智能体系统中的具体应用,涵盖点对点转移、避障处理、状态约束与通信拓扑等关键技术环节。研究强调算法的分布式特性,提升系统的可扩展性与鲁棒性,适用于多无人机、无人车编队等场景。同时,文档列举了大量相关科研方向与代码资源,展示了DMPC在路径规划、协同控制、电力系统、信号处理等多领域的广泛应用。; 适合人群:具备一定自动化、控制理论或机器人学基础的研究生、科研人员及从事智能系统开发的工程技术人员;熟悉Matlab/Simulink仿真环境,对多智能体协同控制、优化算法有一定兴趣或研究需求的人员。; 使用场景及目标:①用于多智能体系统的轨迹生成与协同控制研究,如无人机集群、无人驾驶车队等;②作为DMPC算法学习与仿真实践的参考资料,帮助理解分布式优化与模型预测控制的结合机制;③支撑科研论文复现、毕业设计或项目开发中的算法验证与性能对比。; 阅读建议:建议读者结合提供的Matlab代码进行实践操作,重点关注DMPC的优化建模、约束处理与信息交互机制;按文档结构逐步学习,同时参考文中提及的路径规划、协同控制等相关案例,加深对分布式控制系统的整体理解。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值