# ALICTF 2016 - LoopAndLoop

Points: 100 Category: Reversing
Description
The friendship between native and dex. (attachment)

Another android reversing challenge. This was the first challenge I solved in the ALICTF, this one was pretty straightforward. An APK is provided, and as usual I first decompile it with apktool and dex2jar.

Upon decompilation with apktool, you’ll notice a /lib directory which clearly signifies that this apk uses some kind of shared library, and commonly in CTF challenges with APKs, you’d usually be required to reverse the logic found in the shared library.

Next, looking at the dex2jar output, we see some kind of recursive check function that makes use of a function defined in the shared library.

The logic is mainly in the following few snippets of codes:

And the shared library function reversed to give:

Rewriting the entire logic in Python and we have our solution!

Entering 236492408 into the application gives us our flag! alictf{Jan6N100p3r}.