Add MacOS support

This commit is contained in:
2025-04-05 00:08:23 -04:00
parent 5369c3aa44
commit 107f4bcf02
3 changed files with 32 additions and 7 deletions
-7
View File
@@ -4,7 +4,6 @@ import (
"bytes"
"crypto/sha256"
"errors"
"fmt"
"io"
"log"
"net"
@@ -97,12 +96,6 @@ func handleConn(conn net.Conn) {
}
}
// pidToPath returns the path of the executable that has the given PID.
func pidToPath(pid int) string {
path, _ := os.Readlink(fmt.Sprintf("/proc/%d/"+pidPathFile, pid))
return path
}
// getFileHash returns the SHA256 hash of the file at the given path.
func getFileHash(path string) []byte {
file, _ := os.Open(path)