Sunday, 2 March 2014

candycrush - file format

After all the recent discussions about candycrush, I thought I would
test it out - see what the fuss is about.

Its a nicely put together game - delivering a "Bejewelled" experience
which gets you hooked quite early on. Starts really easy and then
becomes challenging. You quickly run out of lives. Lives are
given back to you at a rate of 1 every 30 mins. If you leave the game
for a few hours you can have a few lives to retry the levels again,
until you run out.

Great so far. With over 300 levels - the game will keep you hooked
for a long time. But paying for the extras and in-app purchases can soon
be expensive.

Looking at all the cheats on the web - there seems to be two:
one is to use facebook - login/deinstall/reinstall, and you can
bump up your lives.

The other is to download a "save" file which is premodified to give
you 999 lives and other stuff.

I took a quick look and located that (for Android), the
file of interest is something like

/data/data/com.king.candycrushsaga/app_storage/save_NNN.dat

where NNN is some unique number for you.

Looking at this file in a binary editor shows some form of binary structure.
Given that I was at level 3, the following pattern showed itself:


0002f0: 0003 0000 00c0 1200 0003 0000 00ac 1c00 ................
000300: 0002 0000 00b4 3c00 0003 0000 003c 8700 ......<......<..
000310: 0003 0000 0020 f800 0003 0000 0034 fb02 ..... .......4..
000320: 0003 0000 00ec fe00 0003 0000 00d4 4301 ..............C.
000330: 0003 0000 00ac 3e01 0002 0000 0038 ee01 ......>......8..
000340: 0003 0000 00a8 5b01 0002 0000 005c 5c01 ......[......\\.
000350: 0003 0000 0008 7d02 0003 0000 0018 c801 ......}.........
000360: 0003 0000 00dc 6c02 0002 0000 0010 0d01 ......l.........
000370: 0003 0000 008c 1103 0003 0000 0014 ed03 ................
000380: 0003 0000 00e4 9800 0002 0000 0088 2b01 ..............+.


After that is a sea of all zeroes. I modified those "3"'s - at 8 byte
intervals, and uploaded to my device.

And yes - it now shows that I have completed (or started) those levels.
I am assuming the format here is - number of stars, and a high score account.
Not clear what the 0000 is after the stars - maybe the stars are
an int (i.e. 4 bytes) and 4 bytes for the score.

I presume theres lots more stuff in there to find, including a timer
or other attributes you can earn/pay for.


Post created by CRiSP v11.0.25a-b6698


2 comments:

  1. Continuing my "lets-add-3" ... got to level 530 - which seems to be the end. And it enabled "Owl" mode....but this doesnt give you lives in Owl mode.

    Now I can stop actually playing the game or play when I feel and stop wasting my life away.

    BTW using crisp as the hexeditor and using to record a keystroke macro made this easy to do, but ultimately might want scripting.

    ReplyDelete