diff --git a/memhook.py b/memhook.py index 3a3783c..fe48c3d 100644 --- a/memhook.py +++ b/memhook.py @@ -163,6 +163,7 @@ def _get_base_addr(self): return me32.modBaseAddr + # TODO: better detection def _get_hwnd(self): toplist, winlist = [], [] @@ -170,7 +171,7 @@ def enum_cb(hwnd, results): winlist.append((hwnd, win32gui.GetWindowText(hwnd))) win32gui.EnumWindows(enum_cb, toplist) - urw = [(hwnd, title) for hwnd, title in winlist if 'UnReal World' in title] + urw = [(hwnd, title) for hwnd, title in winlist if 'UnReal World' == title] return urw[0][0] if urw else None @@ -203,6 +204,7 @@ def _press_n_no_focus(self, delay=None): def _read_mem_address(self, address, size, handle): buf = (c_byte * size)() bytesRead = c_ulong(0) + result = None try: result = ctypes.windll.kernel32.ReadProcessMemory(