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

     1  package bufferWriteString
     2  
     3  import (
     4  	"bytes"
     5  	"github.com/HXSecurity/DongTai-agent-go/model/request"
     6  )
     7  
     8  func WriteString(b *bytes.Buffer, s string) (n int, err error) {
     9  	argStr := b.String()
    10  	n, err = WriteStringT(b, s)
    11  	request.FmtHookPool(request.PoolReq{
    12  		Args:            request.Collect(argStr, s),
    13  		Reqs:            request.Collect(b.String()),
    14  		NeedHook:        request.Collect(argStr, s),
    15  		NeedCatch:       request.Collect(b.String()),
    16  		Source:          false,
    17  		OriginClassName: "bytes.(*Buffer)",
    18  		MethodName:      "WriteString",
    19  		ClassName:       "bytes.(*Buffer)",
    20  	})
    21  	return n, err
    22  }
    23  
    24  func WriteStringT(b *bytes.Buffer, s string) (n int, err error) {
    25  	return n, err
    26  }