github.com/HXSecurity/DongTai-agent-go@v0.4.2/core/base/ioReadAll/install.go (about) 1 package ioReadAll 2 3 import ( 4 "fmt" 5 "github.com/HXSecurity/DongTai-agent-go/model" 6 "github.com/brahma-adshonor/gohook" 7 "io" 8 ) 9 10 func init() { 11 model.HookMap["ioReadAll"] = new(IoReadAll) 12 } 13 14 type IoReadAll struct { 15 } 16 17 func (h *IoReadAll) Hook() { 18 err := gohook.Hook(io.ReadAll, ReadAll, ReadAllT) 19 if err != nil { 20 fmt.Println(err, "IoReadAll") 21 } else { 22 fmt.Println("IoReadAll") 23 } 24 } 25 26 func (h *IoReadAll) UnHook() { 27 gohook.UnHook(io.ReadAll) 28 }