Expand description
This Crate Provides functionality, for injecting dlls into other processes. Most of the crate is right now accessible through the Injector class.
You will need to provide a pid, and a dll to inject. This crate will do the rest for you.
The main focus will always be on performing the injection reliable. If you care about injecting into a 64 bit application whilst needing to compile this library under 32 bits, you will want to enable the “x86tox64” feature. Be aware, that that feature uses “unofficial” api’s located in ntdll.dll. Compatibility is technically not guaranteed by windows.
If you have any suggestions, on improving the outfacing api of this crate create an issue, or pr. I am not sure yet, if I like this design.
Linux support will probably not come. It is insanely hard and platform specific, because
- we would need to write raw machinecode/shellcode to the target process.
- which then has the necessary code to load the .so
- we need to somehow redirect the target program’s execution, to execute our code
- we need to do that, without somehow disrupting ANY of the program’s code
- we need to return the EXACT state before we did anything, because the other program may need that
If this library is supposed to be helpful I’d want to not require to run it as root. Unfortunately some steps involve calling ptrace. Access to the command is restricted, if you are not the parent process of the process you are trying to trace. These requirements would mean, that we can only inject so files to processes, that the program this library itself created.
Modules§
- error
- Holds all error types
Structs§
- Injector
- This struct will expose certain module private functions, to actually use the api. The exact contents should be considered implementation detail.
Enums§
- Data
- Data can be a Path(if we have std), or a String. Data will get handled differently in no_std and std scenarios
Traits§
- Inject
- This represents the actions, that are supported with a dll.
Functions§
- str_
from_ wide_ str - This function builds a String, from a WTF-encoded buffer.
- trim_
wide_ str - This truncates all 0 from the end of a Vec This will keep other 0 entries in the Vec perfectly intact. This has a worst case performance of o(n). if fast==true, the data MUST only contain NULL-values at the end of the string O(log n) else O(n)