qb-0 / pyMeow

Python Game Hacking Library
MIT License
347 stars 39 forks source link

Opt out of `checkRoot` (linux) #47

Closed Eein closed 6 months ago

Eein commented 6 months ago

Hello!

I'm replacing some pymem code w/ pyMeow, and I ran into checkRoot which returned that i must be root to use a few functions. In my case, i'm only using open_process, get_module, and all of the various read functions.

I've separately compiled the application myself without the checks and the above functions work fine for my case but thought it might be convenient to have the root check be configurable in some way.

If you agree and have any ideas, I'd be happy to submit a PR.

qb-0 commented 6 months ago

Hey, thanks for creating that issue.

It seems that indeed no root is necessary to access /proc/pid/comm or /proc/pid/maps. However, I'm not so sure about process_vm_readv (r_ calls) and process_vm_writev(w_ calls). Have you tried it?

Feel free to create a pull request to accordingly remove the checkRoot calls.

Eein commented 6 months ago

I have not tried the process_vm_readv/process_vm_writev calls yet

I'm on NixOS on wayland so I'll need a bit to resolve the deps to get a full build working. I'll place this in my backlog. Thanks!

qb-0 commented 6 months ago

Thanks for the pr