srounet / Pymem

A python library for windows, providing the needed functions to start working on your own with memory editing.
MIT License
303 stars 45 forks source link

Fixed the documentation examples for the API pattern #78

Closed airvzxf closed 2 years ago

airvzxf commented 2 years ago

It fixes #79.

The documentation on both modules pattern_scan_module and scan_pattern_page is not recognizing the \x00 values because it converted to zero byte value. When the documentation is displayed in PyCharm or in the web (https://pymem.readthedocs.io/en/latest/api.html#pymem.pattern.pattern_scan_module), it only shows b"." ... b"....d". Also, it should be shown the symbol \ in between the two bytes arrays because the bytes are breaking in a new line for better reading.

The solution was added to the \x?? values another slash to avoid the conversion into bytes, for example \\x??.

I renamed the variables to avoid a PyCharm warning about the module variable is the same as the function def pattern_scan_module(handle, module, pattern, *, return_multiple=False). But, I could change to the original variable names if you wanted.