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

Add and use SetLastError types #88

Closed yeet-bix closed 1 year ago

yeet-bix commented 2 years ago

Came across this issue when trying to use Pymem with pyglet (https://pyglet.org/). It seems that the Kernel32.SetLastError types are incorrect for the current pyglet version 1.5. https://github.com/pyglet/pyglet/blob/6de9cc853c0ced894971f5bbf2b7f61174f8c632/pyglet/libs/win32/__init__.py#L159-L160

However the types are now fixed in this PR: https://github.com/pyglet/pyglet/pull/525 but are yet to be released as they are waiting for a 2.0 release.

I'm aware this is not a Pymem issue, but declaring and using the types within Pymem avoid this issue from occurring, and considering I can't really think of a reason why you wouldn't want to add the types and there's a more likely chance Pymem will release a minor version before pyglet 2.0 lands, I'm hoping I can sneak this through the door 🙏🏽 (I have unblocked myself by building a patched pymem locally with these changes)

I searched the Github Issues and Discord, looks like someone had experienced this before and I assume gave up: image

StarrFox commented 1 year ago

I don't see any issues with this

srounet commented 1 year ago

Seems legit 👌 I also would like to introduce python typing but this is another topic

srounet commented 1 year ago

I don't see any issues with this

Neither do I