bouk

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToLocation

func CopyToLocation(location uintptr, data []byte)

this function is super unsafe aww yeah It copies a slice to a raw memory location, disabling all memory protection before doing so.

func JmpToFunctionValue

func JmpToFunctionValue(to uintptr) []byte

Assembles a jump to a function value

func ReplaceFunction

func ReplaceFunction(from, to uintptr) (original []byte)

from is a pointer to the actual function to is a pointer to a go funcvalue

func Unpatch

func Unpatch(target interface{}) bool

Unpatch removes any monkey patches on target returns whether target was patched in the first place

func UnpatchAll

func UnpatchAll()

UnpatchAll removes all applied monkeypatches

func UnpatchInstanceMethod

func UnpatchInstanceMethod(target reflect.Type, methodName string) bool

UnpatchInstanceMethod removes the patch on methodName of the target returns whether it was patched in the first place

Types

type PatchGuard

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

func Patch

func Patch(target, replacement interface{}) *PatchGuard

Patch replaces a function with another

func PatchInstanceMethod

func PatchInstanceMethod(target reflect.Type, methodName string, replacement interface{}) *PatchGuard

PatchInstanceMethod replaces an instance method methodName for the type target with replacement Replacement should expect the receiver (of type target) as the first argument

func PatchSymbol

func PatchSymbol(target, replacement interface{}) *PatchGuard

func (*PatchGuard) Restore

func (g *PatchGuard) Restore()

func (*PatchGuard) Unpatch

func (g *PatchGuard) Unpatch()

Jump to

Keyboard shortcuts

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