Pymem icon indicating copy to clipboard operation
Pymem copied to clipboard

Fix scan_pattern_page read bytes out of range.

Open SakuraHentai opened this issue 1 year ago • 8 comments

fix #111

SakuraHentai avatar Oct 14 '23 15:10 SakuraHentai

With this patched in, I'm unfortunately still receiving WinApi 299 errors from read_bytes.

jmctune avatar Oct 19 '23 02:10 jmctune

With this patched in, I'm unfortunately still receiving WinApi 299 errors from read_bytes.

Is your system is x64, and the target process is x86?

SakuraHentai avatar Oct 19 '23 03:10 SakuraHentai

Is your system is x64, and the target process is x86?

Yes, that is correct. I'm using a 32-bit version of Python 3.11 as well.

jmctune avatar Oct 19 '23 03:10 jmctune

Is your system is x64, and the target process is x86?

Yes, that is correct. I'm using a 32-bit version of Python 3.11 as well.

I just read your library code, it is scanning memory directly with pattern_scan_all, there starts with 0 that should be no offset problem, it is probably caused by other places.

But I've tried the 32-bit process on my computer and it doesn't reproduce it, sorry can't help you.

SakuraHentai avatar Oct 19 '23 07:10 SakuraHentai

Yep, it's nothing fancy. Just a class that's wrapping pattern_scan_all.

I have a few functions that will run a scan indefinitely. It could work for minutes or hours, but it will eventually throw a 299. No changes to the pattern, but the exception is in my linked mention above.

It's not pattern_scan_all itself, but scan_pattern_page, which is called from above. As it's iterating over the pages, there's one page that trips it up while it's executing read_bytes over the pages.

jmctune avatar Oct 19 '23 10:10 jmctune

Yep, it's nothing fancy. Just a class that's wrapping pattern_scan_all.

I have a few functions that will run a scan indefinitely. It could work for minutes or hours, but it will eventually throw a 299. No changes to the pattern, but the exception is in my linked mention above.

It's not pattern_scan_all itself, but scan_pattern_page, which is called from above. As it's iterating over the pages, there's one page that trips it up while it's executing read_bytes over the pages.

Oh, I thought it reported an error on first run.

You can ignore this error, as the program may be freeing memory or switching page properties.

SakuraHentai avatar Oct 19 '23 11:10 SakuraHentai

@StarrFox what's your thoughts on this ?

srounet avatar Nov 28 '23 11:11 srounet

@StarrFox what's your thoughts on this ?

seems fine to me

StarrFox avatar Nov 28 '23 11:11 StarrFox