Remote debugging in android

Although I usually backup (with TitaniumBackup) my progress in the games I occasionally play in my rooted Nexus 4, lately I was quite lazy about it, so when the latest upgrade to Angry Birds StarWars crashed and I lost all the data it was almost two months of game progress. That was the whole Hoth system… I was not going to repeat the 40 levels, so I would have to fix it myself. Using adb I enter the /data/data/com.rovio.angrybirdsstarwars.ads.iap/files folder, where the file highscores.lua is stored. I remembered that in the first version of the game the file was just a plain text file with your scores in each level you have played, but it seems that Rovio does not like people improving scores so easily, so they changed it to make things more difficult.

I decided to debug the game in order to check what was exactly that file.  I installed the Android NDK and learn how to use the gdb remote debugger. Disassembling the binary showed that that they were using AES with a secret key. More apktool, ndk-gdb and lot of learning and I got it!

e83Tph0R3aZ2jGK6eS91uLvQpL33vzNi

some python coding, and I was again just after Hoth. It took me about 6 hours to learn enough to fix it, quite less than the two months it had taken me to finish the Hoth system.

I would never use this kind of hacking to skip a difficult level, but replaying a whole system … no way. At the end, lot of learning and satisfaction for being able to fix it.

Misc github repository

You can check my misc github repository at

https://github.com/gergomez/misc

take a look at python/genFolderIcon that generates folder icons from .app or .icns and to python/getLyrics.py that retrieves lyrics from several services and updates iTunes with it. Also under DSDT/ you can find self made DSDTs for installing OSX in a Thinkpad W520 and a Dell Precision M4400. Under algo/ there are several classic algorithms and data structures in C and mastermind contains an old implementation of a mastermind player (both command line and network server).

Enjoy it!

Benchmarking Linpack in rMBP

Benchmarking Linpack using goto2, Accelerate framework and Intel MKL on a 2.7Ghz retina MacBook Pro


$ ./dlinpack.goto 1000 10000 3000
From : 1000 To : 10000 Step = 3000
SIZE Residual Decompose Solve Total
1000 : 1.041944e-12 23161.02 MFlops 2691.79 MFlops 22645.94 MFlops
4000 : 1.199085e-11 39830.42 MFlops 3215.11 MFlops 39493.35 MFlops
7000 : 1.275091e-11 41436.37 MFlops 3561.69 MFlops 41248.46 MFlops
10000 : 4.187983e-11 38815.62 MFlops 3498.95 MFlops 38698.47 MFlops

$ ./dlinpack.osx 1000 10000 3000
From : 1000 To : 10000 Step = 3000
SIZE Residual Decompose Solve Total
1000 : 1.826761e-12 45524.90 MFlops 1829.83 MFlops 42490.10 MFlops
4000 : 7.695178e-12 56050.82 MFlops 1434.72 MFlops 54496.09 MFlops
7000 : 1.402567e-11 57479.48 MFlops 1460.27 MFlops 56550.14 MFlops
10000 : 2.467160e-11 58292.55 MFlops 1481.34 MFlops 57629.69 MFlops

$ ./dlinpack.mkl 1000 10000 3000
From : 1000 To : 10000 Step = 3000
SIZE Residual Decompose Solve Total
1000 : 1.068701e-12 42828.39 MFlops 3868.47 MFlops 41575.99 MFlops
4000 : 1.181644e-11 70915.97 MFlops 4059.37 MFlops 70051.33 MFlops
7000 : 8.453460e-11 67207.01 MFlops 3433.54 MFlops 66676.48 MFlops
10000 : 2.085410e-11 72367.13 MFlops 4549.80 MFlops 72045.06 MFlops