patch_generator

package
v1.0.2-0...-984da95 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

README

Hook Generator

This tool generates RPCS3 patches from patchwork binaries. It uses the labels from the asm hooks in the patchwork binaries.

Usage

hook-generator -input patchwork.prx -config /path/to/lbpdef.yamls -output patchwork_patch.yml

Then the patch yaml need to be added to the imported_patch.yml in RPCS3. It will add a "Patchwork Combined Patch", which should contain the ASM patch for each game as it's own patch.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHook

func GetHook(r io.ReaderAt, hookOffset uint64) ([]byte, error)

Types

type Game

type Game struct {
	Offsets      GameAddressOffsets `yaml:"offsets"`
	UserAgent    string             `yaml:"user_agent"`
	Name         string             `yaml:"name"`
	GameVersions []string           `yaml:"versions"`
	TitleIDs     []string           `yaml:"title_ids"`
	PPUHash      string             `yaml:"ppu_hash"`
	Patches      []Patch            `yaml:"patches"`
}

type GameAddressOffsets

type GameAddressOffsets struct {
	UserAgent   uint32 `yaml:"user_agent"`
	HttpURL     uint32 `yaml:"http_url"`
	HttpsURL    uint32 `yaml:"https_url"`
	PresenceURL uint32 `yaml:"presence_url"`
	LiveURL     uint32 `yaml:"live_url"`
	DigestKey   uint32 `yaml:"digest_key"`
	NetworkKey  uint32 `yaml:"network_key"`
}

type Patch

type Patch struct {
	// Symbol to search for in the prx that denotes the start of the patch
	Symbol string
	// Length of the patch, if left unset it will try to auto-detect by looking for an absolute branch instruction
	Length uint64
	// Type determines whether the patch is a hook that should be in its own memory or a set of instruction to overwrite existing code
	Type PatchType
	// Offset is the offset in the game to start patching from, in virtual memory
	Offset uint32
}

type PatchType

type PatchType string
const (
	Hook      PatchType = "hook"
	Overwrite PatchType = "overwrite"
)

type Server

type Server struct {
	PrimaryURL   string `yaml:"primary_url"`
	HttpsURL     string `yaml:"https_url"`
	CustomDigest string `yaml:"custom_digest"`
	Name         string `yaml:"name"`
	Owner        string `yaml:"owner"`
	Description  string `yaml:"description"`
}

type Servers

type Servers struct {
	Servers []Server `yaml:"servers"`
}

Directories

Path Synopsis
cmd
patch_generator command

Jump to

Keyboard shortcuts

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