Open xaoyaoo opened 7 months ago
mbi = pymem.ressources.structure.MEMORY_BASIC_INFORMATION()
pymem.ressources.kernel32.SetLastError(0)
pymem.ressources.kernel32.VirtualQueryEx(handle, address, ctypes.byref(mbi), ctypes.sizeof(mbi))
error_code = ctypes.windll.kernel32.GetLastError()
The error occurs in pymem\memory.py
.
Windows API error code 87 typically indicates an "invalid parameter" error.
https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
ERROR_INVALID_PARAMETER
87 (0x57) 87 (0x57)
The parameter is incorrect.
what's your windows version and python version (including bitness in both) I see it's in the original message
the issue is probably that the api was different in that old version of windows
~what's your windows version and python version (including bitness in both)~ I see it's in the original message
the issue is probably that the api was different in that old version of windows
not different in that old version of windows。 the pymem.memory.virtual_query(handle, address) fail , throw error。so in pattern_scan_all The repaired code is as follows
def pattern_scan_all(handle, pattern, *, return_multiple=False):
next_region = 0
found = []
user_space_limit = 0x7FFFFFFF0000 if sys.maxsize > 2 ** 32 else 0x7fff0000
while next_region < user_space_limit:
try:
next_region, page_found = pymem.pattern.scan_pattern_page(handle, next_region, pattern,
return_multiple=return_multiple)
except:
return found
if not return_multiple and page_found:
return page_found
if page_found:
found += page_found
if not return_multiple:
return None
return found
~what's your windows version and python version (including bitness in both)~ I see it's in the original message您的 Windows 版本和 Python 版本是什么(包括两者中的位数) 我看到它在原始消息中 the issue is probably that the api was different in that old version of windows问题可能是 API 在旧版本的 Windows 中有所不同
not different in that old version of windows。在那个旧版本的Windows中并没有什么不同。 the pymem.memory.virtual_query(handle, address) fail , throw error。so in pattern_scan_all The repaired code is as followspymem.memory.virtual_query(handle, address)失败,抛出错误。所以在pattern_scan_all修复后的代码如下
def pattern_scan_all(handle, pattern, *, return_multiple=False): next_region = 0 found = [] user_space_limit = 0x7FFFFFFF0000 if sys.maxsize > 2 ** 32 else 0x7fff0000 while next_region < user_space_limit: try: next_region, page_found = pymem.pattern.scan_pattern_page(handle, next_region, pattern, return_multiple=return_multiple) except: return found if not return_multiple and page_found: return page_found if page_found: found += page_found if not return_multiple: return None return found
I think we can only use this for now, and what needs to be solved is the problem of parameter errors.
Based on the provided error message, it seems that there is an issue with the
pymem
library while running thewxdump info
command. The specific error ispymem.exception.WinAPIError: Windows api error, error_code: 87
.pywxdump#29
Your Environment
Expected behavior Please provide a clear and concise description of what you expected to happen.
Traceback
Additional context If there is any additional information or context about the problem, please provide it here.