From 6b7951e17a74c148d78c84dc0673744f6d71ec0d Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 17 Aug 2017 13:15:32 -0400 Subject: [PATCH] Thanks pycharm This one gave me a minor panic attack --- memhook.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(