Time Wasting and Hacking (Or How I Stopped Worrying and Came To Love The Clicker)

I’ve recently found myself playing Clicker Heroes. Yes.  This game:

image

It’s as dumb as it looks.  It’s a clicker game. You hit the enemy to get gold coins.  And then the gold coins let you buy upgrades, to better hit the enemies, to get gold coins faster, to buy upgrades, to….you get the idea. And the game draws you in and doesn’t let go. No matter how much my monkey brain said this is dumb, time in my day kept mysteriously disappearing.  That was until I noticed this:

image
image

Huh.  That’s strange.  A text file you say?  The games are saved as a text file. And you import a text file to load your game.  Wonder what the text file looks like:

image

Huh.  That looks like base64.  Let’s dump the file and see what we get.

image
image

Alright.  Meaningless jibber jabber.  How about I play for a while and have a new file save to compare it to?

A few minutes hours later, I’ve got another saved file.  I quickly convert it from base64, and dump it into hex and compare the two.

image

Alright.  In the beginning, the first lines seem to be all the same, and then everything's completely different.  That’s not helpful.

After some googling, Binwalk comes up.  Apparently it’s a tool to see what type of file a piece of data is, and normally used with regards to Kali. Alright Binwalk, don’t fail me now:

image

Bingo!  Apparently it’s a zlib file.  Which is not a file type I even knew existed. A lot of googling later, and I find out Google didn’t either. The most recent thing I can find is a comment from 2010.  Who knew dinosaur file types existed on the internet? Anyway:

image

Says it’s not a Zlib file type.  That’s embarrassing. Google? Huh.  Apparently Binwalk is telling me there’s a Zlib file starting at point 24.  So let’s start counting.

image

Aha!  That’s where it starts.  Whatever 78 da means.

Google?

image

Alright.  Best compression.  Cause we’re the best.  And since the beginning of the file isn’t a zlib file, let’s cut it out.  I’m sure it’s not important.

dd if=save1 bs=1 skip=24 > save1.zlib

(didn’t take a screen shot here)

Let’s check. Does it see it as a zlib file?

image

Yes indeed.  Now that I have a useless file type, what next? Google says that zlib-flate can uncompress these files.  Let’s take a look.

image

Jackpot! We’re in.

Let’s open it up in vim.

image

Find the rubies:

image

And give myself a reasonable amount…. Wouldn’t want to be greedy now would we?

image

And then, let’s add back in the lines we cut out, convert it back into base64, and throw it into a text file.

image

Now we take the final.txt file and paste it in.

And nothing happens. Fun. Let’s try to debug an unreadable file. I’m sure this will be easy. I open up the save file we started with, and compare it to what I got.

Original Save File:

image

My save file:

image

Corporate needs you to find the difference between these two photos.

Apparently vim added a bunch of new lines to make my file readable. So a quick and dirty Google:

image

And import:

image

Glad I could support the development of the game.

image

At market rate, I’ve just contributed around 76 billion dollars to the world economy.  It sure is tough out there. Now I just hope they accept taxes in rubies now. Maybe I can talk to some crypto people about my new currency idea…

And, I no longer find myself wanting to play this game anymore. Happy story all around.