Editing the Code - Ich73/DQM2-FanTranslation GitHub Wiki

The code of the game code.bin is written in ARM assembly with Little-endian encoding.

You can convert the code using ctr-elf2 to code.elf and disassemble it using IDA.
With Luma's Debugger you can debug the code using Remote GDB.
The tool for editing the code is a Hex Editor. I recommend HxD.

Disassembly

To disassemble the code.bin file with IDA do the following.

  • Convert code.bin to code.elf
    • Install Python 2.7
    • Download make_elf.py from ctr-elf2
    • Place make_elf.py inside a folder (e.g. DQM2-IDA)
    • Copy ExtractedHeaderFS.bin to that folder and name it exh.bin (e.g. DQM2-IDA/exh.bin)
    • Copy ExtractedExeFS/code.bin to the foder ExeFS inside that folder (e.g. DQM2-IDA/ExeFS/code.bin)
    • Open the command line and run the script (e.g. py -2 make_elf.py)
  • Debug using IDA
    • Install and Open IDA
    • Choose New and select code.elf
    • Wait until IDA completes the analysis

Edit

To edit the code open the Hex Editor, edit the bytes and save the file.