How To See Other Games' Code (current info posted in OP and Post 146 on 6/18/19)

This method is now required for games downloaded on Steam – the “Use 7-Zip on the .EXE file” won’t work on games that have been packaged recently. In particular, it won’t work for Lost Heir 3, and (when I re-downloaded it from Steam to check) the “Use 7-Zip on the .EXE file” won’t work on Lost Heir 2 either (and it used to work).

Note that you are still able to open the .EXE file with 7-Zip, but it opens it as a “PE file” (= “Windows EXE”) and shows you a list of resources, including the uncompressed compiled code, that make up the EXE. This isn’t useful in the slightest for the purposes of “Viewing the source code of a ChoiceScript game”, so…

To add some more detail to the instructions:

  1. Go to https://nodejs.org/, download and install the software you find there. You must note the installation directory, as you’ll need it for the next step. By default, it will be “C:\Program Files\NodeJS”.
  2. Open a command prompt (Start / Run and type “cmd” works prior to Windows 10 – in Windows 10, click on the “Find anything” button next to the start button (its a circle) and type “cmd” in that box to do this.
  3. Type “cd [path you installed NodeJS too]” – note that you will need to use double quotes around the path name if it contains spaces, and it almost certainly does. For example: cd “C:\Program Files\NodeJS”.
  4. Type npm install -g asar into the command window. After a fairly short (< 30 second) pause, a text rendition of a file / folder tree will appear and you’ll end up back at the command prompt.
  5. Open (or change) the current directory to the location where Steam installed the game you are investigating. This tends to be a long path – in most cases it will be easier to right click on the game in Steam, select “Properties”, then “Local Files”, then “Browse Local Files”, then while holding the shift key, right click on an empty area of the window that appears and select “Open Command Window Here”. If you don’t see this option, you aren’t pressing and holding the shift key before right clicking – this isn’t a documented feature, but it does work. :slight_smile: This is hardly the only way to get to the right directory, but it is the easiest to explain without screenshots (I think).
  6. Once you have a command prompt opened in the right directory, type cd resources (this is where the app.asar file actually resides).
  7. Finally, type asar e app.asar dest. Nothing at all will seem to happen (although you shouldn’t get an error message). However, if you go back to file explorer, there will be a new directory “dest” in the resources folder for your game, which contains the source code of the game.

Good grief, cheating has never been this hard before… :slight_smile:

For the record:

  • dest in Step #7 is the name of a directory where the files will be decompressed to, and you can change it. But the instructions are complex enough as it is, so…
15 Likes