A Web Based JavaScript Game Reverse Engineering

Client Requirement

Modify different value to gain advantage, including coins, golds, XPs. Spawn different loots. Maximum Luck.

Idea

Since its a web based game, DevTools of Chrome is more then enough to achieve this, insepect the sources of the game and trying find the respective JS file, edit it and make a local overeides to the site.

Implementation

  1. An UI overlay is added to the JS since client is not satisify with console command. Just create standard HTML component like const button = document.createElement('button'); set its style and add to the body document.body.appendChild(button);.
  2. Since the JS is not obfuscate(Thank god) I can just search/reading the code and finding out the part I want to edit.
    1. For coins, golds and loots: find the function that add normal loots to the playground, change the ID to spawn coins, golds and rare loots.
    2. For XP: find the function that give XP, add a multiplier to the number.
    3. Maximum Luck: Luck is based on a random number generator [0,1) where [0,0.2] is the lucky interval, hence overide the value to 0.1 will always lucky.
  3. Inject(modify) the JS to the requirement.

Github Repo

This is a out dated version, client only allow release of it.