From c41294d45d4b9d4ec1c0f7d0f4c6d457d4ea1fa3 Mon Sep 17 00:00:00 2001 From: Ryan Hileman Date: Fri, 16 Oct 2015 05:59:55 -0700 Subject: [PATCH] fix sample.go --- bindings/go/sample.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/go/sample.go b/bindings/go/sample.go index eeeb6195..0128cfea 100644 --- a/bindings/go/sample.go +++ b/bindings/go/sample.go @@ -34,11 +34,11 @@ func addHooks(mu uc.Unicorn) { invalid := uc.HOOK_MEM_READ_INVALID | uc.HOOK_MEM_WRITE_INVALID | uc.HOOK_MEM_FETCH_INVALID mu.HookAdd(invalid, func(mu uc.Unicorn, access int, addr uint64, size int, value int64) bool { switch access { - case uc.MEM_WRITE_INVALID: + case uc.MEM_WRITE_UNMAPPED | uc.MEM_WRITE_PROT: fmt.Printf("invalid write") - case uc.MEM_READ_INVALID: + case uc.MEM_READ_UNMAPPED | uc.MEM_READ_PROT: fmt.Printf("invalid read") - case uc.MEM_FETCH_INVALID: + case uc.MEM_FETCH_UNMAPPED | uc.MEM_FETCH_PROT: fmt.Printf("invalid fetch") default: fmt.Printf("unknown memory error")