Metadata-Version: 2.1
Name: freighter
Version: 0.3.2.dev5
Summary: Kai's GameCube Toolkit enabling C/C++ code injection into .dol executables.
Author-email: "Kai (@kai13xd)" <akaisekai13@gmail.com>
Maintainer-email: "Kai (@kai13xd)" <akaisekai13@gmail.com>
License: MIT License
        
        Copyright (c) 2023 Kai(@kai13xd), 2020 RenolY2, 2021 Minty_Meeo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/kai13xd/Freighter/
Project-URL: Bug Reports, https://github.com/kai13xd/Freighter/issues
Project-URL: Donate, https://ko-fi.com/kai13xd
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Software Development :: Compilers
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: C
Classifier: Programming Language :: C++
Classifier: License :: OSI Approved :: MIT License
Classifier: Environment :: Console
Classifier: Operating System :: Microsoft :: Windows
Description-Content-Type: text/markdown
License-File: LICENSE

# About Freighter

Freighter is command-line based toolkit for setting up and building C/C++ projects using devkitPro for injecting custom code into GameCube/Wii DOL executables. This is a heavily modified fork of Yoshi2's C-Kit that add features such as:

- Project management using TOML configuration files
- Incremental build support utilizing multiprocessing
- Generating .bnr file to customize the banner that is read from Dolphin and the GameCube BIOS.

# Installation

> ### Ensure you are using the latest version of `Python 3.11 or greater` -> https://www.python.org/downloads/

This package is made available through PyPi:

- Windows: `py -m pip install freighter`
- Unix & Such: `python3 -m pip install freighter`

# Reccommendations

- [Window's Terminal](https://github.com/microsoft/terminal): Supports ANSI color codes and unicode emoji characters that Freighter uses to colorize the console ouput.
- [VSCode](https://code.visualstudio.com/): Personal perferred code editor that is feature rich thanks to the community.
- [Ghidra](https://ghidra-sre.org/): A GameCube modder's best friend

# Command Line

After installation open your cli of choice and enter `freighter`

## Options

```
-help : Shows the help prompt.

-new <Project Name> [Path]: Generates a new project at the current working directory with the specified project name.

-build <Project Name> [Profile]: Builds the project with the selected profile.
Defaults to first profile in the config if no arguments are passed.

-import : Opens a filedialog to import a project directory into Freighter's ProjectManager.

-clean : Removes all temporary files and resets the cache. Useful if Freighter throws an error about missing symbols if the filecache becomes bad.

-verbose : Print verbose information to the console

-debug : Print debug and verbose information to the console

-reset : Reconfigures your UserEnvironment.toml
```


# Project Configuration

Freighter uses TOML configuration format your modding projects.
You can generate a new project by using `freighter new ProjectName`

## ProjectConfig.toml

```toml
ProjectName = "MyProject"
[BannerConfig]
BannerImage = "banner.png"
Title = "GameTitle"
GameName = "GameTitle"
Maker = "MyOrganization"
ShortMaker = "MyOrganization"
Description = "This is my game's description!"
OutputPath = "build/files/opening.bnr"


[Profiles.Debug]
GameID = "FREI01"
InjectionAddress = 0x0
InputDolFile = "main.dol"
OutputDolFile = "build/sys/main.dol"
IncludeFolders = ["source"]
SourceFolders = ["includes"]
SDA = 0x0
SDA2 = 0x0
GeckoFolder = "gecko"
SymbolsFolder = "symbols"
LinkerScripts = []
TemporaryFilesFolder = "temp"
InputSymbolMap = ""
OutputSymbolMapPaths = []
StringHooks = {}
IgnoredSourceFiles = []
IgnoredGeckoFiles = []
IgnoreHooks = []
DiscardLibraryObjects = []
DiscardSections = []
CompilerArgs = []
GCCArgs = []
GPPArgs = []
LDArgs = []


```

# Credits

**[Yoshi2 (RenolY2)](https://github.com/RenolY2)**: The OG who made C-kit who made alot of the tools for Pikmin 2 and MKDD. He helped raise baby Kai when he was first learning hex and figuring out how pointers worked. He made a ton of tools that operate on Gamecube era gamefiles and really made the modding scene pop off. Thank you!

**[Minty Meeo](https://github.com/Minty-Meeo)**: He has made alot of great changes to C-kit such as relocating the stack frame and cleaning up the code for injection hooks.

**Yoshifirebird**: This man helped me a TON way back when I was first learning C++. He was the one who had the original idea of using the `#pragma` keyword so Freighter could preprocess the source file to extract the symbol name and the hook injection address. This is a great feature because you can write the injection address inline with your code that you can easily copy paste into Ghidra to
