Documentation
¶
Index ¶
- func Parse(buf []byte) (patchfile.PatchSet, error)
- type BaseAddress
- type Description
- type Enabled
- type FindBaseAddressHex
- type FindBaseAddressString
- type FindBaseAddressSymboldeprecated
- type FindReplaceString
- type FindZlib
- type FindZlibHash
- type FlexAbsOffset
- type Instruction
- type InstructionNode
- type Patch
- type PatchGroup
- type PatchNode
- type PatchSet
- type PatchableInstruction
- type ReplaceBLXdeprecated
- type ReplaceBytes
- type ReplaceBytesAtSymboldeprecated
- type ReplaceBytesNOPdeprecated
- type ReplaceFloat
- type ReplaceInt
- type ReplaceString
- type ReplaceZlib
- type ReplaceZlibGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseAddress ¶ added in v0.15.1
type BaseAddress FlexAbsOffset
func (BaseAddress) ApplyTo ¶ added in v0.15.1
func (b BaseAddress) ApplyTo(pt *patchlib.Patcher, log func(string, ...interface{})) error
func (BaseAddress) MarshalYAML ¶ added in v0.15.1
func (b BaseAddress) MarshalYAML() (interface{}, error)
func (*BaseAddress) UnmarshalYAML ¶ added in v0.15.1
func (b *BaseAddress) UnmarshalYAML(n *yaml.Node) error
type Description ¶ added in v0.15.1
type Description string
type FindBaseAddressHex ¶ added in v0.15.1
type FindBaseAddressHex string
type FindBaseAddressString ¶ added in v0.15.1
type FindBaseAddressString string
type FindBaseAddressSymbol
deprecated
added in
v0.15.1
type FindReplaceString ¶ added in v0.15.1
type FindZlibHash ¶ added in v0.15.1
type FindZlibHash string
type FlexAbsOffset ¶ added in v0.15.1
type FlexAbsOffset struct {
Offset *int32 `yaml:"Offset,omitempty"` // can be specified in place of this object
Sym *string `yaml:"Sym,omitempty"`
SymPLT *string `yaml:"SymPLT,omitempty"`
SymPLTTail *string `yaml:"SymPLTTail,omitempty"`
Inline bool `yaml:"-"` // whether the Offset/Sym was inline
Rel *int32 `yaml:"Rel,omitempty"` // optional, gets added to the absolute offset found
}
FlexAbsOffset allows specifying an absolute offset with either a direct integer (absolute offset - Offset), string (normal symbol - Sym), or a field.
func (FlexAbsOffset) MarshalYAML ¶ added in v0.15.1
func (f FlexAbsOffset) MarshalYAML() (interface{}, error)
func (FlexAbsOffset) Resolve ¶ added in v0.15.1
func (f FlexAbsOffset) Resolve(p *patchlib.Patcher) (int32, error)
func (*FlexAbsOffset) UnmarshalYAML ¶ added in v0.15.1
func (f *FlexAbsOffset) UnmarshalYAML(n *yaml.Node) error
type Instruction ¶ added in v0.15.1
type Instruction struct {
Enabled *Enabled `yaml:"Enabled,omitempty"`
Description *Description `yaml:"Description,omitempty"`
PatchGroup *PatchGroup `yaml:"PatchGroup,omitempty"`
BaseAddress *BaseAddress `yaml:"BaseAddress,omitempty,flow"`
FindBaseAddressHex *FindBaseAddressHex `yaml:"FindBaseAddressHex,omitempty"`
FindBaseAddressString *FindBaseAddressString `yaml:"FindBaseAddressString,omitempty"`
FindZlib *FindZlib `yaml:"FindZlib,omitempty"`
FindZlibHash *FindZlibHash `yaml:"FindZlibHash,omitempty"`
FindReplaceString *FindReplaceString `yaml:"FindReplaceString,omitempty"`
ReplaceString *ReplaceString `yaml:"ReplaceString,omitempty"`
ReplaceInt *ReplaceInt `yaml:"ReplaceInt,omitempty,flow"`
ReplaceFloat *ReplaceFloat `yaml:"ReplaceFloat,omitempty,flow"`
ReplaceBytes *ReplaceBytes `yaml:"ReplaceBytes,omitempty"`
ReplaceZlib *ReplaceZlib `yaml:"ReplaceZlib,omitempty"`
ReplaceZlibGroup *ReplaceZlibGroup `yaml:"ReplaceZlibGroup,omitempty"`
FindBaseAddressSymbol *FindBaseAddressSymbol `yaml:"FindBaseAddressSymbol,omitempty"` // Deprecated: Use BaseAddress instead.
ReplaceBytesAtSymbol *ReplaceBytesAtSymbol `yaml:"ReplaceBytesAtSymbol,omitempty"` // Deprecated: Use ReplaceBytes.Base instead.
ReplaceBytesNOP *ReplaceBytesNOP `yaml:"ReplaceBytesNOP,omitempty"` // Deprecated: Use ReplaceBytes.ReplaceNOP instead.
ReplaceBLX *ReplaceBLX `yaml:"ReplaceBLX,omitempty"` // Deprecated: Use ReplaceBytes.FindInstBLX and ReplaceBytes.ReplaceInstBLX instead.
}
func (Instruction) ToSingleInstruction ¶ added in v0.15.1
func (i Instruction) ToSingleInstruction() interface{}
type InstructionNode ¶ added in v0.15.1
func (InstructionNode) Line ¶ added in v0.15.1
func (i InstructionNode) Line(def int) int
func (InstructionNode) ToInstruction ¶ added in v0.15.1
func (i InstructionNode) ToInstruction() (*Instruction, error)
type Patch ¶ added in v0.15.1
type Patch []*Instruction
type PatchGroup ¶ added in v0.15.1
type PatchGroup string
type PatchNode ¶ added in v0.15.1
func (*PatchNode) ToInstructionNodes ¶ added in v0.15.1
func (p *PatchNode) ToInstructionNodes() ([]InstructionNode, error)
type PatchSet ¶
type PatchSet struct {
// contains filtered or unexported fields
}
func (*PatchSet) SetEnabled ¶
SetEnabled sets the Enabled state of a Patch in a PatchSet.
func (*PatchSet) SortedNames ¶ added in v0.15.1
SortedNames gets the names of patches sorted alphabetically.
type PatchableInstruction ¶ added in v0.15.1
type ReplaceBLX
deprecated
added in
v0.15.1
type ReplaceBytes ¶ added in v0.15.1
type ReplaceBytes struct {
Base *FlexAbsOffset `yaml:"Base,omitempty,flow"` // if specified, Offset is based on this rather than the current offset
Offset int32 `yaml:"Offset,omitempty"`
Find []byte `yaml:"Find,omitempty"`
Replace []byte `yaml:"Replace,omitempty"`
// generators
FindH *string `yaml:"FindH,omitempty"`
ReplaceH *string `yaml:"ReplaceH,omitempty"`
FindInstBLX *FlexAbsOffset `yaml:"FindInstBLX,omitempty,flow"`
ReplaceInstBLX *FlexAbsOffset `yaml:"ReplaceInstBLX,omitempty,flow"`
FindInstBW *FlexAbsOffset `yaml:"FindInstBW,omitempty,flow"`
ReplaceInstBW *FlexAbsOffset `yaml:"ReplaceInstBW,omitempty,flow"`
ReplaceInstNOP *bool `yaml:"ReplaceInstNOP,omitempty,flow"` // if specified, must be true
FindBLX *uint32 `yaml:"FindBLX,omitempty"` // Deprecated: Use FindInstBLX instead.
// special
CheckOnly *bool `yaml:"CheckOnly,omitempty"` // if specified and true, it will only ensure the presence of the find string
}
type ReplaceBytesAtSymbol
deprecated
added in
v0.15.1
type ReplaceBytesAtSymbol struct {
Symbol string `yaml:"Symbol,omitempty"`
Offset int32 `yaml:"Offset,omitempty"`
FindH *string `yaml:"FindH,omitempty"`
ReplaceH *string `yaml:"ReplaceH,omitempty"`
FindBLX *uint32 `yaml:"FindBLX,omitempty"`
Find []byte `yaml:"Find,omitempty"`
Replace []byte `yaml:"Replace,omitempty"`
}
Deprecated: Use Base on ReplaceBytes instead.
type ReplaceBytesNOP
deprecated
added in
v0.15.1
type ReplaceFloat ¶ added in v0.15.1
type ReplaceInt ¶ added in v0.15.1
type ReplaceString ¶ added in v0.15.1
type ReplaceZlib ¶ added in v0.15.1
type ReplaceZlibGroup ¶ added in v0.15.1
Click to show internal directories.
Click to hide internal directories.