Giter Site home page Giter Site logo

shibbo / magikoopa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ricbent/magikoopa

0.0 1.0 0.0 64 KB

Compiles custom code for 3ds games and injects it into existing code.bin files and patches the exheader

License: GNU General Public License v3.0

C++ 85.18% C 0.93% Assembly 0.52% Makefile 11.67% QMake 1.70%

magikoopa's Introduction

Magikoopa

Compiles custom code for 3ds games and injects it into existing code.bin files and patches the exheader

Motivation for this is to create a NSMB2 hack with fully custom code. In theory this should work with all other games as well tho.

Work in progress. Should be in a kinda working state now. Might still have bugs that wait to be reported :)

You can find examples on how to use Magikoopa in combination with NSMB2 here: https://github.com/RicBent/Magikoopa-NSMB2-Examples/

Getting started

  • Build the project in QtCreator.
  • Run Magikoopa in the build directory.

Hooks

Hooks can be specified with hks files in a patch's working directory. The format is similar to YAML:

hook_name_1:
  type: xxx
  link: false
  addr: 0x00430988
  func: FunctionNameHere
hook_name_2:
  ...

There are several types of hooks.

Type Description
branch Branch to a function (overwrites the original instruction)
softbranch Branch to a function (preserves the original instruction)
patch Patch data at an offset
symbol Write the address of a symbol

The following parameters are common to all hook types:

Parameter Description
addr Hook address

Branch hooks

Parameter Description
link true to make a BL instruction, false for B
func (1) Branch destination function name. This will be converted to an address using the symbol table.
dest (2) Branch destination address

link and one of func and dest are required parameters.

Soft-branch hooks

Parameter Description
func (1) Branch destination function name. This will be converted to an address using the symbol table.
dest (2) Branch destination address
opcode "pre", "post" or "ignore". Defaults to "ignore" if not specified. "pre" to branch to func/dest after the original instruction, "post" to branch before the original instruction.

One of func and dest are required parameters.

Patch hooks

Parameter Description
data (1) Data to insert (in hexadecimal)
src (2) Symbol name of data to insert
len (2) Length of data to insert

data, or both src and len, are required parameters.

Thanks to

  • Dirbaio -- Creator of the NSMBDS asm patch template which was used as a basis
  • StapleButter -- Partial coding of the Filesystem classes
  • Icons8 -- Icons (https://icons8.com/)

magikoopa's People

Contributors

ricbent avatar shibbo avatar leoetlino avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.