Ghidra: Difference between revisions

From Luigi's Mansion 2 Modding Wiki
m (changed "dark moon" to "2" and corrected minor typos)
(Editing draft (incomplete).)
Line 1: Line 1:
In this guide you will see how to use ghidra to view and edit luigi mansion 2 code and then rebuild it.
In this guide, you will learn how to use ''Ghidra'' for viewing and editing '''Luigi's Mansion 2'''<nowiki/>'s code for rebuilding.


== Exefs.elf file ==
== File — exefs.elf ==
''In construction''
<small>[Under construction.]</small>


== Opening the file in ghidra ==
== Opening Files in Ghidra ==
First you need to download ghidra on this page https://github.com/NationalSecurityAgency/ghidra when its download run the file "ghidra_run.bat" then click on file and choose "New project" like on this screenshot:
First, you need to download [https://github.com/NationalSecurityAgency/ghidra ''Ghidra'']. Once downloaded, run the ''ghidra_run.bat'' file and choose "New Project".
[[File:ScreenGhidra0.png|center|thumb|337x337px]]
[[File:ScreenGhidra0.png|center|thumb|337x337px]]
Choose non shared project and whatever name you want, when the project is created slide the exefs.elf in ghidra and choose those settings:
Choose a non-shared project and whatever name you want, when the project is created, drag and drop the ''exefs.elf'' into Ghidra and choose the settings below.
[[File:ScreenGhidra1.png|thumb|center]]
[[File:ScreenGhidra1.png|thumb|center]]
Double click on the exefs.elf and ghidra will open a new window and propose to analyse the file, click yes and then analyse:
Double-click ''exefs.elf'' and Ghidra will proceed to open a new window, and propose to analyze the file. Click "Yes".
[[File:ScreenGhidra2.png|thumb|center]]Then press ctrl+a on the code, right click and choose dissasemble - ARM, right click another time and choose dissasemble - THUMB, these processes will take something like 10 minutes so wait.
[[File:ScreenGhidra2.png|thumb|center]]Then press Ctrl+A in the code editor window, right-click, and choose "disassemble - ARM". Right-click a second time and choose "disassemble - THUMB". these processes will take about 10 minutes.


When all of this is done modify code and enjoy!
When complete, feel free to edit the code how you like!


== Rebuild code.bin ==
== Rebuild code.bin ==
In order to use the file ingame you have to rebuild it to do this press O in the code editor and choose these settings.[[File:ScreenGhidra3.png|thumb|center]]
To use the file in-game, you must rebuild it. To initiate this process, press O in the code editor window and choose the settings below.[[File:ScreenGhidra3.png|thumb|center]]

Revision as of 11:56, 8 June 2024

In this guide, you will learn how to use Ghidra for viewing and editing Luigi's Mansion 2's code for rebuilding.

File — exefs.elf

[Under construction.]

Opening Files in Ghidra

First, you need to download Ghidra. Once downloaded, run the ghidra_run.bat file and choose "New Project".

Choose a non-shared project and whatever name you want, when the project is created, drag and drop the exefs.elf into Ghidra and choose the settings below.

Double-click exefs.elf and Ghidra will proceed to open a new window, and propose to analyze the file. Click "Yes".

Then press Ctrl+A in the code editor window, right-click, and choose "disassemble - ARM". Right-click a second time and choose "disassemble - THUMB". these processes will take about 10 minutes.

When complete, feel free to edit the code how you like!

Rebuild code.bin

To use the file in-game, you must rebuild it. To initiate this process, press O in the code editor window and choose the settings below.