121 Commits

Author SHA1 Message Date
d9612cc9b7 Analyzer improvements for ProDG (WIP)
Fixes #19
2024-01-06 16:05:04 -07:00
c44846d73f Allow absolute relocations to linker generated symbols
Fixes #15
2024-01-06 11:47:17 -07:00
8e7de9588f cargo fmt 2024-01-06 10:29:51 -07:00
3bcfaef4fe Zero out relocations before disassembling
Fixes an issue where an addi with relocation
can be disassembled as subi
2024-01-06 10:28:01 -07:00
Benjamin Moir
dd23fef4f7
Support some more MetroWerkz DWARF extensions (#22)
* Support FT_MW_int128

* Support OP_MW_FPREG

* Support AT_MW_mangled on local variables

* cargo fmt

---------

Co-authored-by: Luke Street <luke@street.dev>
2024-01-02 10:33:07 -07:00
fdf421a5d8 Update dependencies (advisory fix) 2023-12-20 20:43:39 -07:00
d470f7aec6 Version 0.6.5 v0.6.5 2023-12-20 20:30:48 -07:00
227153193e Sanitize auto-function-split names
Fixes #16
2023-12-20 20:28:30 -07:00
2681e51443 Don't double remove obj path extension
Don't remember why I had it like this

Fixes #17
2023-12-20 20:22:00 -07:00
6f2bb62082 Downgrade vis_flags/active_flags error to warn
Fixes #18
2023-12-20 19:11:23 -07:00
Sewer
d43b95a0e4
Added: Support for Little Endian DWARF, Inline Arrays & Additional MetroWerks Extensions (#14)
* Added: Minimal Required Changes to Dump Sonic Heroes (PS2)

* Added: Switch for Little Endian DWARF Dump

* Added: Support for Array Ordering

* Added: Big/Little Endian Variants of u32_from_bytes

* Changed: Detect bitness from .elf header.

* Changed: Use Proper MetroWerks Names

* Changed: Use Endianness from File API

* Refactor DWARF endian handling & some fixes

* Undo accidental formatting changes

---------

Co-authored-by: Luke Street <luke@street.dev>
2023-12-11 13:07:29 -05:00
0cfc5df20b Overhauled common BSS support & more
- With a map, attempts to detect and handle common BSS automatically
- With a map, attempts to detect and correct inflated common BSS bug (< GC 2.7 linker)
- Support for "stripped" symbols, sometimes required to match inflated common BSS sizes
- Warns on duplicated TUs in a map (other than common BSS)
- Automatically adds `comment:0` to `.s` TUs from a map (avoids linker crash)
v0.6.4
2023-11-29 18:31:35 -05:00
5c22c8850e Support .BINARY section
Resolves #12
2023-11-29 18:14:48 -05:00
4cb6f4f85d dwarf dump: Better support for GCC/ProDG & various fixes
- Displays subroutine "static" and "inline" if present
- Displays subroutine labels, blocks and inlines if present
- Displays struct member visibility if present
- Skips tags that can't be processed rather than bailing
2023-11-27 16:35:12 -05:00
5128ff67b2 bin2c: Honor symbol alignment v0.6.3 2023-11-26 01:12:34 -05:00
dd60128ba0 Extract embedded assets to binary and C header
Adds an "extract" list to project configuration:
```
extract:
- symbol: SomeData
  binary: Lib/SomeData.bin
  header: Lib/SomeData.inc
```
This example extracts the data of symbol
`SomeData` to `out_dir/bin/Lib/SomeData.bin`,
and a C array representation to
`out_dir/include/Lib/SomeData.inc`.

Resolves #11
v0.6.2
2023-11-26 00:35:05 -05:00
038354a37e Version 0.6.1 v0.6.1 2023-11-22 13:01:42 -05:00
e3d6ef8492 dwarf dump: Fix padding handling within tag children
Fixes #9
2023-11-22 12:59:03 -05:00
c8a2d4896a dwarf dump: Fix reversed struct/class in def
Fixes #10
2023-11-22 12:21:24 -05:00
854ed74605 CI: Fix release job v0.6.0 2023-11-18 23:50:01 -05:00
7168d2632f Version 0.6.0 2023-11-18 23:38:43 -05:00
ebff47924f Add links field to config for overriding REL linkage
By default, every REL is linked with every other REL. Some games, like Mario Party, link RELs individually, so the module IDs are not unique. To support this, the `links` field can be used to override which _other_ modules are included in a module's analysis.
2023-11-18 23:37:50 -05:00
28af4872ab rel make: Add --quiet/-q, --names/-n args
`-n` is a somewhat ugly hack to only select certain modules from `config.yml`, for games with overlapping module IDs
2023-11-18 23:34:44 -05:00
38c692650f write_rel: Skip setting reloc/imp offset with empty relocations 2023-11-18 23:33:18 -05:00
8659b56da4 Skip writing objects and ldscripts if unchanged
Avoids unnecessary rebuilds with build systems like ninja & make that track mtime
2023-11-18 17:21:08 -05:00
363fa2ac72 Use custom syntect packs to reduce binary size
- Custom syntax set containing only C/C++
- Custom themeset containing only Solarized (Dark)
- Disable default syntect features
2023-11-18 16:12:03 -05:00
d7a3fd53c7 Fix CI artifact upload 2023-11-18 15:07:44 -05:00
8f559c8921 Update dependencies & CI changes
- Use separate release-lto profile for CI
- A couple of clippy fixes
2023-11-18 15:03:24 -05:00
5e13998e93 Major dwarf dump rework
- Supports games with C++ DWARF info
- Syntax highlighting when printing to console (disable with `--no-color`)
- Overall improvements to parsing and output
2023-11-18 13:56:58 -05:00
4935708b61 Fix REL v2 creation (and v1, hopefully)
- Adjusts `write_rel` to use the proper ordering for relocations and imports based on the REL version.
- Adds `-r`/`--relocations` switch to `rel info` that prints (very) verbose relocation information.
v0.5.8
2023-11-09 01:16:37 -05:00
456f4eebd4 Update deny.toml 2023-11-07 23:25:24 -05:00
65b04024d5 Update README.md
The previous commit also fixed the `map` commands, because why bother splitting anything out?
2023-11-07 23:24:03 -05:00
ec4caf5000 Smarter configuration updates
- Avoid overwriting `symbols.txt` or `splits.txt` if the file was modified since it was read or if the file's contents didn't change.
- Remove `binrw` and `byteorder` dependencies, moving to `FromReader`/`ToWriter` traits.
- Migrate generic bounds to `where` clauses.
- Remove unused `build.rs` logic.
2023-11-07 23:21:59 -05:00
c452b74666 Version 0.5.7 v0.5.7 2023-10-10 12:33:27 -04:00
41a69441da Support section 241 (extabindex) in RSOs 2023-10-10 12:32:56 -04:00
95c779b105 Better terminal color support
- Enables ANSI on Windows 10
- Disables colors if unsupported
- Supports `--no-color` and env `NO_COLOR` to disable
- Supports env `FORCE_COLOR` and `CLICOLOR_FORCE` to enable
2023-10-10 12:32:05 -04:00
a164852a15 Write gap symbols as hidden v0.5.6 2023-10-07 14:50:01 -04:00
dfb569b883 Add alf support (NVIDIA Shield TV binaries)
- Supports .alf files in all places .dol files are accepted.
- Adds `hash` and `dhash` to symbols config.
2023-10-07 02:03:09 -04:00
db506fb927 Update dependencies & macros.inc for ppc750cl 2023-10-06 01:20:04 -04:00
62c5e3acf9 Update README.md with dtk-template & more commands 2023-10-04 23:38:43 -04:00
36bb5ddcc6 Zero out section data for relocations in relocatable ELFs
Fixes issues with Wii versions of mwld.
v0.5.5
2023-10-01 12:50:21 -04:00
c354c6da4b REL section alignment fixes
- Honor section alignment from splits.txt when writing RELs
- Better heuristic for determining REL section alignment on initial analysis
v0.5.4
2023-09-26 13:06:57 -04:00
610a2e56b9 Add ldscript_template option to project config v0.5.3 2023-09-23 07:56:49 -04:00
400fb7fa7f Add code_size, data_size to generated config.json
Also simplify project config generation by skipping default fields
v0.5.2
2023-09-14 17:24:00 -04:00
59a4eb33d0 Write version in generated config.json v0.5.1 2023-09-13 17:07:06 -04:00
42217a339e Update cargo deny.toml v0.5.0 2023-09-13 02:10:47 -04:00
d4ef1ce16a Analyzer fixes galore
- Transparent NLZSS decompression (add `:nlzss` to path)
- Overhaul portions of the analyzer to support more games
- Reject some invalid data relocations automatically
- Jump table analysis fixes
2023-09-13 02:08:51 -04:00
50f913c4eb clippy fixes v0.4.2 2023-09-10 02:20:54 -04:00
18170a96a2 Don't use map in dol diff and dol apply; remove common BSS hack 2023-09-10 02:20:08 -04:00
788ffb9e17 Fix empty .lcf FORCEACTIVE with symbols_known v0.4.1 2023-09-09 19:24:13 -04:00