Python tools for creating Nintendo REL files
Project description
pyelf2rel
Table of Contents
About
pyelf2rel is a tool / library for creation of files in Nintendo's GameCube/Wii REL format.
Alternatives
- ttyd-tools has a C++ implementation of ELF to REL conversion.
- ppcdis has a more specialised python implementation of the
conversion designed for matching decompilation.
- pyelf2rel is based off of this implementation and is more friendly for general use
Why make another elf2rel implementation?
- ttyd-tools is a bit awkward to build, requiring Visual Studio (or manual setup on Linux) and Boost
- Some legacy code requires specific fork builds of ttyd-tools elf2rel to work, all of those are supported by pyelf2rel
- Upstream support for linking against other rels
- Redirection of unlinked branches to _unresolved
- Control over which sections to include and strip
- This is easier to customise for projects to extend the format
- Some kind of built-in metadata extension may be coming at some point
makelst
Also included is the makelst tool, which can generate LST symbol maps based on global symbols in ELFs and existing LSTs, for use with this or ttyd-tools elf2rel.
Installation
Run the following command to install the package.
pip install pyelf2rel
You will now have access to the pyelf2rel
and makelst
commands (also the extra elf2rel
command,
see below for information). Use each with -h
for more information.
Using in place of ttyd-tools elf2rel
The tool provides an option for matching the API and behaviour (byte-matching output) of the
ttyd-tools elf2rel tool through the elf2rel
command.
- For building projects requiring the
ELF2REL
environment variable, set it equal toelf2rel
- For building projects requiring the
TTYDTOOLS
environment variable, set it equal toelf2rel -x
Multiple versions of the API and behaviour can be matched:
- Use
elf2rel [-x]
to match the modern spm-rel-loader fork (elf2rel-21-12-2021
)elf2rel-13-6-2022
should function the same as this version other than the fact it supported using leading zeroes on the module id and section id without changing to octal - support for this quirk is not planned
- Use
elf2rel --old-fork [-x]
to match the old spm-rel-loader fork (elf2rel-24-6-2021
)- Notably, this includes support for the
offset:symbol?moduleId,sectionId
syntax - Like in the old fork, fixed linking is unsafe for rels produced by this
- Support for the modern LST syntax isn't disabled while using this
- Notably, this includes support for the
- Both modes are supersets of the original ttyd-tools elf2rel, and should match the behaviour of it on projects which used it.
License
pyelf2rel
is distributed under the terms of the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyelf2rel-1.0.0.tar.gz
.
File metadata
- Download URL: pyelf2rel-1.0.0.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ed45fb246360037fc5a7bed425be2cd73b6112a36b011fffafbeb18a98f5654 |
|
MD5 | ab63772efbb72abcb32381992cda5512 |
|
BLAKE2b-256 | da2c90d308d44a798b9c956482626fc6c99659aa847f32ebbc6c446d351a9247 |
Provenance
File details
Details for the file pyelf2rel-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pyelf2rel-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce592f4c45609b978b71ea4e972407ebc0ee57546a88209aecb35c0e8f1aa0b8 |
|
MD5 | 1bf511430a196f822744bbfc1952a38d |
|
BLAKE2b-256 | dc4826175c831ddb57932f73f8543dd65e462134432e23168f6cf05e66755022 |