solution to "syscall.Mprotect panic: permission denied" in Golang on macOS Catalina 10.15.x when using gomonkey or gohook
Change the max_prot
value to 0x7
after linking.
refer to the question: https://stackoverflow.com/questions/60654834/using-mprotect-to-make-text-segment-writable-on-macos
Assuming Go is installed in /opt/go
/opt/go/pkg/tool/darwin_amd64
link
to original_link
chmod +x link
Thanks to Elliott Darfink for sharing.