mirror of
https://github.com/fumiama/go-hide-param.git
synced 2026-06-11 11:10:25 +08:00
fix
This commit is contained in:
10
unix.go
10
unix.go
@@ -8,9 +8,11 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Hide(position uint) {
|
func Hide(position int) {
|
||||||
pwdstr := (*[2]uintptr)(unsafe.Pointer(&os.Args[position]))
|
if position > 0 && position < len(os.Args) {
|
||||||
for i := 0; i < len(os.Args[3]); i++ {
|
pwdstr := (*[2]uintptr)(unsafe.Pointer(&os.Args[position]))
|
||||||
*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(pwdstr)) + uintptr(i))) = '*'
|
for i := 0; i < len(os.Args[position]); i++ {
|
||||||
|
*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(pwdstr)) + uintptr(i))) = '*'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
6
win.go
6
win.go
@@ -91,9 +91,9 @@ func utf16PtrToSlice(p *uint16) []uint16 {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func Hide(position uint) {
|
func Hide(position int) {
|
||||||
if position < uint(len(os.Args)) {
|
if position > 0 && position < len(os.Args) {
|
||||||
cmd := utf16PtrToSlice(syscall.GetCommandLine())
|
cmd := utf16PtrToSlice(syscall.GetCommandLine())
|
||||||
eraseCommandLine(&cmd, position)
|
eraseCommandLine(&cmd, uint(position))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user