mirror of
https://github.com/fumiama/go-hide-param.git
synced 2026-06-12 11:40:24 +08:00
init
This commit is contained in:
15
unix.go
Normal file
15
unix.go
Normal 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))) = '*'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user