maux
Star on GitHub Buy me a coffee

Manual / bpatch

bpatch(1)

BPATCH(1) General Commands Manual BPATCH(1)

bpatch - patch a binary from a checked specification

bpatch spec target

Read a specification and an existing target file, apply the edits in memory, then write the target back without changing its length. All offsets and byte values are hexadecimal, without a radix prefix. The specification accepts high-bit maux text or low-ASCII text. Blank lines and lines beginning with # are ignored.

Replace successive bytes starting at offset.
Require the byte at offset to have this value. This observes earlier edits in the same specification.
Scan for absolute LDA, BIT and STA instructions whose operand is $C081 or $C082, and change the low operand byte to $83 or $80 respectively. This is a specialised language-card patch for compatible proshim tenants.

For example, a specification containing:

expect 0010 EA
set 0010 60

replaces a checked NOP byte by RTS. Keep an unmodified copy of the target.

/usr/man/BPATCH this page

dd(1), proshim(1), patch(1)

Exit status is 0 on success, 1 for a specification, range, expectation or I/O failure, 2 for usage errors.

The target is limited to 28672 bytes and the specification to 4096 bytes. Parse/expect failures occur before writing; a write failure may leave partial changes. flip-lc is a byte-pattern scan, not a disassembler, and can also alter data matching the pattern. Available on its development image.

September 19, 2026 maux