Comments (4)
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.
from pymem.
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
from pymem.
what's your windows version and python version (including bitness in both)I see it's in the original messagethe 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
from pymem.
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.
from pymem.
Related Issues (20)
- Optimize write_bytes method HOT 3
- Optimize Memory Reading / Writing using C types HOT 7
- Wrong use of the length of the bytes being written
- Error HOT 1
- `pymem.process.inject_dll` returns local handle instead of remote HOT 5
- `pymem.pattern.scan_pattern_page` throw windows api error, code 299 HOT 8
- is_64_bit potentionally incorrect HOT 2
- There was a problem converting the string to bytes HOT 2
- Python interpreter injection HOT 2
- switching to github actions HOT 5
- read_string method need a encoding parameter
- add read_unicode_string HOT 3
- inject_python_shellcode(shellcode) not available dict HOT 2
- Suggestion: Change return types to list[int] of pattern_scan_all() HOT 1
- EnumProcessModulesEx - ctypes.ArgumentError: argument 1: OverflowError: int too long to convert HOT 2
- TypeError: 'MockObject' object is not callable HOT 1
- RuntimeError: Could not allocate memory for shellcode in inject_python_shellcode (Python 3.7.16)
- No Module listed HOT 1
- use pyproject.toml HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymem.