mirror of https://github.com/zeldaret/botw.git
Update instructions, fix diff settings and add asm-differ
...to simplify setup a bit
This commit is contained in:
parent
86ca470778
commit
26183142b1
|
@ -7,3 +7,6 @@
|
||||||
[submodule "agl"]
|
[submodule "agl"]
|
||||||
path = lib/agl
|
path = lib/agl
|
||||||
url = https://github.com/open-ead/agl
|
url = https://github.com/open-ead/agl
|
||||||
|
[submodule "asm-differ"]
|
||||||
|
path = tools/asm-differ
|
||||||
|
url = https://github.com/simonlindholm/asm-differ
|
||||||
|
|
11
README.md
11
README.md
|
@ -18,6 +18,7 @@ If you are on Ubuntu 18.04, you can [update CMake by using the official CMake AP
|
||||||
|
|
||||||
### Building a matching version for Switch
|
### Building a matching version for Switch
|
||||||
|
|
||||||
|
0. After cloning this repo, run: `git submodule update --init --recursive`
|
||||||
1. Download [Clang 4.0.1](https://releases.llvm.org/download.html#4.0.1) and extract the archive.
|
1. Download [Clang 4.0.1](https://releases.llvm.org/download.html#4.0.1) and extract the archive.
|
||||||
2. Set the UKING_CLANG environment variable to point to the extracted archive, such that `$UKING_CLANG/bin/clang` exists.
|
2. Set the UKING_CLANG environment variable to point to the extracted archive, such that `$UKING_CLANG/bin/clang` exists.
|
||||||
3. You'll also need devkitA64. Set the DEVKITA64 environment variable. For Linux, $DEVKITA64 is typically `/opt/devkitpro/devkitA64`.
|
3. You'll also need devkitA64. Set the DEVKITA64 environment variable. For Linux, $DEVKITA64 is typically `/opt/devkitpro/devkitA64`.
|
||||||
|
@ -35,6 +36,12 @@ If you are using Visual Studio Code, installing the CMake Tools extension is rec
|
||||||
|
|
||||||
Using a decompiler such as Hex-Rays or Ghidra is strongly recommended.
|
Using a decompiler such as Hex-Rays or Ghidra is strongly recommended.
|
||||||
|
|
||||||
|
You'll also need:
|
||||||
|
|
||||||
|
* pip (for the diff script)
|
||||||
|
* The original 1.5.0 `main` executable, converted to ELF format with [nx2elf](https://github.com/shuffle2/nx2elf).
|
||||||
|
* Copy it to data/main.elf -- it is used for the diff script and other tools.
|
||||||
|
|
||||||
### Resources
|
### Resources
|
||||||
|
|
||||||
* The [ZeldaMods](https://zeldamods.org/wiki/Main_Page) wiki
|
* The [ZeldaMods](https://zeldamods.org/wiki/Main_Page) wiki
|
||||||
|
@ -44,8 +51,8 @@ Using a decompiler such as Hex-Rays or Ghidra is strongly recommended.
|
||||||
### Project tools
|
### Project tools
|
||||||
|
|
||||||
* To compare assembly: `./diff.py <mangled function name>`
|
* To compare assembly: `./diff.py <mangled function name>`
|
||||||
* The function must be listed in data/uking_functions.csv first.
|
* The function **must be listed in data/uking_functions.csv first**.
|
||||||
* [asm-differ](https://github.com/simonlindholm/asm-differ) must be in your $PATH, such that running `asm-differ` works.
|
* To do so, search for the name or the address of function you have decompiled, and add the mangled function name to the last column.
|
||||||
* Pass the `--source` flag to show source code interleaved with assembly code.
|
* Pass the `--source` flag to show source code interleaved with assembly code.
|
||||||
* Add the `--inlines` flag to show inline function calls. This is not enabled by default because it usually produces too much output to be useful.
|
* Add the `--inlines` flag to show inline function calls. This is not enabled by default because it usually produces too much output to be useful.
|
||||||
* For more options, see [asm-differ](https://github.com/simonlindholm/asm-differ).
|
* For more options, see [asm-differ](https://github.com/simonlindholm/asm-differ).
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 1cb24cfc3ab8ec28ddab69719da28836592239b1
|
|
@ -18,7 +18,7 @@ for info in utils.get_functions():
|
||||||
if not info.decomp_name:
|
if not info.decomp_name:
|
||||||
utils.fail(f"{args.function} has not been decompiled")
|
utils.fail(f"{args.function} has not been decompiled")
|
||||||
|
|
||||||
subprocess.call(["asm-differ", "-e", info.decomp_name, "0x%016x" %
|
subprocess.call(["tools/asm-differ/diff.py", "-e", info.decomp_name, "0x%016x" %
|
||||||
info.addr, "0x%016x" % addr_end] + unknown)
|
info.addr, "0x%016x" % addr_end] + unknown)
|
||||||
|
|
||||||
if info.status == utils.FunctionStatus.NonMatching:
|
if info.status == utils.FunctionStatus.NonMatching:
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
def apply(config, args):
|
def apply(config, args):
|
||||||
config['arch'] = 'aarch64'
|
config['arch'] = 'aarch64'
|
||||||
config['baseimg'] = 'data/main.elf'
|
config['baseimg'] = 'data/main.elf'
|
||||||
config['myimg'] = 'build/uking.elf'
|
config['myimg'] = 'build/uking'
|
||||||
config['source_directories'] = ['src']
|
config['source_directories'] = ['src']
|
||||||
config['objdump_executable'] = 'aarch64-linux-gnu-objdump'
|
config['objdump_executable'] = 'aarch64-linux-gnu-objdump'
|
||||||
|
|
Loading…
Reference in New Issue