10

I am looking for an reverse engineering tool or a way to decompile the existing android native code to an human understandable format rather than Assembly language. Can anyone please suggest me as i need to unblock one of my priority task.

Thanks in advance.

4
  • Thanks Mialwl.. With hex-rays can we get op-codes for Android as well Though it is based on ARM.
    – msk
    Dec 17, 2013 at 9:16
  • That.. makes no sense. Hex-rays is a decompiler, it will give you C-like code (if it works).
    – fileoffset
    Jan 17, 2014 at 3:36
  • Were you referring to .so files compiled into the APK? Nov 1, 2016 at 14:46
  • 1
    Does this answer your question? How do I reverse engineer .so files found in android APKs?
    – Andrew T.
    Oct 4, 2021 at 14:29

3 Answers 3

6

ida pro + hexrays for arm.

IDAPro is best disassembler tool for many processors and file types. HexRays ARM - plugin for IDAPro (doesn't work separately), which trying to decompile assembler to C-like source code

both not free

https://www.hex-rays.com/index.shtml

1
  • 1
    please improve your answer, with links and descriptions.
    – Ange
    Dec 16, 2013 at 8:05
6

Get the Android NDK and unzip. Use objdump as follows:

android-ndk-r9d\toolchains\arm-linux-androideabi-4.6\prebuilt\windows-x86_64\arm-linux-androideabi\bin\objdump.exe -d libinquestion_jni.so > libinquestion_jni.txt 

While trying different disassemblers, I explored that they are not capable to decode every byte sequence, and even worse, they can decode in a wrong way making you wonder how does it ever work. Different ARMs have different instruction sets and use overlapping byte encodings for them. objdump from the Android NDK is a perfect match for CPUs used in Android products, and it's free.

2
  • is it possible to re-compile the output into ready .so file? Nov 13, 2014 at 15:03
  • Relative offsets cannot be distinguished from integers, so doing this will make little sense. You are either going to produce the same file or something that won't work because disassembler does not make task of making changes to compiled code sufficiently easier. I haven't estimated dump completely, but from what I see, it was not supposed to compile as is. Human readable annotation like "Disassembly of section .plt:" are not commented as they should be in real assembler sources.
    – OCTAGRAM
    Nov 14, 2014 at 6:15
1

The easiest way is to first transfer the APK into a jar file and then decompile the code using your favourite java decompiler (such as jd-gui).

dex2jar has everything you need to have a better representation of your Android application. There is even a user guide that explains exactly what you need to do.

3
  • 2
    But the application what i am looking is native process, not the APK. The native process is developed in C++
    – msk
    Dec 19, 2013 at 2:30
  • Does dex2jar decompile native code? Nov 1, 2016 at 14:57
  • dex2jar doesn't decompile native code. It only works for managed Java code.
    – Hao Nguyen
    Jun 7, 2017 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.