Commit Graph

109 Commits

Author SHA1 Message Date
Léo Lam 2e5ecb2352
Update tools 2021-08-22 13:27:11 +02:00
MonsterDruide1 0b50a1a5d2 tools: Add `create_build_dir` to custom `setup.py` 2021-08-21 00:59:26 +02:00
Léo Lam 34d36b4dfc
Update tools/common 2021-08-19 15:50:01 +02:00
Léo Lam 6635c517f5
tools/setup: Allow setup to be called without NSO for re-setting up tools 2021-08-12 15:06:10 +02:00
Léo Lam b5df224222
tools/setup: Remove useless imports 2021-08-12 15:04:19 +02:00
Léo Lam bd8915ab72
tools: Update common 2021-08-12 15:01:04 +02:00
Léo Lam 0352e590cc
tools: Update common 2021-08-11 02:10:50 +02:00
MonsterDruide1 aa4231eff2 tools/setup: Auto-install `check` (viking) 2021-08-10 22:11:04 +02:00
MonsterDruide1 18152c5909 tools: Migrate to external repo 2021-08-10 22:11:03 +02:00
Léo Lam 0f6a9d95b5
Remove old diff.py wrapper (superseded by botw-check) and update docs 2021-08-06 01:25:29 +02:00
Léo Lam e37272f14a
tools: Add single function check mode
Similar to diff.py wrapper usage, except this will also automatically
update the function CSV with the actual match status.
2021-08-05 22:30:20 +02:00
Léo Lam 15f062a2fc
tools: Refactor "check all functions" into its own function
In preparation for adding a single function checking mode.
2021-08-05 22:30:19 +02:00
Léo Lam d1032acc1c
tools: Remove dead code 2021-08-05 22:30:19 +02:00
Léo Lam 5367d0c85a
tools: Print a note when a U function actually exists and matches
Also fixes the function call check not being as strict as it should be
and fixes several false positives in the function list
2021-08-04 17:37:12 +02:00
Léo Lam e3887d6835
tools: Add duplicate name checking 2021-08-04 17:28:50 +02:00
Léo Lam 8f8a48a1dc
tools: Do not overwrite function names with j_ names either 2021-08-02 15:53:59 +02:00
Léo Lam e28ba16cc0
tools: Do not overwrite function names with nullsub_ and sub_ 2021-08-02 15:49:33 +02:00
AlexApps99 3c0648e51f
Added support for WIP function status
This brings functionality up to what diff.py uses
2021-08-01 14:19:29 +12:00
Léo Lam f571280fee
Merge pull request #52 from AlexApps99/master
Ghidra function import script
2021-07-31 12:57:22 +02:00
Léo Lam 80bf9236a3
Remove old tools/check.py
RIP check.py 2020-2021
2021-07-31 12:42:14 +02:00
AlexApps99 ca31637da0
Ghidra function import script
Added .gitignore for Ghidra
2021-07-31 22:41:26 +12:00
Léo Lam 6e30bbea32
tools: Add a new, optimized check tool
Reimplements tools/check.py in a faster language (picked Rust to learn
and play with the language and because installing dependencies is way
easier than with C++)

On my machine, a full run takes ~160ms with this new implementation
and 49s (!) with check.py.

The main performance improvements come from not having to use
pyelftools and the Python bindings of Capstone (which are both insanely
slow and perhaps less efficient than they could be). Function checking
is now also performed in parallel rather than sequentially for yet
another significant performance boost.

Other tweaks include editing Capstone and the bindings to avoid
computing expensive things that we don't actually need and avoiding
dynamic memory allocations in hot paths as much as possible.

check.py will be removed after the setup instructions are updated.
2021-07-30 23:52:55 +02:00
Léo Lam 2204f46b0b
Remove expected/
The intention was to catch functional regressions in non-matching
functions but this doesn't actually work well because referenced
code and data may have moved after a function was dumped, in which
case the reference checker is unable to verify that function calls
and data references are still correct.

Considering this increases the amount of complexity in the checker
and makes the workflow more complicated for contributors, let's just
drop this mechanism. It isn't worth it.

Putting binary files in the repo is also pretty meh.
2021-07-30 20:06:14 +02:00
AlexApps99 3c336794a4
CSV formatting improvements 2021-07-27 12:44:10 +12:00
Léo Lam 206d7781e5
tools: Use bundled copy of objdump to simplify setup 2021-07-23 18:05:23 +02:00
Léo Lam 3fc83fd051
Streamline project setup by automating NSO conversion (if needed) 2021-07-23 12:40:49 +02:00
Léo Lam bc5593aa44
setup: Use subprocess.check_call instead of os.system 2021-07-22 22:07:25 +02:00
Léo Lam 5d7fa0aede
Simplify build setup by adding a setup script 2021-07-22 02:45:01 +02:00
Léo Lam 710c91eeff
tools: Make register pair tracking more robust by using insn.regs_access() 2021-06-28 18:51:08 +02:00
Léo Lam c249c93be1
tools: Fix check script not handling ldrb, ldrsb, etc. correctly 2021-06-25 00:32:29 +02:00
Léo Lam 1b9f698134
tools: Fix strb and other str variants not being handled 2021-06-24 22:47:19 +02:00
Léo Lam b3acc6a393
Add tool to translate IDA types to real C++ types
Currently this only covers agl Parameter classes, but more type names
may be added to the mapping in the future.
2021-06-20 14:25:46 +02:00
Léo Lam 38e5e47b07
tools: Ignore excluded lib functions for rename script 2021-06-15 10:52:45 +02:00
Léo Lam f4740f07e7
Exclude libcurl and NintendoSDK-NEX
This project is not going to decompile libcurl and NEX. It's just not
the main focus of the project and it's unlikely to yield any kind of
interesting information.

PosTrackerUploader and possibly the network save transfer stuff
do use NEX but those are secondary, possibly debug-only features.
Furthermore decompiling those two systems does not require actually
implementing the entirely of libcurl+NEX (~1MB); we just have to
write "API stubs" (headers) for the few parts of NEX that are used
by BotW code.
2021-06-15 01:49:54 +02:00
Léo Lam 6ba20da9ee
Add a script to suppress gdt*Flags.cpp rebuilds for faster builds 2021-04-02 16:08:05 +02:00
Léo Lam a303d6e1b7
tools: Show line number when CSV parsing fails 2021-02-07 15:42:56 +01:00
Léo Lam eaa0f651ef
tools/diff: Rebuild on library changes as well 2021-01-31 22:30:38 +01:00
Léo Lam 5c6cc59214
tools: Update asm-differ and add support for -mw (make, watch) 2021-01-25 14:41:33 +01:00
Léo Lam 5410a56d20
tools: Sort decomp symbols by address
Makes it less tedious to add several decompiled functions to the
function list
2021-01-22 14:20:01 +01:00
Léo Lam 3b996a212c
Track AI class decompilation macro progress 2021-01-21 12:52:56 +01:00
Léo Lam d5a9f2bc82
identify_matching_functions_by_call: Add support for matching one fn 2021-01-01 18:58:39 +01:00
Léo Lam 3dd4331fc9
Add more AI matches 2020-12-31 15:09:42 +01:00
Léo Lam 028ad38b41
Add matching AI functions to CSV 2020-12-31 14:35:21 +01:00
Léo Lam 3869e440e7
Generate AIs 2020-12-31 14:16:09 +01:00
Léo Lam a226027828
Add tool to rename AI virtual functions 2020-12-31 12:46:44 +01:00
Léo Lam 834f44e556
tools: Optimize symbol parsing 2020-12-29 15:04:45 +01:00
Léo Lam 8b41b83228
Add tool to identify matching sead RTTI functions 2020-12-29 14:18:25 +01:00
Léo Lam 81b1ec96bb
Add more missed matches 2020-12-29 01:38:07 +01:00
Léo Lam 27196eb945
Add more missed matches 2020-12-29 01:22:53 +01:00
Léo Lam 56e1c0cfd2
Action: Fix incorrect handling of inherited virtual functions 2020-12-28 23:49:15 +01:00