bps

package module
v0.0.0-...-415c112 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

README

A BPS patch applicator.

BPS is a patch format invented by Near (formerly Byuu) which is used by the Link to the Past Randomizer community to manage their "base" rom hacks. It's probably also used elsewhere.

Documentation

Overview

Go library for handling BPS patch files, as commonly used in romfile patching

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BPSPatch

type BPSPatch struct {
	SourceSize     uint64
	TargetSize     uint64
	MetadataSize   uint64
	Metadata       string
	Actions        []byte
	SourceChecksum uint32
	TargetChecksum uint32
	PatchChecksum  uint32
}

func FromBytes

func FromBytes(full_file []byte) (patch BPSPatch, err error)

Read a BPS patch file, verifying the patch checksum

func FromFile

func FromFile(patchfile *os.File) (patch BPSPatch, err error)

func (*BPSPatch) PatchSourceFile

func (patch *BPSPatch) PatchSourceFile(sourcefile *os.File) (target_data []byte, err error)

Apply a BPS patch file to the specified source file. The checksum of the source file and the returned bytes will be verified and an error returned if either fails

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL