Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMD64 example work fail #4

Open
rock-go opened this issue Nov 26, 2021 · 0 comments
Open

AMD64 example work fail #4

rock-go opened this issue Nov 26, 2021 · 0 comments

Comments

@rock-go
Copy link

rock-go commented Nov 26, 2021

	var originalMessageBoxW *syscall.Proc
	hook, err := hinako.NewHookByName(arch, "user32.dll", "MessageBoxW", func(hWnd syscall.Handle, lpText, lpCaption *uint16, uType uint) int {
		log.Printf("%d , %d , %d" , *lpText , *lpCaption , uType)
		r, _, _ := originalMessageBoxW.Call(uintptr(hWnd), wstrPtr("Hooked!"), wstrPtr("Hooked!"), uintptr(uType))
		return int(r)
	})

2021/11/26 16:19:25 77 , 77 , 0
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x18b2c6]

goroutine 1 [running]:
syscall.(*Proc).Addr(...)
C:/Program Files/Go/src/syscall/dll_windows.go:158
syscall.(*Proc).Call(0x1e0aa3, {0xc0000113c0, 0xc0001196d0, 0xc0001107e0})
C:/Program Files/Go/src/syscall/dll_windows.go:189 +0x1e6
main.main.func1(0x0, 0x400, 0xc000012228, 0x0)
D:/github.com/go-procmon/main.go:23 +0x145
syscall.Syscall6(0x7fffd7e5c320, 0x4, 0x0, 0xc000012210, 0xc000012228, 0x0, 0x0, 0x0)
C:/Program Files/Go/src/runtime/syscall_windows.go:493 +0xfa
syscall.(*Proc).Call(0x11c327, {0xc000010280, 0x1cc800, 0xc000056401})
C:/Program Files/Go/src/syscall/dll_windows.go:189 +0x1fb
syscall.(*LazyProc).Call(0xc00012bb00, {0xc000010280, 0x4, 0x4})
C:/Program Files/Go/src/syscall/dll_windows.go:340 +0x50
main.main()
D:/github.com/go-procmon/main.go:34 +0x2a5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant