- Notifications
You must be signed in to change notification settings - Fork33
🚫💾 Run binaries straight from memory in Linux
License
NotificationsYou must be signed in to change notification settings
liamg/memit
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Execute a binary from memory, without touching the disk. Linux only.
Available as both a Go module and a binary.
TheCommand()
method takes anio.Reader
, so you can use it with things like an HTTP response body, abytes.Buffer
, etc.
It provides an*exec.Cmd
(viamemit.Command(...)
) so you can wire up stdin/out and configure other parameters just like you would with a regular command.
package mainimport"github.com/liamg/memit"funcmain() {resp,_:=http.Get("https://.../mybinary")cmd,_,_:=memit.Command(resp.Body,"--args","--go","--here")cmd.Stderr=os.Stderrcmd.Stdin=os.Stdincmd.Stdout=os.Stdout_=cmd.Run()}
Grab thelatest release and run it like this:
memit https://.../mybinary --# args for the actual binary can be put after the --
About
🚫💾 Run binaries straight from memory in Linux