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.

msk
  • 109
  • 1
  • 1
  • 3

3 Answers3

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

mailwl
  • 99
  • 3
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.

perror
  • 19,083
  • 29
  • 87
  • 150
OCTAGRAM
  • 161
  • 1
  • 2
  • is it possible to re-compile the output into ready .so file? – Arsen Zahray Nov 13 '14 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 '14 at 06: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.

jiboutin
  • 71
  • 3