You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move documentation to new docs folder, remake Ghidra scripts with Ghidrathon (#30)
* Remove TODO that was completed
* Move building and contributing instructions into new `docs` folder
* Added WIP instructions for Ghidra
* Add link for decompiler setup to `BUILDING.md`, improve formatting
* Add Ghidra `export_functions_as_csv.py` port
* Rename scripts to remove `_in_ida` suffix
* Fix export functions script
* ignore automatically named functions
* fix formatting of address (prepend `0x`)
* `rename_functions` ported to ghidra
* Make docs say to change image base before opening
* Fix docs numbering
* Fix Ghidra function name prefixes
* Fix link markdown syntax
* fix rename functions to use correct memory
* port rename data function
* Add descriptions to Ghidra scripts
* Port export_data_as_csv script to ghidra
* Remove `export_names_as_syms.py` (not for LCE decomp)
* fix function addrs being lower case
* fix quality always being `U`
* Remove print
* Fix config function call
* Update instructions for Ghidra Switch Loader
* Fix rename function script to use block and not address space
* Add multichunk deletion back
* overwrite default functions
* add IDA instructions
Copy file name to clipboardExpand all lines: README.md
+3-61Lines changed: 3 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,70 +33,12 @@ The Nintendo Switch Edition release only lasted for a year, before being replace
33
33
While the latest version of Nintendo Switch Edition is v1.0.17, that version only matches up with Wii U Edition's Patch 35 (v560). Wii U Edition would get a further 8 updates (up until v688) before LCE was abandoned for good.
34
34
35
35
## Building
36
-
The decomp toolchain was created for Linux & MacOS users. While it isn't a hard requirement, if you're running Windows its advised that you [setup WSL](https://learn.microsoft.com/en-us/windows/wsl/install) with an Ubuntu-like distro for the easiest setup.
37
-
38
-
The instructions below assume you're running a form of Linux (WSL or native).
39
-
40
-
### 1. Set up dependencies
41
-
42
-
* Python 3.6 or newer with [pip](https://pip.pypa.io/en/stable/installation/)
43
-
* Ninja
44
-
* CMake 3.13+
45
-
* If you are on Ubuntu 18.04, you must first [update CMake by using the official CMake APT repository](https://apt.kitware.com/).
46
-
* ccache (to speed up builds)
47
-
* xdelta3
48
-
* clang (for compiling Rust tools)
49
-
50
-
Ubuntu users can install those dependencies by running:
* A Rust toolchain ([follow the instructions here](https://www.rust-lang.org/tools/install))
59
-
* The following Python modules: `capstone colorama cxxfilt pyelftools ansiwrap watchdog python-Levenshtein toml` (install them with `pip install ...`)
60
-
61
-
### 2. Set up the project
62
-
63
-
1. Clone this repository. If you are using WSL, please clone the repo *inside* WSL, *not* on the Windows side (for performance reasons).
64
-
65
-
2. Run `git submodule update --init --recursive`
66
-
67
-
Next, you'll need to acquire the **original v1.0.17 `main` NSO executable**.
68
-
69
-
3. Run `tools/setup.py [path to the NSO]`
70
-
* This will:
71
-
* install tools/check to check for differences in decompiled code
72
-
* convert the executable if necessary
73
-
* set up [Clang 4.0.1](https://releases.llvm.org/download.html#4.0.1) by downloading it from the official LLVM website
74
-
* create a build directory in `build/`
75
-
* If something goes wrong, follow the instructions given to you by the script.
76
-
* If you wish to use a CMake generator that isn't Ninja, use `--cmake_backend` to specify it.
77
-
78
-
### 3. Build
79
-
80
-
To start the build, just run
81
-
82
-
```shell
83
-
ninja -C build
84
-
```
85
-
86
-
By default, a multithreaded build is performed.
87
-
88
-
To check whether everything built correctly, just run `tools/check` after the build completes.
36
+
See [BUILDING.md](docs/BUILDING.md).
89
37
90
38
## Contributing
91
-
As this project is in its very early stages, its hard to put guidelines on something that will evolve over time as contributors gain a better understanding of the game's internals.
92
-
93
-
While almost all source paths aren't known, a few .cpp file names do appear in the Wii U Edition's global static constructors, along with a couple asserts giving file paths. Follow these file names wherever possible.
94
-
95
-
Another point of reference is the Switch Edition, showing us the file path to `Minecraft.World/Calendar.cpp` and some other files in that folder. World generation should be stored in this folder based on `MinecraftWorld_RunStaticCtors` routing all worldgen static constructors inside of the folder.
96
-
97
-
For another point of reference, you could also look at [the Minecraft: Pocket Edition decompilation](https://github.com/MCPE-RE/0.1.3j-core) for more inspiration. As a matter of fact, a lot of classes from that decompilation project share function names with this game's symbols. Both editions originated from Notch's messy Minecraft beta code, so it's no wonder that a lot of names were probably copied from Mojang's official mappings at the time.
39
+
See [CONTRIBUTING.md](docs/CONTRIBUTING.md).
98
40
99
-
##
41
+
---
100
42
101
43
Minecraft LCE Decompilation logo by [@break-core](https://github.com/break-core?tab=repositories)
The decomp toolchain was created for Linux & MacOS users. While it isn't a hard requirement, if you're running Windows its advised that you [setup WSL](https://learn.microsoft.com/en-us/windows/wsl/install) with an Ubuntu-like distro for the easiest setup.
3
+
4
+
The instructions below assume you're running a form of Linux (WSL or native).
5
+
6
+
## 1. Set up dependencies
7
+
8
+
* Python 3.6 or newer with [pip](https://pip.pypa.io/en/stable/installation/)
9
+
* Ninja
10
+
* CMake 3.13+
11
+
* If you are on Ubuntu 18.04, you must first [update CMake by using the official CMake APT repository](https://apt.kitware.com/).
12
+
* ccache (to speed up builds)
13
+
* xdelta3
14
+
* clang (for compiling Rust tools)
15
+
16
+
Ubuntu users can install those dependencies by running:
As this project is in its very early stages, its hard to put guidelines on something that will evolve over time as contributors gain a better understanding of the game's internals.
3
+
4
+
While almost all source paths aren't known, a few .cpp file names do appear in the Wii U Edition's global static constructors, along with a couple asserts giving file paths. Follow these file names wherever possible.
5
+
6
+
Another point of reference is the Switch Edition, showing us the file path to `Minecraft.World/Calendar.cpp` and some other files in that folder. World generation should be stored in this folder based on `MinecraftWorld_RunStaticCtors` routing all worldgen static constructors inside of the folder.
7
+
8
+
For another point of reference, you could also look at [the Minecraft: Pocket Edition decompilation](https://github.com/MCPE-RE/0.1.3j-core) for more inspiration. As a matter of fact, a lot of classes from that decompilation project share function names with this game's symbols. Both editions originated from Notch's messy Minecraft beta code, so it's no wonder that a lot of names were probably copied from Mojang's official mappings at the time.
1. Install `nxo64.py` from `reswitched/loaders`. Instructions are available [here](https://github.com/reswitched/loaders?tab=readme-ov-file#installation)
5
+
2. Open `ida64.exe` and disassemble `main.nso`.
6
+
7
+
## Ghidra
8
+
### Setup Instructions
9
+
10
+
1. Setup `Ghidrathon`. Instructions are available [here](https://github.com/mandiant/Ghidrathon#installing-ghidrathon). Make sure `Ghidrathon` has access to the `toml` package.
11
+
2. Setup `Ghidra Switch Loader`. Instructions are available [here](https://github.com/Adubbz/Ghidra-Switch-Loader).
12
+
3. Create a new project. When importing `main.nso`, click `Options`. Then set `Base Address` to `0x7100000000`.
13
+
4. Open the `Script Manager` (green play icon) from Ghidra's toolbar.
14
+
5. Click on Manage Script Directories (bullet points icon) inside the Script Manager, and add `tools/ghidra`. Do not add `tools/common/ghidra_scripts`.
15
+
6. Select the `NX-Switch` category, and use the scripts provided. Information and instructions for each individual script are shown inside the Script Manager.
0 commit comments