Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Android Security Cookbook

You're reading from   Android Security Cookbook Practical recipes to delve into Android's security mechanisms by troubleshooting common vulnerabilities in applications and Android OS versions

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781782167167
Length 350 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. Android Development Tools FREE CHAPTER 2. Engaging with Application Security 3. Android Security Assessment Tools 4. Exploiting Applications 5. Protecting Applications 6. Reverse Engineering Applications 7. Secure Networking 8. Native Exploitation and Analysis 9. Encryption and Developing Device Administration Policies Index

Cross-compiling native executables


Before we can start smashing stacks and hijacking instruction pointers on Android devices, we need a way to prepare some sample vulnerable applications. To do this, we need to be able to compile native executables and to do that we need to use some of the awesome applications packaged into the Android native development kit.

How to do it...

To cross-compile your own native Android components, you need to do the following:

  1. Prepare a directory to develop your code. All this requires is that you make a directory named whatever you'd like to name your "module"; for example, you could call the directory buffer-overflow, as I do in the example here. Once you've created that directory, you then need to make a subdirectory called jni/. It's imperative that you name it this because the compilation scripts in the NDK will specifically look for this directory.

  2. Once you have your directories, you can create an Android.mk file. Create this file inside your jni directory...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image