1

An APK I'm working on uses some sort of algorithm to generate a hash which is sent along with an HTTP request. I want to figure out how the algorithm works.

Decompiling the APK to Java is of no help at all because it is much too obfuscated and there is clearly a ton of jumping around to separate files, it's impossible to follow.

Analysing the SMALI is much more helpful, but still very difficult to follow due to the use of many different files, and also the generic/meaningless function names.

I have IDA Pro but I don't have the Hex rays decompiler. There is also an extremely small amount of tutorials on using IDA Pro with Android. Is IDA Pro useless here? Smali is definitely easier to understand than the raw machine code instructions.

What are my options for analysing and figuring out this algorithm?

Thank you for your suggestions

  • What is the apk name and sha256? If it really has strong bytecode obfuscation, I'd be curious to take a look. You don't see that on Android often. Most apps either have weak obfuscation (Proguard) or just use a packer. – Antimony Jan 13 '16 at 14:54
  • com.instagram.android? – Antimony Jan 13 '16 at 18:48
  • @Antimony yes that's correct. I pulled the APK from my phone with adb. Then I used Apktool to convert to SMALI. I can tell you more about the app in a chatroom if you need. – 43.52.4D. Jan 13 '16 at 18:55
  • I took a look, but I didn't see any unusual obfuscation. Just a bit of identifier renaming. Any recent decompiler should work here. – Antimony Jan 13 '16 at 19:41
  • @Antimony what approach would you take personally to learning how an algorithm generates a value? Do you mean decompiler like Apktool or disassembler like IDA Pro? – 43.52.4D. Jan 13 '16 at 20:43
1

IDA PRO is useful for analyzing native code. Hex-Rays decompiler decompiles ARM and x86/x64, not java. For your specific case IDA pro would be useful if this hashing algorithm would be compiled in native code and called with JNI like interface.

For your specific case IDA is almost useless because almost all of its advantages related to native code analysis.

  • What could I utilize to analyse how this algorithm works then? – 43.52.4D. Jan 13 '16 at 17:15
  • There is no other choice, you have to deobfuscate the APK code. In addition I'd suggest you to read answers to this question: reverseengineering.stackexchange.com/questions/1370/… – w s Jan 13 '16 at 18:14
  • Well a strange dilemma is that using Apktool to convert to SMALI makes the code more understandable/less obfuscated than attempting to convert to Java source code. If there was a way to convert SMALI to java source code, that would be helpful. – 43.52.4D. Jan 13 '16 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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