patch

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package patch applies a person's own IPS and BPS patch files to a copy of a game. A patch is an untrusted file, so every length is checked before it's used and the output's size is limited before any memory is set aside.

Index

Constants

View Source
const (
	MaxPatch  = 64 << 20  // the patch file
	MaxOutput = 512 << 20 // the game it produces

)

Limits.

View Source
const (
	IPS = "ips"
	BPS = "bps"
)

Kinds of patch.

Variables

View Source
var ErrSource = errors.New("this patch was made for a different version of this game")

ErrSource means the patch was made for a different copy of the game.

Functions

func Apply

func Apply(game, p []byte) ([]byte, error)

Apply patches a copy of a game, never the original.

func Detect

func Detect(p []byte) (string, error)

Detect says what kind of patch a file is, checking enough of it to refuse a file that only starts like one. An error says why it isn't usable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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