This program extracts and compiles the unsafe function in the rust source code into a dynamic link library, and modifies the call to the unsafe function in the source code into a call to a dynamic link library function
cargo build
Usage: ruspatch [OPTIONS] <DIRECTORY>
Arguments:
<DIRECTORY> rust project directory
Options:
-i inject thread
-h, --help Print help
After successful conversion, a dynamic link library file will be generated in the project directory.
Put the binary file compiled by the modified source code and the dynamic link library file into the same directory for execution.
- Rust projects can only be compiled to executables (no src/lib.rs).
- All use statements in the source code are at the beginning of the file.
- All unsafe functions in the source code do not have the same name.
- Generic unsafe functions are not supported.
- If the parameter and return type of the unsafe function is not pre-imported, it may need to be imported manually.
The profile is available on https://www.cloudlab.us/p/Rpatch/ruspatch-env.