monkey

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Patch

type Patch struct {
	// contains filtered or unexported fields
}

Patch is a context that holds the address and original codes of the patched function.

func PatchFunc

func PatchFunc(fn, hook, proxy interface{}, unsafe bool) *Patch

func PatchValue

func PatchValue(target, hook, proxy reflect.Value, unsafe bool) *Patch

PatchValue replace the target function with a hook function, and stores the target function in the proxy function for future restore. Target and hook are values of function. Proxy is a value of proxy function pointer.

func (*Patch) Unpatch

func (p *Patch) Unpatch()

Unpatch restores the patched function to the original function.

Directories

Path Synopsis
mem

Jump to

Keyboard shortcuts

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