GithubHelp home page GithubHelp logo

Comments (4)

xaoyaoo avatar xaoyaoo commented on July 17, 2024
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.

StarrFox avatar StarrFox commented on July 17, 2024

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.

SnowMeteors avatar SnowMeteors commented on July 17, 2024

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

from pymem.

xaoyaoo avatar xaoyaoo commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.