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