Go: update test hooks

This commit is contained in:
Ryan Hileman
2016-02-27 10:55:40 -08:00
parent 693719e732
commit 475c8de3de
2 changed files with 5 additions and 5 deletions

View File

@@ -96,7 +96,7 @@ func TestX86InOut(t *testing.T) {
default:
return 0
}
}, X86_INS_IN)
}, 1, 0, X86_INS_IN)
mu.HookAdd(HOOK_INSN, func(_ Unicorn, port, size, value uint32) {
outCalled = true
var err error
@@ -111,7 +111,7 @@ func TestX86InOut(t *testing.T) {
if err != nil {
t.Fatal(err)
}
}, X86_INS_OUT)
}, 1, 0, X86_INS_OUT)
if err := mu.Start(ADDRESS, ADDRESS+uint64(len(code))); err != nil {
t.Fatal(err)
}
@@ -132,7 +132,7 @@ func TestX86Syscall(t *testing.T) {
mu.HookAdd(HOOK_INSN, func(_ Unicorn) {
rax, _ := mu.RegRead(X86_REG_RAX)
mu.RegWrite(X86_REG_RAX, rax+1)
}, X86_INS_SYSCALL)
}, 1, 0, X86_INS_SYSCALL)
mu.RegWrite(X86_REG_RAX, 0x100)
err = mu.Start(ADDRESS, ADDRESS+uint64(len(code)))
if err != nil {