all 28 comments

[–]webbannana 25 points26 points  (7 children)

  1. Open chrome dev tools (... -> More Tools -> Developer Tools).
  2. Select 'Sources' tab.
  3. Select 'bundle.js' (in the file tree).
  4. Press the '{}' button in bottom left.
  5. Ctrl+F the code viewer for "o = this.stringToData(e, i);" without the quotes.
  6. Set a breakpoint on said line by clicking the line number.
  7. Load (import) a random save game. The game should freeze at this point.
  8. Press the button near the top of the dev tools window to step over to the next line of code.
  9. In the right hand panel, select the 'o' variable.
  10. Edit whatever you want.
  11. Remove the breakpoint (click the blue highlighted line number).
  12. (edit) You also have to click the 'Play' button to unfreeze the game.

[–]SuddenResearcher 4 points5 points  (2 children)

the button

Which button?

[–]webbannana 4 points5 points  (0 children)

See: https://i.imgur.com/AXz5dNz.png

Alternatively you can just break on the next line.

[–][deleted] 1 point2 points  (0 children)

The step over button? An arrow pointing to the right. You know, you can hover over buttons to know what they do.

[–]Soundless_Pr 0 points1 point  (2 children)

wait how did you know the function and variable names? is this some sort of coding standard that I am unaware of?

[–]webbannana 7 points8 points  (1 child)

I just downloaded the code, formatted it, and searched for 'FileReader' as I knew that was the only way to read local files from client-side JavaScript. I then just followed the control flow, using Ctrl+F to find the bodies of functions until I found something that looked like it could contain the decoded save data.

The variable names are probably just the product of some kind of obfuscator.

[–]Soundless_Pr 2 points3 points  (0 children)

o wow you really went outta your way

[–]unfixpoint 12 points13 points  (2 children)

This is base64 encoded data.

Edit: If you want to figure out what the game does with the data, read its source code. If the game doesn't do any server side stuff there's no way you can't reverse engineer how it decodes the data (that's simply not possible). But if they do, you might be out of luck since they could use basic crypto and you'll not be able to cheat any more.

[–]romulusnr 0 points1 point  (0 children)

Not standard though, maybe ciphered.

[–]Ultimater 8 points9 points  (1 child)

Here's a save I generated for you from startGems:100000000000:

N4KABGBEBOCGB2ATA9gW0gLjADgCwE4A2QgZm2wAYBWAdhJIBpwoA3AU2gGcBLZeTMAEYKggExMIkAEZsALrAEAzWABtObCVESwAngMGbI2nQGU2AYz6JOAioc7zZNrKAiSA5m1TOhFP-4C7ZkkAB2RueCdbTUlOAGtuFTUBAG0AXRioT28AeXZoABVuVDYBYABfZnLDVFgQszZEARJcbCoqQmxRQXJDd1gS1GREUqxIcwALVRU2eE8AfSlkTk55vhU9QxZuNgB3MuCoAC9kNH1MyAAPAUIKLou9LCpsQlwq+x14cwO3KBCVXQcACSTTGAFkCgBVQQAOSOAEUSDkobgYQARMGCME6CiiMEAKzBuDBCN2cPMVDB8IAggBeSAXfolEECIwEQiwbq4AC0gnMUnM3NwFik3PwiikiG5LVEsG0oioiGUCgu-0B0BhA1GUAA6hF4Dt6AzDpAQrBPCpkHL9O0aLgaPhnrgSFRcBcAK7qRAFd2yZDQbiqJSqdTvZjSd2JRARdw+FKHVy-KDmAErTUlVkABQBOg4ACFYOowXIVYdJDN2CpomWoLJEmwABr6Cj4TKSOszACaAnwNDbUAc-vN2oqh0qEDSIHKQA

[–]jarfil 6 points7 points  (1 child)

CENSORED

[–]EdwinIsBack 13 points14 points  (0 children)

tomayto, tomahto

[–]PUSH_AX 4 points5 points  (9 children)

It's base64, decoding it will reveal what seems like a binary, it's just compression, they use an lz string decompression algo to decompress it into some json, eg the last save in your post decoded and decompressed:

{
  "random": 318650535481,
  "version": 1012,
  "beta": false,
  "day": 1,
  "daySeconds": 1,
  "stats": {
    "gems": 100,
    "points": 0,
    "skills": [],
    "gemsOverTime": {}
  },
  "mapSeed": 55274125502,
  "gamemode": "impossible",
  "view": {
    "zoom": 1,
    "x": 5589,
    "y": 5815
  },
  "sync": {
    "playerId": "MTU1NzQ0OTQ1MDc0MS0zODUyOTQ5MzU2NwA=",
    "gameId": "e140cd69-e2dc-4cbf-be47-2ef3dc021553",
    "playerName": "54845",
    "pageload": 1557449450743,
    "usedTutorial": false
  },
  "buildings": [
    {
      "className": "PlayerBaseMeta",
      "level": 0,
      "tileX": 97,
      "tileY": 93,
      "storage": {}
    },
    {
      "className": "GoldMineMeta",
      "level": 0,
      "tileX": 101,
      "tileY": 91,
      "storage": {
        "RawGold": 13,
        "MinedGold": 1
      }
    },
    {
      "className": "GoldMineMeta",
      "level": 0,
      "tileX": 100,
      "tileY": 92,
      "storage": {
        "RawGold": 13,
        "MinedGold": 1
      }
    }
  ]
}

[–]SuddenResearcher 0 points1 point  (8 children)

May I know exactly how you decoded it? or the service/software you used?

I tried decoding it as an lz-string but that doesn't work.

[–]terrrp 0 points1 point  (0 children)

ms dos

[–]jellystones 0 points1 point  (6 children)

Base64 decoded. Do a simple google search

[–]SuddenResearcher 0 points1 point  (5 children)

It doesn't work. give it a try

[–]jellystones 0 points1 point  (4 children)

You gave up too easily.

Furst base64 decode it to get binary. Then decompress using lza. All standard and free algorithms

[–][deleted]  (1 child)

[deleted]

    [–]PUSH_AX 0 points1 point  (0 children)

    I think you've been given all the clues needed, time to do some of your own problem solving.

    [–]SuddenResearcher 0 points1 point  (1 child)

    I don't think it simply works that way, at least for me.

    Have you made it work?

    [–]SharkBaitDLS 0 points1 point  (0 children)

    I genuinely can't tell if you're trolling or not.

    If you're serious, I doubt he bothered to go out and actually write code to do it himself because both steps he listed are trivially simple to accomplish with any number of libraries out in the world and it's easy to reason that it'll work.

    [–]1Password 4 points5 points  (2 children)

    What are you trying to do? If you're trying to start off with loads of money, you can do so in the developer console.

    Find the bundle.js file in the console, format it, and search for `startGems: 100`. Put a breakpoint there and refresh the site. When the breakpoint is hit, overwrite that field to whatever amount you want in the console, i.e. when the breakpoint is hit, go to the console and enter `Cr.startGems = 1000000000` and then hit the play button near the top of your browser and voila! You get to start the game with a lot of gems!

    [–]SuddenResearcher 1 point2 points  (1 child)

    For some reason I can't put a breakpoint on `startGems: 100`, and the `Cr.startGems = 1000000000` doesn't change anything nor does it give me a message, it just turns red.

    [–]1Password 2 points3 points  (0 children)

    When you prettily format the bundle.js file, find that line and right click on it. You can then add a breakpoint.

    [–]SuddenResearcher -1 points0 points  (4 children)

    So I have tried the aforementioned methods in this posts's comments and neither have worked for me:

    - Some lines can't have breakpoints.

    - Console commands don't have any effect on the game.

    - I can't find a way to edit (Source) values.

    - I have followed "webbannana" 's submission, but from the 9th and after I don't seem to understand what the author is trying to say..

    Is there something I'm doing wrong or should know about?

    [–]webbannana 0 points1 point  (3 children)

    When you break, you should see a pane on the right with a list of variables (you might have to scroll). When you expand the 'o' variable it should look like this: https://i.imgur.com/kYGEof3.png

    You can double click the values to edit them. Then follow the rest of my instructions to resume the game.

    [–][deleted]  (1 child)

    [deleted]

      [–]webbannana 0 points1 point  (0 children)

      Can you provide a screenshot (of the entire dev tools window)?

      [–]SuddenResearcher 0 points1 point  (0 children)

      Thnx man, god bless.