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

     1  package urlUrlString
     2  
     3  import (
     4  	"fmt"
     5  	"github.com/HXSecurity/DongTai-agent-go/model"
     6  	"github.com/brahma-adshonor/gohook"
     7  	"net/url"
     8  )
     9  
    10  func init() {
    11  	model.HookMap["urlUrlString"] = new(UrlUrlString)
    12  }
    13  
    14  type UrlUrlString struct {
    15  }
    16  
    17  func (h *UrlUrlString) Hook() {
    18  	var url *url.URL
    19  	err := gohook.HookMethod(url, "String", String, StringT)
    20  	if err != nil {
    21  		fmt.Println(err, "UrlUrlString")
    22  	} else {
    23  		fmt.Println("UrlUrlString")
    24  	}
    25  }
    26  
    27  func (h *UrlUrlString) UnHook() {
    28  	var url *url.URL
    29  	gohook.UnHookMethod(url, "UrlUrlString")
    30  }