Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

How to decompile a script

PlatinumMaster edited this page Jan 15, 2021 · 1 revision

Prerequisites

Procedure

The first two steps depend on your preferred ROM editing tools.


If you are using Tinke:

  1. Load your ROM in Tinke, then locate the script NARC of the game you are hacking. For example: Black and White's script NARC is at a/0/5/7, and Black 2 and White 2's script NARC is at a/0/5/6.
  2. Unpack the NARC.

If you are not using Tinke:

  1. With your ROM tool, dump/extract the script NARC of the game you are hacking. For example: Black and White's script NARC is at a/0/5/7, and Black 2 and White 2's script NARC is at a/0/5/6.
  2. Extract the contents of the NARC with the NARC tool you chose to use.

  1. Find the script container (or, file) in the NARC which you would like to edit. The index of the file can be easily identified by checking the header section in Spiky's DS Map Editor, or similar.

    • (optional) Copy the file you extracted qto the BeaterScript directory.
  2. Open a command prompt/terminal in the BeaterScript directory. On Windows, you can just browse to the directory with Windows Explorer, press Shift + Right Click inside of the folder, then click Open command prompt here, or Open Powershell window here. On Linux, open your terminal, then cd to the BeaterScript directory.

  3. In the command prompt window which shows up, type in the following to decompile your script (dependent on your operating system):

If you are on Windows:

.\BeaterScript -d <input> <game code> <output>

If you are on Linux:

./BeaterScript -d <input> <game code> <output>

If you are on Mac, let me know. I believe it is the same as Linux.

To clarify:

  • input is the path to the script container (or, file) which you extracted out of the NARC earlier.
  • game is the abbreviation for the game you are hacking. Valid options at this time are (case sensitive): BW, B2W2.
  • output is the path where you want this script file to be written.
  1. Check the output path for your decompiled script.