github.com/HXSecurity/DongTai-agent-go@v0.4.2/core/base/execCommand/replacement.go (about)

     1  package execCommand
     2  
     3  import (
     4  	"github.com/HXSecurity/DongTai-agent-go/model/request"
     5  	"os/exec"
     6  	"reflect"
     7  )
     8  
     9  func Command(name string, arg ...string) *exec.Cmd {
    10  	e := CommandTemp(name, arg...)
    11  	//
    12  	var u uintptr
    13  	value := reflect.ValueOf(e)
    14  	u = value.Pointer()
    15  	request.FmtHookPool(request.PoolReq{
    16  		Args:            request.Collect(name, arg),
    17  		Reqs:            request.Collect(e),
    18  		NeedCatch:       request.Collect(u),
    19  		Source:          false,
    20  		OriginClassName: "exec",
    21  		MethodName:      "Command",
    22  		ClassName:       "exec",
    23  	})
    24  	return e
    25  }
    26  
    27  func CommandTemp(name string, arg ...string) *exec.Cmd {
    28  	return &exec.Cmd{}
    29  }