Reaction-diffusion & spectral lighting simulation, rendered on GPU with custom OpenGL shaders.
kmaork / pyinjector Goto Github PK
View Code? Open in Web Editor NEWInject shared libraries into running processes
License: MIT License
Inject shared libraries into running processes
License: MIT License
This is already done for permission errors.
(I'm on Linux)Whenever I type in pid as an existing process name, and path_to_so_file as an existing dll path, it says syntax error for the pid part. What am I doing wrong?
As the title goes, is there any way to inject a DLL into a wine process (running on a Linux system)?
injector\src\linux\elf.c(27): fatal error C1083: 无法打开包括文件: “elf.h”: No such file or directory
lafont@lafont-G3-3579:~/Desktop/csgo/injector/linux-inject-master$ inject 26609 /home/lafont/Desktop/csgo/injector/linux_so_injector-master/libGOESP.so
Traceback (most recent call last):
File "/home/lafont/.local/bin/inject", line 8, in <module>
sys.exit(main())
File "/home/lafont/.local/lib/python3.6/site-packages/pyinjector/__main__.py", line 15, in main
inject(parsed_args.pid, parsed_args.library_path)
File "/home/lafont/.local/lib/python3.6/site-packages/pyinjector/pyinjector.py", line 47, in inject
injector = Injector.attach(pid)
File "/home/lafont/.local/lib/python3.6/site-packages/pyinjector/pyinjector.py", line 33, in attach
call_c_func(libinjector.injector_attach, byref(injector_p), pid)
File "/home/lafont/.local/lib/python3.6/site-packages/pyinjector/pyinjector.py", line 22, in call_c_func
assert ret == 0, '{} returned {}, see injector/include/injector.h'.format(func.__name__, ret)
AssertionError: injector_attach returned -8, see injector/include/injector.h
This is desired anyway, and might allow us to ditch .so copies in hypno
im getting a No Access error even when running it as administrator, and if i try to compile it to have my friend test it so see if its just a me issue it wont compile properly
Is it possible to get the handle of the injected dll?
You may get this when trying to inject on Mac: pyinjector.api.MacUnknownInjectorError: injector_attach returned -1: TASK_FOR_PID error : (os/kern) failure
This should be resolved by rerunning as root. Please comment here if it doesn't solved the issue or if you need to be able to run without root. Please state how you installed pyinjector.
To distribute wheels for mac, we'll need to code-sign the compiled shared libraries. This requires opening a paid apple developer account, which to date costs $100 annually. Currently I do not have such an account, so I will work on this issue once I reach a monthly sponsorship of $8.
Using pyinjector 1.0.5 with madbg 1.2.0, I get:
pyinjector.pyinjector.InjectorError: injector_attach returned -4: Could not find libc
attempting to attach to a Python program. This is on Linux 5.15.8.
System is Debian GNU/Linux 10 (buster) running Python 3.7.3
Installed debugger as
apt install --no-install-recommends python3-pip python3-setuptools python3-wheel python3-dev build-essential
python3 -m pip install madbg
I have this trace trying to attach:
# python3 -m madbg attach 18964
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.7/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.7/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.7/dist-packages/madbg/__init__.py", line 1, in <module>
from .api import set_trace, set_trace_on_connect, post_mortem, run_with_debugging, attach_to_process
File "/usr/local/lib/python3.7/dist-packages/madbg/api.py", line 10, in <module>
from hypno import inject_py
File "/usr/local/lib/python3.7/dist-packages/hypno/__init__.py", line 1, in <module>
from .hypno import inject_py
File "/usr/local/lib/python3.7/dist-packages/hypno/hypno.py", line 4, in <module>
from pyinjector import inject
File "/usr/local/lib/python3.7/dist-packages/pyinjector/__init__.py", line 1, in <module>
from .pyinjector import inject, LibraryNotFoundException
File "/usr/local/lib/python3.7/dist-packages/pyinjector/pyinjector.py", line 13, in <module>
libinjector.injector_attach.argtypes = POINTER(injector_pointer_t), pid_t
File "/usr/lib/python3.7/ctypes/__init__.py", line 369, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python3.7/ctypes/__init__.py", line 374, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/local/lib/python3.7/dist-packages/pyinjector/libinjector.cpython-37m-x86_64-linux-gnu.so: undefined symbol: injector_attach
Hey I was wondering how strong this system really is? Can it inject into 64 bit processes for example? How stable is the api? Thank you for your answer and I can completly understand if you don't want to answer. :D
Injections fail, Love the project but like to see an injection on 3.10 >
<33
Hello,
I have been using your library and this is great work, but I am having an issue when trying to run my program once it's compiled to a Windows executable.
It compiles without errors with PyInstaller but this is what I get when I run it :
C:\Users\razen\PycharmProjects\RAT\dist>main.exe
Traceback (most recent call last):
File "main.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "pyinjector\__init__.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "pyinjector\pyinjector.py", line 6, in <module>
AttributeError: 'NoneType' object has no attribute 'origin'
[12032] Failed to execute script 'main' due to unhandled exception!
This is what I get when running the executable from Py2Exe :
C:\Users\razen\PycharmProjects\RAT\dist>main.exe
Traceback (most recent call last):
File "main.py", line 1, in <module>
File "<frozen zipimport>", line 259, in load_module
File "pyinjector\__init__.pyc", line 1, in <module>
File "<frozen zipimport>", line 259, in load_module
File "pyinjector\pyinjector.pyc", line 6, in <module>
File "importlib\util.pyc", line 90, in find_spec
File "importlib\util.pyc", line 32, in resolve_name
ImportError: no package specified for '.libinjector' (required for relative module names)
This one goes further and it seems like it is an import issue.
I read somewhere that those compilers can only import libraries using the "import" command.
I also see that you import ".libinjector" another way :
libinjector_path = find_spec('.libinjector', __package__).origin
And this is probably what's causing the issue.
Is there any possible fix ?
Thanks !
i need a example
bot working with pyinstaller and py2exe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.