1
0
mirror of https://github.com/fumiama/go-hide-param.git synced 2026-06-09 01:10:27 +08:00
Files
go-hide-param/unix.go
fumiama 68b350fe8d init
2021-09-19 21:22:23 +08:00

16 lines
282 B
Go

// +build !windows
package gohideparam
import (
"os"
"unsafe"
)
func Hide(position uint) {
pwdstr := (*[2]uintptr)(unsafe.Pointer(&os.Args[position]))
for i := 0; i < len(os.Args[3]); i++ {
*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(pwdstr)) + uintptr(i))) = '*'
}
}