rename error codes ERR_MEM_READ, ERR_MEM_WRITE, ERR_MEM_FETCH

This commit is contained in:
Nguyen Anh Quynh
2015-09-09 16:25:48 +08:00
parent d3d38d3f21
commit d7ef204398
7 changed files with 36 additions and 36 deletions

View File

@ -39,9 +39,9 @@ const (
ERR_HANDLE = 3
ERR_MODE = 4
ERR_VERSION = 5
ERR_MEM_READ = 6
ERR_MEM_WRITE = 7
ERR_MEM_FETCH = 8
ERR_READ_INVALID = 6
ERR_WRITE_INVALID = 7
ERR_FETCH_INVALID = 8
ERR_CODE_INVALID = 9
ERR_HOOK = 10
ERR_INSN_INVALID = 11

View File

@ -49,8 +49,8 @@ func TestX86InvalidRead(t *testing.T) {
t.Fatal(err)
}
err = mu.Start(ADDRESS, ADDRESS+uint64(len(code)))
if err.(UcError) != ERR_MEM_READ {
t.Fatal("Expected ERR_MEM_READ")
if err.(UcError) != ERR_READ_INVALID {
t.Fatal("Expected ERR_READ_INVALID")
}
ecx, _ := mu.RegRead(X86_REG_ECX)
edx, _ := mu.RegRead(X86_REG_EDX)
@ -66,8 +66,8 @@ func TestX86InvalidWrite(t *testing.T) {
t.Fatal(err)
}
err = mu.Start(ADDRESS, ADDRESS+uint64(len(code)))
if err.(UcError) != ERR_MEM_WRITE {
t.Fatal("Expected ERR_MEM_WRITE")
if err.(UcError) != ERR_WRITE_INVALID {
t.Fatal("Expected ERR_WRITE_INVALID")
}
ecx, _ := mu.RegRead(X86_REG_ECX)
edx, _ := mu.RegRead(X86_REG_EDX)