Reverse engineering for beginners. Protect Android applications from reverse engineering

Sometimes someone wants to see, but what is the filling in a particular program? Then he has to use reverse engineering. What it is? How does it work? How is this process going? You can learn about all this from this article.

What is reverse engineering software?

reverse engineering




This is the name of the application parsing process in order to understand how it works in order to recreate this process in the future with the necessary changes. Typically, a debugger and assembler are used for these purposes. Depending on the quality of the software used, the result and the amount of time that needs to be spent on its normalization will differ. Explaining reverse engineering for beginners is best done with an example. This will be an application written for Android. And now let's find out what and how.

Android-

reverse engineering programs




First you need to clarify some points. Applications use bytecode and LogCat. These are local counterparts to the previously mentioned debugger and assembler. It is also necessary to understand the structure of the applications themselves. So, each program is a file with the apk extension. It is packed with zip. We are interested in its contents - application resources, classes.dex and AndroidManifest.xml. If you are programming on Android, then there should be no questions with the first and last. But classes.dex is the bytecode of the program, which is compiled specifically for the virtual machine. It is not possible to get the java source code from the means presented on the Internet. But it is possible to get dalvik opcodes - a special set of commands that are used for a virtual machine. For analogy, we can say that this is an assembler of the local spill.Also classes.dex can be turned into a file with the jar extension. Already in this case, after its decompilation, you can get java code that will be more or less readable. This is the way we will go.





Apk Manger. , , , USB-debugging. , apk_manager\place-apk-here-for-modding. Script.bat. , , . – «». , . apk- classes.dex, dex2jar. .bat. , .jar. .

reverse engineering for beginners




To get information about the application, you must open its manifest. According to it, we determine what acts as the main activity. It is this that is of the greatest importance to us now. It is also advisable to look at the very bottom of the program. If below is information about the license manager, this will significantly complicate the implementation of reverse engineering. If we switch to jd-gui and expand the tree, we will see several namespaces. Let's say there are three of them. The first contains files related to advertising. The second will be the classes of the license manager. In the third, we find the necessary data. And we enter it. Here it will be necessary to find and delete the key, and then the rest of the lines that check whether the working version is licensed. All this needs to be cleaned. Then in our Apk Manager we look for the place where it is indicated to place the bytecode.Now let's digress a bit and comment out the commands that could potentially cause problems. After that, we only need to compile the program.

























Build application

reverse engineering android applications




The Apk Manager will help us with this. In the console window, which we did not close, select item No. 14. Further, a matter of technology. If the application is quite complex, then at startup it may partially or completely lose its performance. Do not worry, this means that we are only halfway and there is still where to go. We continue to reverse engineer Android applications. To say what needs to be done in a particular case, in general terms, alas, is impossible. Therefore, you have to look for the problem place yourself. So, if the application window is blocked by a pop-up window,then you need to view the code and delete the part that is responsible for this dialog. Jd-gui can help with this. As you can see, reverse engineering is not easy, and it requires a significant amount of knowledge. Even if everything started without problems, it will be necessary to test the application's performance. That is, reverse engineering is still time-consuming action. We continue to work until all problems are identified.

Security

, Android- -? : , . , . ProGuard. , , . «» , *.apk , . . , - r9. , .

Conclusion

protection of android applications from reverse engineering




This is not to say that reverse engineering can be thought of as uniformly bad or good. Of course, from the point of view of the developers who created the application, this is not a happy event at all. But on the other hand, in many cases, writing experienced files by experienced programmers can be less time consuming than using such tools. Although reverse engineering can serve a good service for beginners, if there is no idea how to implement something, even rough and not quite clear sketches can help achieve this goal.




All Articles