Python: Fix memory search

This commit is contained in:
Vicki Pfau 2017-10-14 19:07:17 -07:00
parent db69256ce9
commit e820e4dcbb
1 changed files with 6 additions and 9 deletions

View File

@ -100,12 +100,12 @@ class MemorySearchResult(object):
class Memory(object):
SEARCH_32 = lib.mCORE_MEMORY_SEARCH_32
SEARCH_16 = lib.mCORE_MEMORY_SEARCH_16
SEARCH_8 = lib.mCORE_MEMORY_SEARCH_8
SEARCH_INT = lib.mCORE_MEMORY_SEARCH_INT
SEARCH_STRING = lib.mCORE_MEMORY_SEARCH_STRING
SEARCH_GUESS = lib.mCORE_MEMORY_SEARCH_GUESS
SEARCH_EQUAL = lib.mCORE_MEMORY_SEARCH_EQUAL
READ = lib.mCORE_MEMORY_READ
WRITE = lib.mCORE_MEMORY_READ
RW = lib.mCORE_MEMORY_RW
@ -131,12 +131,9 @@ class Memory(object):
params = ffi.new("struct mCoreMemorySearchParams*")
params.memoryFlags = flags
params.type = type
if type == self.SEARCH_8:
params.value8 = int(value)
elif type == self.SEARCH_16:
params.value16 = int(value)
elif type == self.SEARCH_32:
params.value32 = int(value)
params.op = self.SEARCH_EQUAL
if type == self.SEARCH_INT:
params.valueInt = int(value)
else:
params.valueStr = ffi.new("char[]", str(value).encode("ascii"))