Code Monkey home page Code Monkey logo

gc_rel_patcher's Introduction

GC REL Patcher

A tool for generically patching GameCube rel files.

TODO

Finish api functions, write inline documentation, determine any other api functions needed.

API (Early/In progress)

Global/Uncategorized Functions

Finds a list of relocations that reference a specified offset into a section

findPointerAddresses(uint32_t sectionID, uint32_t offset) // Implemented?
findPointerAddresses(uint32_t sectionID, uint32_t offset, uint32_t tolerance) // Implemented?

Get the current filesize

filesize(); // Implmented

Section Functions

The size of a section in bytes

sectionSize(uint32_t sectionID) // Implemented
sectionSizeRounded(uint32_t sectionID) // Implemented

The absolute offset of a section in bytes

sectionOffset(uint32_t sectionID) // Implemented

Move a section to the end of the rel file

moveSectionToEnd(uint32_t sectionID) // Implemented

Resize a section. No bounds or overlap checking is done

resizeSectionUnsafe(uint32_t sectionID, newSize); // Implemented
expandSectionUnsafe(uint32_t sectionID, uint32_t amount) // Implemented
expandSectionUnsafeRounded(uint32_t sectionID, uint32_t amount) // Implemented

Copies data from one location within a section to another

copyData(uint32_t sectionID, uint32_t sourceOffset, uint32_t destinationOffset, uint32_t amount)
copyData(uint32_t sourceSectionID, uint32_t sourceOffset, uint32_t destinationSectionID, uint32_t destinationOffset, uint32_t amount)

Reads bytes from the specified in the specified and stored it in a buffer.

readData(uint32_t sourceSectionID, uint32_t sourceOffset, uint32_t amount)
readData(uint32_t sourceSectionID, uint32_t sourceOffset, char *buffer, uint32_t amount)

Write n-bytes to the specified section at the specified offset

writeToSection(uint32_t sectionID, uint32_t offset, uint32_t value) // Implemented
writeToSection(uint32_t sectionID, uint32_t offset, uint16_t value) // Implemented
writeToSection(uint32_t sectionID, uint32_t offset, uint8_t value) // Implemented

Write n-byte values count times to the specified section at the specified offset

writeToSection(uint32_t sectionID, uint32_t offset, uint32_t *values, uint32_t count) // Implemented
writeToSection(uint32_t sectionID, uint32_t offset, uint16_t *values, uint32_t count) // Implemented
writeToSection(uint32_t sectionID, uint32_t offset, uint8_t *values, uint32_t count) // Implemented

May not be added

// Writes 3-bytes to the specified section at the specified offset
writeToSection24(uint32_t sectionID, uint32_t offset, uint32_t value) // Unimplemented
// Writes 2-bytes to the high value of specified section at the specified offset (assumes 4-byte location)
writeToSection16HI(uint32_t sectionID, uint32_t offset, uint32_t value) // Unimplemented
// Writes 2-bytes to the low value of specified section at the specified offset (assumes 4-byte location)
writeToSection16LO(uint32_t sectionID, uint32_t offset, uint32_t value) // Unimplemented
// Writes 14-bits to specified section at the specified offset
writeToSection14(uint32_t sectionID, uint32_t offset, uint32_t value) // Unimplemented

Relocation functions

Apply the relocations and output results to relocatedRel.rel (only apply relocations for this module)

applyRelocations() // Implemented?

The absolute offset of the relocations in bytes

relocationsOffset(uint32_t sectionID) // Implemented

Write n-bytes to the specified offset in the relocations section

writeToRelocations(uint32_t offset, uint32_t value) // Implemented
writeToRelocations(uint32_t offset, uint16_t value) // Implemented
writeToRelocations(uint32_t offset, uint8_t value) // Implemented

Write n-byte values count times to the specified offset in the relocations section

writeToRelocations(uint32_t offset, uint32_t *values, uint32_t count) // Implemented
writeToRelocations(uint32_t offset, uint32_t *values, uint16_t count) // Implemented
writeToRelocations(uint32_t offset, uint32_t *values, uint8_t count) // Implemented

gc_rel_patcher's People

Contributors

bobjrsenior avatar

Stargazers

CraftedCart 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.