Skip to content

shaggy63/go-memexec

 
 

Repository files navigation

go-memexec

Small library that executes code from the memory.

Usage

The following example executes executable embedded into the binary:

import _ "embed"

// go:embed path-to-binary
var mybinary []byte

exe, err := memexec.New(mybinary)
if err != nil {
	return err
}
defer exe.Close()

cmd := exe.Command(argv...)
cmd.Output() // cmd is a `*exec.Cmd` from the standard library

About

Run code from memory

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%