Android reinforcement-2. Learn to crack the app before reinforcement and debug the program for modifying the memory value,

Source: Internet
Author: User

Android reinforcement-2. Learn to crack the app before reinforcement and debug the program for modifying the memory value,

[All Rights Reserved. For more information, see the source .]

Because the company's project requires app reinforcement, after several months of research, I have achieved a complete set of third-party reinforcement solutions such as love encryption (third-party reinforcement is expensive, A complete set of financial app solutions 10 ~ 0.2 million/year ), from encrypting the original project's java source code dex file to decrypting the jni layer in the new project and replacing the current process with the anti-debugging of jni and linux shelling a series of complete solutions and code implementation. Here we will prepare a set of tutorials for your reference and to learn from each other and point out the shortcomings.

Because the pure java cracking is too simple, my reinforcement solution is based on the jni technology. java cracking will not be introduced. apktool can decompile its source code. However, if jni is used for encryption and reinforcement, it does not mean that it is safe. The most secure solution is to build on the premise that the server does not trust any client requests, the policy is secure as long as the interface access is legal. Well, there's no more to talk about. reinforcement only improves the security grade.

If you want to reinforce your app, you must first learn how to crack it to see if the reinforcement is successful. Here we will first introduce IDA dynamic debugging, the most common and powerful cracking technique:

Key code of the Project jni (for the Project address, see the bottom of the article) to obtain the package name com. example. shelldemo and com. example. compared with nocrack, the normal running result is this app is illegal. I will not introduce the compilation of jni, and the project also includes the compiled so

 

1. Tool Introduction

IDA6.5: all IDA versions used by the user can be dynamically debugged on the real machine only. The mobile phone system version is 4.4 or earlier and must be root

 

2. Preparations

A. Transmit android_server

First, find the android_server under the dbgsrv directory under the IDA directory and push it to the mobile phone using adb. The command is as follows:

Adb push android_server/data/local/tmp/

Use root explorer on your mobile phone and grant root permission to check whether android_server exists in/data/local/tmp of your mobile phone. This file is used to connect your mobile phone to the IDA debugger.

B. Start android_server

Run the following commands respectively:

Adb shell

Su

Chmod 777/data/local/tmp/android_server

/Data/local/tmp/android_server

 

C. Redirect the debugging port

Start another command window and execute the following command:

Adb forward tcp: 23946 tcp: 23946

23946 corresponds to the port set on IDA

 

 

3. Configure IDA

First, run the project program on the mobile phone, and then:

 

 

Select the corresponding project package name

 

Then

 

Click "OK" or "close" in the next dialog box.

 

 

4. Select the corresponding so and the function to be debugged

 

Find the so file of the project

 

Double-click to find the corresponding function name

 

Double-click to enter

 

Drag down, drag it to the key code, press F2 to set the breakpoint, and press F9 to wait for the next operation.

Click the button on the phone "check whether crack" to enter the breakpoint, and can be executed in a single step, F8-step over, F7-step into, when a single step runs to this line

The key register is R0. Observe the following line of BEQ loc_75D09ED0, which means that if the R0 of the above CMP comparison command is equal to 0, it will jump to loc_75D09ED0, that is, the code of running successfully, which indicates cracking.

The value of R0 is now 0:

Input 0

After OK, F9 will check that your mobile phone shows running successfully.

Note: Chinese chess also uses similar judgment techniques in jni. If you are interested, you can crack the game.

 

[Project address]

IDA tool address]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.