Skip to content

Commit

Permalink
Thanks pycharm
Browse files Browse the repository at this point in the history
This one gave me a minor panic attack
  • Loading branch information
imayhaveborkedit committed Aug 17, 2017
1 parent 294699e commit 6b7951e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion memhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ def _get_base_addr(self):

return me32.modBaseAddr

# TODO: better detection
def _get_hwnd(self):
toplist, winlist = [], []

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

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 6b7951e

Please sign in to comment.