1
0
mirror of https://github.com/fumiama/go-hide-param.git synced 2026-06-12 11:40:24 +08:00
This commit is contained in:
fumiama
2021-09-19 21:22:23 +08:00
parent e3ad00e275
commit 68b350fe8d
3 changed files with 116 additions and 0 deletions

15
unix.go Normal file
View File

@@ -0,0 +1,15 @@
// +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))) = '*'
}
}