You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var guard_down *sm.PatchGuard
download_hook := "xxx.DownloadPiece"
guard_down = sm.PatchByFullSymbolName(download_hook, func(ctx context.Context, pt peer.Task, request *peer.DownloadPieceRequest) (success bool) {
// do something
// temporary unpatch
guard_down.Unpatch()
defer guard_down.Restore()
// use forceexport to fetch original function
var function func(context.Context, peer.Task, *peer.DownloadPieceRequest) (success bool)
err := forceexport.GetFunc(&function, download_hook)
if err != nil {
log.Panicf("connect target error: %s", err)
}
// call original function
success = function(ctx, pt, request)
return
})
If the original function is unexported, and should be called inside the hooked method as above, is supermonkey provide some way to call it by symbol name rather than use forceexport?
The text was updated successfully, but these errors were encountered:
cutecutecat
changed the title
Are there any way to call original function by symbol name?
Is there any way to call original function by symbol name?
Aug 6, 2021
If the original function is unexported, and should be called inside the hooked method as above, is supermonkey provide some way to call it by symbol name rather than use forceexport?
The text was updated successfully, but these errors were encountered: